Skip to content

[PER-10593] Reset scroll to top on public folder navigation#1070

Open
aasandei-vsp wants to merge 1 commit into
mainfrom
PER-10593-gallery-scroll
Open

[PER-10593] Reset scroll to top on public folder navigation#1070
aasandei-vsp wants to merge 1 commit into
mainfrom
PER-10593-gallery-scroll

Conversation

@aasandei-vsp

Copy link
Copy Markdown
Contributor

@aasandei-vsp aasandei-vsp self-assigned this Jun 30, 2026
@codecov

codecov Bot commented Jun 30, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 51.70%. Comparing base (d84f5d6) to head (6a63152).

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1070      +/-   ##
==========================================
- Coverage   51.71%   51.70%   -0.01%     
==========================================
  Files         354      354              
  Lines       12067    12066       -1     
  Branches     2172     2171       -1     
==========================================
- Hits         6240     6239       -1     
- Misses       5601     5602       +1     
+ Partials      226      225       -1     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@cecilia-donnelly cecilia-donnelly left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Makes sense to me! I tried it and it worked.

Public archive routes don't set showSidebar, so the scroll-to-top
reset in FileListComponent.ngAfterViewInit was skipped, leaving
sub-folders scrolled to the parent folder's position. Ungate the
reset so it runs in all contexts; getScrollElement already targets
the correct element (the document) when there is no sidebar.

Issue: PER-10593
@aasandei-vsp
aasandei-vsp force-pushed the PER-10593-gallery-scroll branch from fcfe7d5 to 6a63152 Compare July 9, 2026 11:06
@aasandei-vsp
aasandei-vsp requested a review from omnignorant July 9, 2026 11:07
@aasandei-vsp aasandei-vsp added the QA This issue is ready for QA / user acceptance testing label Jul 9, 2026
@github-actions

github-actions Bot commented Jul 9, 2026

Copy link
Copy Markdown
Contributor

QA Instructions

QA Testing Instructions for PR: Reset Scroll to Top on Public Folder Navigation


Summary

This PR addresses a bug where navigating to subfolders in the public folder view does not reset the scroll position to the top. Previously, scroll resetting was skipped unless the showSidebar flag was true. The PR updates the logic in the ngAfterViewInit lifecycle method of the FileListComponent to unconditionally reset the scroll to top, and adds a unit test to verify the updated behavior.


Test Environment Setup

  1. Ensure the local development environment is set up and running with the appropriate dependencies installed.
  2. Deploy the application with public folder navigation enabled.
  3. Verify you have folders with nested subfolders available in the public view.

Test Scenarios

  1. Scenario 1: Scroll Reset on Public Folder Navigation

    • Steps:
      1. Open the application and navigate to a public folder in the file browser.
      2. Scroll down to a specific position in the folder list.
      3. Click on a subfolder to navigate into it.
    • Expected Result:
      The subfolder's content should be displayed, and the scroll position should reset to the top (e.g., topmost item visible).
  2. Scenario 2: Scroll Reset on Navigation with Sidebar Enabled

    • Steps:
      1. Open the application and navigate to a private folder with the sidebar visible.
      2. Scroll down to a specific position in the folder list.
      3. Click on a subfolder to navigate into it.
    • Expected Result:
      The subfolder's content should be displayed, and the scroll position should reset to the top (e.g., topmost item visible).
  3. Scenario 3: Application Behavior with Empty Folder

    • Steps:
      1. Navigate to an empty folder in the public view.
      2. Scroll down the page (if the header or sidebar elements allow scrolling).
    • Expected Result:
      The scroll position should remain at the top for an empty folder, as there’s no content to scroll through.
  4. Scenario 4: Regression Test for File Loading

    • Steps:
      1. Open the file browser.
      2. Check that files and folders load properly when navigating between private, public, and shared folders.
    • Expected Result:
      File and folder content should load correctly, and no unintended scrolling behaviors or display issues should occur.
  5. Scenario 5: Regression Test for Unlisted Folders

    • Steps:
      1. Access a shared, unlisted folder link directly (e.g., through a publicly shared URL).
      2. Click into subfolders from this view.
    • Expected Result:
      Subfolders should be displayed with the scroll position reset to the top.

Regression Risks

  • Changes to the ngAfterViewInit logic could inadvertently affect behaviors tied to folder navigation and scrolling.
  • If the logic in getScrollElement() is flawed or does not account for all edge cases, unintended scrolling issues may arise.
  • Sidebar-specific interactions tied to showSidebar might behave differently.

Things to Watch For

  1. Verify that the scroll position is reset only when folders or content are navigated. Unnecessary scroll resets (e.g., on page refresh or UI triggers) should not occur.
  2. Check for compatibility across different browsers (e.g., Chrome, Firefox, Safari, Edge) to ensure consistent scroll behavior.
  3. Ensure the API for getScrollElement() correctly handles cases where no sidebar exists.

Follow these detailed test cases to validate the targeted fix and ensure no unintended side effects are introduced.


Generated by QA Instructions Action

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

QA This issue is ready for QA / user acceptance testing

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants