Repository navigation
Conversation
Rows in the unified inbox gave no cue about which account a thread belonged to beyond a thin colour bar. Add a small corner label (account name on the account colour) that renders only when the focused perspective spans several accounts.
There was a problem hiding this comment.
🟡 Changes recommended
AccountTag's visibility depends on the focused perspective but it does not subscribe to FocusedPerspectiveStore, so cached thread-list rows can leave the label stale when switching between single- and multi-account views.
1 open issue
What changed in this PR
This PR adds a small account label pinned to the top-left corner of each thread row in multi-account views (e.g. the unified inbox), so users can tell which account a thread belongs to. It also makes the existing account color bar independently toggleable. Both features are controlled by two new General preferences (core.workspace.showAccountLabel and core.workspace.showAccountColorBar), defaulting to on to preserve current behavior.
Changes:
- Adds a new
AccountTagcomponent (with a smalluseConfigValuehook) that renders the account name on the account's color, only when the focused perspective spans multiple accounts. - Gates the existing
AccountColorBarbehind a new config key, reacting to config changes at runtime. - Wires two new boolean preferences into the config schema and the Workspace preferences section, and injects
AccountTaginto the wide and narrow thread-list columns with supporting LESS styles.
| File | Description |
|---|---|
| app/src/components/account-tag.tsx | New component rendering the per-row account label in multi-account views. |
| app/src/components/use-config-value.ts | New hook that re-renders a component when a config key changes. |
| app/src/components/account-color-bar.tsx | Adds runtime toggle (showAccountColorBar) with config subscription and cleanup. |
| app/src/config-schema.ts | Declares the two new workspace boolean settings. |
| app/internal_packages/preferences/lib/tabs/workspace-section.tsx | Surfaces the two new toggles in Preferences > General. |
| app/internal_packages/thread-list/lib/thread-list-columns.tsx | Renders AccountTag in the wide and narrow columns. |
| app/internal_packages/thread-list/styles/thread-list.less | Styles/positions the .account-tag anchored to the list row. |
| app/src/global/mailspring-component-kit.js | Registers AccountTag for lazy loading. |
| app/src/global/mailspring-component-kit.d.ts | Adds the AccountTag type export. |
Review effort: Balanced
Comment on lines
+9
to
+15
| export const AccountTag: React.FC<{ accountId: string }> = ({ accountId }) => { | ||
| const enabled = useConfigValue<boolean>('core.workspace.showAccountLabel'); | ||
| if (!enabled) return null; | ||
| if (FocusedPerspectiveStore.current().accountIds.length < 2) return null; | ||
|
|
||
| const account = AccountStore.accountForId(accountId); | ||
| if (!account) return null; |
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Summary
In the unified inbox (or any view spanning several accounts) there is no clear cue about which account a thread belongs to beyond a thin colour bar next to the sender. This adds a small label pinned to the top-left corner of each row, showing the account name on the account's colour.
core.workspace.showAccountLabelcore.workspace.showAccountColorBarScreenshots
(They are not real mail content)
Colour Bar:

Account label:

Settings:
