Skip to content

fix: folder tree selection after any action in main content#59359

Open
mykh-hailo wants to merge 1 commit intonextcloud:masterfrom
mykh-hailo:fix/folder-tree-view-selection
Open

fix: folder tree selection after any action in main content#59359
mykh-hailo wants to merge 1 commit intonextcloud:masterfrom
mykh-hailo:fix/folder-tree-view-selection

Conversation

@mykh-hailo
Copy link
Copy Markdown
Contributor

@mykh-hailo mykh-hailo commented Mar 31, 2026

Summary

his PR improves UI behavior and layout consistency in file navigation.
It fixes incorrect selection behavior in the Files left sidebar for folder-tree entries.

Checklist

AI (if applicable)

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

Signed-off-by: mykh-hailo <kristianderonta0205@gmail.com>
@mykh-hailo mykh-hailo requested review from a team and skjnldsv as code owners March 31, 2026 17:06
@mykh-hailo mykh-hailo requested review from nfebe and sorbaugh and removed request for a team March 31, 2026 17:06
Comment on lines +32 to +43
const isFolderTreeNode = computed(() => props.view.id.startsWith(`${folderTreeId}::`))
const isDirectoryActive = computed(() => {
if (!isFolderTreeNode.value) {
return false
}

const currentView = String(route.params?.view ?? '')
const currentDir = normalizeDir(route.query?.dir)
const viewDir = normalizeDir(props.view.params?.dir)

return currentView === folderTreeId && currentDir === viewDir
})
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.

Can't really say I'm happy to see custom view code into a global component, but I don't really see a better way, that's correct yeah 🤔

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.

@susnux , any opinions ?

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.

Seems like a router issue / design problem.
Because the URL is bound to active file not active folder (/files/ACTIVEFILE?dir=ACTIVEFOLDER vs /files/ACTIVEFOLDER?file=ACTIVEFILE)

So this happens because we se the to of the view to /files/FOLDERID right?
Does it work if we instead just use "additional params" and use the dir param?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

@susnux that can be a great idea.
Let me update the code on your comment.

@skjnldsv skjnldsv requested a review from susnux April 1, 2026 06:37
@skjnldsv skjnldsv added this to the Nextcloud 34 milestone Apr 1, 2026
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.

Folder tree view: Selected folder in left sidebar is deselected after any action in main window, causing loss of user context

3 participants