Skip to content

Nested tags - #710

Merged
rathlinus merged 11 commits into
bulwarkmail:mainfrom
MathyV:nested-tags
Jul 30, 2026
Merged

Nested tags#710
rathlinus merged 11 commits into
bulwarkmail:mainfrom
MathyV:nested-tags

Conversation

@MathyV

@MathyV MathyV commented Jul 29, 2026

Copy link
Copy Markdown
Contributor

Summary

This PR makes tags a lot more useful as a filtering mechanism. While the main objective was to add nesting of tags, I also tackled quite a lot of related UX improvements and I completely got rid of the Color-driven narrative, replacing it with a focus on actual tags and their meaning (which still, obviously, happen to have a color-coding).

Changes

  • Add nesting of tags in a tree
  • The levels are joined by forward slashes in the JMAP keywords
  • The behavior is opt-in by a toggle in settings
  • Long paths are shortened for display if there is not enough room
  • Add the ability to hide tags, or only display them if there are unread messages
  • Removed the reset-to-defaults button for tags as it's quite easy to accidentally remove your hard work (ask me how I found out). I thought about adding a confirmation dialog instead, but I don't see the added value of this button and you can still wipe all your settings from the About menu, so I just removed it.
  • Refactored all the displaying of tags to use the same code everywhere with a common control
  • Add remove buttons to tags when the email is open for easy and fast removal
  • Reworked the tag dropdown / context menu to display tags in a tree, make multiselect possible and added a search box
  • Bugfix to make the tinting behavior of selected mails the same in light as in dark theme
  • Reworded and code refactored all references to setting Colors to setting Tags

Related issues

Closes #687

Type of change

  • Bug fix (non-breaking change that fixes an issue)
  • New feature (non-breaking change that adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Documentation update
  • Refactor / code quality improvement
  • Chore / dependency update / CI change

Checklist

  • I have read the Contributing Guide
  • My code follows the project's code style and conventions
  • I have run npm run typecheck && npm run lint and there are no errors
  • The build passes (npm run build)
  • I have tested my changes locally
  • I have added or updated documentation if needed
  • I have updated translations (locales/) if my changes affect user-facing text
  • I have included screenshots or a screen recording for UI changes

Screenshots / demo

To save some time, rather than go through each individual change I just took a recording of me going through the changed things, I hope that is okay.

nested-labels

Notes for reviewers

This PR grew quite a bit larger then I intended to, but in the end all are related, accept the commit about the selected row tints which is a bugfix that just touches common code, so I hope that the individual commits offer enough clarity on how it grew.

I'm a bit on the fence about the default tags that are provided. I wanted in dev mode to be able to see the nested tags immediately, but if I'd introduce nested tags in the default set of tags, then we're also more or less obligated to enable it by default for all users so what is the point of the toggle then? Plus a nice set for dev testing is not per se a good default set for end users. I defined a second set of default tags that gets loaded when in dev mode, but I'm not sure if that is the cleanest solution.

Disclaimer: I used AI to generate the translations other than Dutch and English as I am no native speaker of 22 languages :-). I could not find documentation on how translations are normally done but the guidelines said I should commit them, so 🤷‍♂️ . I also added some extra Catalan translations that were causing the tests to fail.

MathyV added 10 commits July 29, 2026 17:18
- levels are joined by forward slashes in the keywords
- behaviour is opt-in for now
- long paths are shortened if there is not enough display room

Closes bulwarkmail#687.
If you carefully crafted your tags and then click this button by accident, all
your hard work is gone. A confirmation message would be the other solution but
since I have difficulty to grasp when you would need such a button, I propose
to just remove it.
This code is nowhere used, so to prevent extra work during an upcoming refactor
of tags, it is removed and some related tests are now actually made useful
Previously tags where very much focused on color coding email and less about
adding additional information. They were also visualized in different ways in
different locations.

This commit gets rid of all "Color-coding" references, aligns visualization of
the tags across the whole project and tries to improve user experience of using
tags in general.

A search box is shown in the tagging control so the user can quickly search for
a tag if they have a huge (more than 10) amount of tags.
- Tags can now be removed straight from the email header
- Tagging control now allows the user to (de)select multiple tags in one go
@MathyV
MathyV marked this pull request as draft July 29, 2026 17:53
@MathyV
MathyV marked this pull request as ready for review July 29, 2026 17:54
…nu markAsRead

Nested tag toasts from drag-and-drop only showed the leaf name for
non-root tags, contradicting the comment above it and making two
same-named leaves under different parents (e.g. Personal/Receipts vs
Work/Receipts) indistinguishable in the toast.

The context menu's markAsRead handler was the one action left reading
the stale contextMenu.data instead of the live-refreshed
contextMenuEmail introduced alongside it, so it could act on outdated
email state while every sibling handler was already updated.
@rathlinus
rathlinus merged commit c5c6509 into bulwarkmail:main Jul 30, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature]: Ability to nest tags

2 participants