Thanks to visit codestin.com
Credit goes to github.com

Skip to content

fix(GroupFoldersHome): Show all leaf groupfolders#4516

Merged
provokateurin merged 1 commit into
masterfrom
fix/groupfoldershome/show-all-leaf-groupfolders
Mar 26, 2026
Merged

fix(GroupFoldersHome): Show all leaf groupfolders#4516
provokateurin merged 1 commit into
masterfrom
fix/groupfoldershome/show-all-leaf-groupfolders

Conversation

@provokateurin
Copy link
Copy Markdown
Member

If nested groupfolders are used they don't show up in the left sidebar.

@provokateurin provokateurin added this to the Nextcloud 34 milestone Mar 25, 2026
@provokateurin provokateurin added bug 3. to review Items that need to be reviewed labels Mar 25, 2026
@provokateurin
Copy link
Copy Markdown
Member Author

/backport to stable33 please

@provokateurin
Copy link
Copy Markdown
Member Author

/backport to stable32 please

@provokateurin provokateurin force-pushed the fix/groupfoldershome/show-all-leaf-groupfolders branch from f414a5f to 0219a39 Compare March 25, 2026 14:30
@skjnldsv
Copy link
Copy Markdown
Member

If nested groupfolders are used they don't show up in the left sidebar.

wasn't it on purpose ?

@provokateurin
Copy link
Copy Markdown
Member Author

It's really confusing to users though. Especially if only use nested groupfolders and have none at the top, the list is just empty.

@provokateurin
Copy link
Copy Markdown
Member Author

After creating the PR I also noticed that I used "leaf" in the wrong way.
Nested groupfolders are basically disconnected trees starting at various depths within a bigger tree. Currently we only show the ones at depth 0, while this change ensures we show the top-most "root" groupfolder for any tree at any depth.
I hope this makes a bit more sense now.


// Filter out non top-level folders
$folders = array_filter($folders, fn (FolderDefinition $folder): bool => !str_contains($folder->mountPoint, '/'));
usort($folders, static fn (FolderDefinitionWithPermissions $a, FolderDefinitionWithPermissions $b): int => $a->mountPoint <=> $b->mountPoint);
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.

You can compare strings with a spaceship operator ? 🤯

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

It's the easiest way to do it in a sort function and we do it all the time 😅

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.

Thought it was only for integers 🙈

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

PHP magic 🔮

@provokateurin provokateurin enabled auto-merge March 26, 2026 09:10
@provokateurin provokateurin self-assigned this Mar 26, 2026
@provokateurin provokateurin merged commit 2542ce1 into master Mar 26, 2026
56 of 59 checks passed
@provokateurin provokateurin deleted the fix/groupfoldershome/show-all-leaf-groupfolders branch March 26, 2026 09:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

3. to review Items that need to be reviewed bug

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants