Skip to content

Show an account label on threads in multi-account views - #2977

Open
soraxas wants to merge 1 commit into
Foundry376:masterfrom
soraxas:account-label-unified-inbox
Open

soraxas wants to merge 1 commit into
Foundry376:masterfrom
soraxas:account-label-unified-inbox

Conversation

@soraxas

@soraxas soraxas commented Oct 18, 2026

Copy link
Copy Markdown

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.

  • The label only renders when the focused perspective covers more than one account, so single-account views are unchanged.
  • It uses the account's colour from Preferences > Accounts; accounts without a colour get a neutral grey label
  • Two new options in Preferences > General let you toggle the label and the existing colour bar independently:
    • core.workspace.showAccountLabel
    • core.workspace.showAccountColorBar

Screenshots

(They are not real mail content)

Colour Bar:
before2

Account label:
after2-no-bar

Settings:
image

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.
Copilot AI balanced review requested due to automatic review settings October 18, 2026 03:30

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟡 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 AccountTag component (with a small useConfigValue hook) that renders the account name on the account's color, only when the focused perspective spans multiple accounts.
  • Gates the existing AccountColorBar behind 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 AccountTag into 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

No deployments
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.

2 participants