fix(files): Open the sidebar for the current folder, not a stale child#61330
Open
nfebe wants to merge 2 commits into
Open
fix(files): Open the sidebar for the current folder, not a stale child#61330nfebe wants to merge 2 commits into
nfebe wants to merge 2 commits into
Conversation
Contributor
Author
|
/backport to stable34 |
Contributor
Author
|
/backport to stable33 |
Member
|
/compile |
pringelmann
approved these changes
Jun 17, 2026
Member
|
/compile rebase |
When opening the sidebar for a folder, the route still referenced the file id of a previously opened subfolder. Because that subfolder is listed inside the current folder, the sidebar restored its share and details context instead of the current folder's. The active file id is now kept in sync with the route, so a stale id can no longer be restored. Signed-off-by: nfebe <fenn25.fn@gmail.com>
Signed-off-by: nextcloud-command <nextcloud-command@users.noreply.github.com>
4799460 to
4624fb0
Compare
susnux
approved these changes
Jun 19, 2026
Comment on lines
+50
to
+57
| if (typeof activeNode.value?.fileid !== 'number') { | ||
| return | ||
| } | ||
|
|
||
| // Sync even when the active node is the current folder: skipping that case | ||
| // leaves a stale child fileid in the route, which then gets restored into | ||
| // the sidebar when it reopens. | ||
| if (String(activeNode.value.fileid) === String(window.OCP.Files.Router.params?.fileid ?? '')) { |
Contributor
There was a problem hiding this comment.
Suggested change
| if (typeof activeNode.value?.fileid !== 'number') { | |
| return | |
| } | |
| // Sync even when the active node is the current folder: skipping that case | |
| // leaves a stale child fileid in the route, which then gets restored into | |
| // the sidebar when it reopens. | |
| if (String(activeNode.value.fileid) === String(window.OCP.Files.Router.params?.fileid ?? '')) { | |
| if (!activeNode.value?.id) { | |
| return | |
| } | |
| // Sync even when the active node is the current folder: skipping that case | |
| // leaves a stale child fileid in the route, which then gets restored into | |
| // the sidebar when it reopens. | |
| if (activeNode.value.id === String(window.OCP.Files.Router.params?.fileid ?? '')) { |
.fileid is deprecated
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
When opening the sidebar for a folder, the route still referenced the file id of a previously opened subfolder. Because that subfolder is listed inside the current folder, the sidebar restored its share and details context instead of the current folder's. The active file id is now kept in sync with the route, so a stale id can no longer be restored.
Before
Screencast.From.2026-06-16.01-26-10.webm
After
Screencast.From.2026-06-16.11-12-40.webm