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

@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

@mykh-hailo mykh-hailo Apr 6, 2026

Choose a reason for hiding this comment

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

@susnux I update some codes to make tree view selection works properly as expected.
For a technical overview, I have the FolderNavigationListItem to be active according to dir parameter of the route.
I'd appreciate it if you review and share any opinion on it.

@skjnldsv skjnldsv requested a review from susnux April 1, 2026 06:37
@skjnldsv skjnldsv added this to the Nextcloud 34 milestone Apr 1, 2026
Signed-off-by: mykh-hailo <kristianderonta0205@gmail.com>
@mykh-hailo mykh-hailo force-pushed the fix/folder-tree-view-selection branch from 86139a8 to 8306091 Compare April 6, 2026 04:34
@susnux susnux added the team: Files Code maintained by 📁 Files team label Apr 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

3. to review Waiting for reviews bug feature: files team: Files Code maintained by 📁 Files team

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

4 participants