Repository navigation
feat(ui): allow folding an account to a single line - #13736
dillardblom wants to merge 5 commits into
Conversation
|
Thanks for opening your first pull request in this repository! ✌️ |
|
Thanks for your PR 👍 |
kra-mo
left a comment
There was a problem hiding this comment.
The feature makes sense. The account name labels should be aligned with the other labels, though:
Although I do wonder whether this should be done in nextcloud-vue instead? Like to have a collapsible header component we can reuse. @ShGKme?
|
I do also wonder whether we should keep "Collapse folders" even with this. |
|
Yeah, seeing them like that, I think F works the best as well. |
|
Okay, I will adjust according to F and update this PR! |
|
Updated to F: the toggle now sits at the end of the row, so the account name lines up with the folder icons with no extra indentation. |
|
One correction to the F update: the toggle was still landing between the name and the actions menu. It now sits after the actions menu, so it lines up with a folder's own disclosure arrow. |
809107b to
49d3b21
Compare
|
Pushed one more revision of F, now with a small indent so an account's mailboxes read as belonging to it rather than a flat continuation of the list. Screenshots (account names redacted): Expanded — mailboxes indented under the account, chevron still lined up with the other accounts' (the scrollbar appearing after expanding accounts for the extra rows): Also squashed the two follow-up fixes (toggle position, this indent) into the original commit so the history stays readable. |
49d3b21 to
d6046e7
Compare
Add a chevron in front of every account in the navigation. Folding an account hides all its mailboxes, including the inbox and the special folders that the existing "Collapse folders" toggle keeps visible, so many accounts fit on one screen. A folded account shows the number of unread messages in its inbox next to its name. Account headers that directly follow each other have no extra spacing between them. The account name now links to the account's inbox, so switching between accounts does not require unfolding them. Other folders are still reached by unfolding the account. While its inbox is open, a folded account is highlighted like an active navigation entry. The folded state is stored per account in the existing account-settings preference, like the collapsed state, so no backend change is needed. The toggle is disabled while saving and reverts if saving fails. Creating a folder in a folded account unfolds and saves it. Saves of the account-settings preference are now queued. Each save sends the whole list, so with a toggle per account an older snapshot could otherwise overwrite a newer one when requests finish out of order. This also applies to the existing collapsed setting. The account header is now a list item with a heading, a link and the actions menu instead of an NcAppNavigationCaption, because the caption only renders plain text and cannot hold the chevron, link and counter. Left out on purpose: the unified inbox and provisioned accounts that are disabled for the current session cannot be folded or linked. Closes nextcloud#9300 Assisted-by: Claude Code:claude-opus-5-5 Assisted-by: Codex:gpt-5.6-sol Signed-off-by: Dillard Blom <dillard.blom@ensembia.com>
Move the toggle to the end of the row, after the actions menu, same as a folder's own disclosure arrow, so the two line up in the same column. The account name now starts flush with the row, lined up with the folder icons below it. Indent an account's mailboxes a little under its header, so the list reads as a hierarchy instead of a flat stack. The item's own CSS sets width: 100%, so the inset has to come off that width too -- a plain margin would push the row's right edge past the list and misalign its trailing icons with the account header's. Signed-off-by: Dillard Blom <dillard.blom@ensembia.com>
d6046e7 to
53fdb35
Compare
|
Thanks @dillardblom, could you please take a look at the conflicts. The app was migrated to vue3 and so a lot of code changed. |
|
Thanks for the reminder @kesselb, I'm going to take a look and fix it! |
Port the folding to the Vue 3 migration on main: the account header renders without the vue-frag Fragment, uses subpath imports, the camelCase props of @nextcloud/vue 9 and NcCounterBubble's count prop, and fetches the quota when the menu entry mounts, like main does. The NavigationAccount spec moves to @vue/test-utils 2. Assisted-by: Claude Code:claude-opus-5-5 Signed-off-by: Dillard Blom <dillard.blom@ensembia.com>
Every account header has its own actions menu, and the default label "Actions" made them indistinguishable for screen readers. Assisted-by: Claude Code:claude-opus-5-5 Signed-off-by: Dillard Blom <dillard.blom@ensembia.com>
|
Conflicts with the Vue 3 migration are resolved. The account header now works without vue-frag, uses the @nextcloud/vue 9 props and subpath imports, and fetches the quota the same way main does. The component spec is ported to @vue/test-utils 2. I also gave each account's actions menu an accessible label that names the account ("Actions for {email}"), so the menus are distinguishable for screen readers. Checked again in the browser with three accounts: folding, the unread counter, the inbox link with its highlight, and the state surviving a reload. |






Closes #9300
Summary
With several accounts, the navigation stays long even with "Collapse folders", because the inbox, favourites, drafts, sent and trash of every account remain visible. This adds a chevron in front of every account to fold it to a single line:
account-settingspreference, like the collapsed state, so there is no backend change. The toggle is disabled while saving and reverts if saving fails. Creating a folder in a folded account unfolds it.account-settingspreference are now queued. Every save sends the whole list, so with a toggle per account an older snapshot could otherwise overwrite a newer one when requests finish out of order. This also applies to the existing collapsed setting.The account header is now a list item with a heading, a link and the actions menu instead of an
NcAppNavigationCaption, because the caption only renders plain text and cannot hold the chevron, the link and the counter. The existing "Collapse folders" toggle is unchanged.Not included on purpose: the unified inbox and provisioned accounts that are disabled for the current session cannot be folded or linked.
Screenshots
Testing
NavigationAccount(toggle state, counter and its screen reader label, inbox link, active highlight, disabled accounts).🤖 AI (if applicable)