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
@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
@mykh-hailo mykh-hailo force-pushed the fix/folder-tree-view-selection branch 2 times, most recently from 8e5c85f to a7172a3 Compare April 7, 2026 13:38
@mykh-hailo
Copy link
Copy Markdown
Contributor Author

@susnux I updated the code with the latest master branch.
I'd appreciate it if you check it please.

@mykh-hailo mykh-hailo force-pushed the fix/folder-tree-view-selection branch 3 times, most recently from aaf8ec9 to f7243b8 Compare April 7, 2026 16:03
@mykh-hailo
Copy link
Copy Markdown
Contributor Author

@susnux , @skjnldsv
I'd appreciate it if you provide any updates on this PR.

@mykh-hailo mykh-hailo force-pushed the fix/folder-tree-view-selection branch 2 times, most recently from a43ee10 to be24676 Compare April 9, 2026 09:38
@mykh-hailo mykh-hailo requested a review from skjnldsv April 9, 2026 10:00
@mykh-hailo
Copy link
Copy Markdown
Contributor Author

@skjnldsv , @susnux , @sorbaugh , @nfebe
Could you provide me any updates on this PR please?

Signed-off-by: mykh-hailo <kristianderonta0205@gmail.com>
@mykh-hailo mykh-hailo force-pushed the fix/folder-tree-view-selection branch from be24676 to 69fe46e Compare April 9, 2026 14:03
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