Skip to content

fix: find scrollTo targets on all pages of the file lists - #4118

Merged
AlexAndBear merged 2 commits into
mainfrom
fix/scrollto-other-page
Nov 2, 2026
Merged

AlexAndBear merged 2 commits into
mainfrom
fix/scrollto-other-page

Conversation

@AlexAndBear

@AlexAndBear AlexAndBear commented Nov 2, 2026 •

Copy link
Copy Markdown
Member

Description

A scrollTo link (e.g. closing a file opened from a permanent link) now switches to the page the file is on in folders, favorites, search results and the trash bin, like the share views already do. Before, only files on the current page were found.

Related Issue

How Has This Been Tested?

  • test environment: unit tests (Vitest), browser tests (Playwright) against a local OpenCloud
  • test case 1: unit: folders, favorites, search and trash look up the target beyond the current page; useScrollTo/usePagination switch to the target's page
  • test case 2: browser: permanent link and direct scrollTo URL to targets on page 2/3 in table and tiles, with different sort orders, folders first, hidden files, items per page, search, trash, file-as-folder redirect and mobile; page 1 targets, back button and public links unchanged, no loops (share views blocked by the test backend); favorites: direct scrollTo to page 2 selects the item

Types of changes

  • Bugfix
  • Enhancement (a change that doesn't break existing code or deployments)
  • Breaking change (a modification that affects current functionality)
  • Technical debt (addressing code that needs refactoring or improvements)
  • Tests (adding or improving tests)
  • Documentation (updates or additions to documentation)
  • Maintenance (like dependency updates or tooling adjustments)

@JammingBen JammingBen 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.

One edge case I found:

  • Go to page 2 of any folder
  • Open a doc and close it -> it scrolls to the selected file on page 2 - good
  • Go to page 1 and select another file

Now when the file list refreshes for some reason (SSE event, manual refresh via clicking the breadcrumbs, reload), the user jumps back to page 2. On main, the user stays on the page they selected last, which I feel like makes more sense in this scenario.

@AlexAndBear

Copy link
Copy Markdown
Member Author

Fixed in 2905a54: the scrollTo param now gets dropped when you switch pages or select another file, so refreshes keep your page.

@AlexAndBear
AlexAndBear merged commit 77eae1a into main Nov 2, 2026
28 checks passed
@AlexAndBear
AlexAndBear deleted the fix/scrollto-other-page branch November 2, 2026 16:44
@openclouders openclouders mentioned this pull request Nov 2, 2026
1 task
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

scrollTo links to a file on another page of a folder do nothing

2 participants