Skip to content

fix(files): sync sidebar route on open#60719

Open
hweihwang wants to merge 1 commit into
masterfrom
fix/files-sidebar-active-folder-route
Open

fix(files): sync sidebar route on open#60719
hweihwang wants to merge 1 commit into
masterfrom
fix/files-sidebar-active-folder-route

Conversation

@hweihwang
Copy link
Copy Markdown
Contributor

@hweihwang hweihwang commented May 25, 2026

Summary

  • Sync the Files sidebar route fileid to the node being opened while adding opendetails=true.
  • Allow opendetails route handling to resolve the current folder, not only cached child rows.
  • Prevent breadcrumb Share from reopening a stale newly-created child folder when the visible/current folder is the parent.

TODO

  • Maintainer guidance on automated coverage, backport labels, and milestone if needed.

Checklist

AI (if applicable)

  • The content of this PR was partly or fully generated using AI

Verification

  • Before browser smoke: from stale route /index.php/apps/files/files/1681?dir=/p9697460, breadcrumb p9697460 > Share reopened child c9697460; URL stayed on 1681&opendetails=true.
  • After browser smoke: from the same stale route, breadcrumb p9697460 > Share opened parent p9697460; URL changed to /index.php/apps/files/files/1680?dir=/p9697460&opendetails=true.
  • After browser smoke: direct load of /index.php/apps/files/files/1680?dir=/p9697460&opendetails=true opened the parent sidebar.
  • Build: npm run build in build/frontend-legacy; only existing asset-size warnings. Generated dist/ output was not committed.
  • Formatting: git diff --check HEAD~1..HEAD passed.

Signed-off-by: Hoang Pham <hoangmaths96@gmail.com>
@hweihwang hweihwang force-pushed the fix/files-sidebar-active-folder-route branch from 218bdbc to 163e1c0 Compare May 25, 2026 09:24
@hweihwang hweihwang marked this pull request as ready for review May 25, 2026 09:28
@hweihwang hweihwang requested review from a team and skjnldsv as code owners May 25, 2026 09:28
@hweihwang hweihwang requested review from nfebe and sorbaugh and removed request for a team May 25, 2026 09:28
logger.debug('sidebar: already open for current node - switching tab', { tabId })
setActiveTab(tabId)
}
updateOpenRoute(node)
Copy link
Copy Markdown
Contributor

@susnux susnux May 25, 2026

Choose a reason for hiding this comment

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

Why are those changes needed? The fileid should already be handled by the active store?
So the watcher here should properly trigger the opendetails query?

Comment on lines +316 to +319
// if we just loaded the app.
const node = (this.currentFolder?.fileid === fileId
? this.currentFolder
: this.nodes.find((n) => n.fileid === fileId)) as INode | undefined
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

It seems like this is enough to fix the issue

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: Sharing parent folder after creating subfolder opens child in sidebar

2 participants