Skip to content

THI-464: Rail: colour a pane card, with the tint strength in Settings - #63

Open
tdody wants to merge 10 commits into
mainfrom
thibaultdody/thi-464-rail-colour-a-pane-card-with-the-tint
Open

tdody wants to merge 10 commits into
mainfrom
thibaultdody/thi-464-rail-colour-a-pane-card-with-the-tint

Conversation

@tdody

@tdody tdody commented Nov 18, 2026

Copy link
Copy Markdown
Collaborator

Closes THI-464.

What it does

You can give a pane card in the rail one of six colours, so a group of sessions is easy to find at a glance.

  • Where the colour shows. It tints the whole block a pane shows as: its tree card, its Next card and its PINNED row. It never colours the state stripe, the agent glyph or a blip.
  • How to set it. Hover a card and click the colour bar in its actions, or right-click the card. In the menu:
    • 1–6 picks a colour, 0 or Backspace removes it, and R renames the colours.
    • The arrows move a cursor, and Enter acts on its row.
    • Tab, Escape, a click elsewhere or focus leaving the menu closes it.
  • Preview. The card shows the colour under the pointer or the cursor before you pick it.
  • Names. You can rename a colour, for example Iris → "ci". The selected card shows the name in a chip, and the colour button's tooltip names it.
  • Tint strength. Settings → Tab colours sets it: Quiet (9%), Default (13%) or Strong (18%). It saves on change, like Fonts.
  • The six colours. Rose (2), Clay (62), Moss (125), Sky (210), Iris (255) and Plum (312), all at L 0.72 and C 0.10. Their hues keep at least 0.040 OKLab from every state and kind hue. DESIGN.md adds them with the Tint Rule: a tab colour is a tint, never a mark.

How it works

  • Server (routes/prefs.py):
    • A window annotation takes colour (one of TAB_COLOURS; "" removes it). The pane's colour lives on its annotation, like its pinned files.
    • ui prefs take tab_tint (one of TAB_TINTS) and tab_colour_names.
    • The server is the one cleaner of names: it trims them, drops empty names and names that only repeat the hue, and rejects unknown colours and names over 24 characters.
  • Client:
    • static/src/tabColours.js holds the lists and the menu's key reducer.
    • split/TabColourMenu.jsx is the menu, built on the shared Menu classes (.tb-dd-menu / .tb-dd-item).
    • overlays/TabColourPicker.jsx is the Settings fieldset.
    • main.jsx sets --tab-wash on :root from the pick.

Changes from the ticket

The ticket was written before #59 shipped the sonar strip and the Next cards:

  • No square mark. In the strip, a broken pane's blip is a 7px square, so the "square is yours" mark from the prototype is gone. Every place a pane appears is now a card, so the colour is a tint everywhere and its swatch is a bar.
  • New hues. Teal is now Sky (210), Iris moved to 255 and Plum to 312, because the prototype's values sat almost on Account Teal, Ticket Purple and Track Magenta.

Tests

  • bin/check passes. Biome shows 3 warnings, all already on main.
  • pytest 2267 passed. vitest 1508 passed. static/dist is fresh.
  • New tests:
    • Server: tint, names and annotation colour (tests/routes/test_prefs.py), including a sync test of the ids and the name limit against tabColours.js.
    • Key reducer and row preview (tabColours.test.js).
    • Prefs: the optimistic colour, the revert on a failed save, and names sent as typed.
    • Rail render: tinted tree card, Next card and PINNED row; no tinted blip; the name chip; the open menu with its counts.
    • The Settings tiles.
  • Checked by hand in Chromium on a dev backend (:17375):
    • Right-click and the button open the menu. Keys and arrows work, and the menu has focus before any key.
    • Tab closes the menu. ⌘0 does nothing. A right-click on a PR or Linear chip keeps the native menu.
    • Rename saves on Enter, and Escape cancels it.
    • The Settings tint applies at once, and a coloured selected card keeps the blue ring.
    • Secondary text on a tinted card measures 6.67:1.

Review

A multi-agent review found 6 Medium and 10 Low issues, with 1 blocking merge. All are fixed in this branch:

  • Blocking: the menu now uses the shared Menu classes.
  • Menu keys and focus: Tab and lost focus close it, chords pass through, links and text fields keep their own right-click, and the menu never opens under the header.
  • Data: one cleaner for names, and the new hues.
  • Contrast: the tinted text is fixed.
  • Small cleanups: a shared Settings tile rule, docs that match the code, and the test gaps.

Assumptions to challenge

  • A colour is per pane (@periscope_id), not per branch or per track. It goes when the window entry is reaped after 30 days unseen, the same as pinned files. Notes and tags never expire.
  • Colour names are global: one name per colour, for every pane.
  • Six colours are enough. A seventh would sit within 0.040 OKLab of an existing hue.
  • The colour is the user's only. No MCP tool sets it, and a spawned pane does not inherit it.

🤖 Generated with Claude Code

tdody and others added 10 commits November 17, 2026 22:54
…e tab tint and the colours' names (THI-464)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ur button or a right-click, and Settings → Tab colours sets how strongly it tints (THI-464)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…s them off stripes, glyphs and blips (THI-464)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… over the rail closes it, not the rail's own scroll anchoring (THI-464)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…hue's own name; Teal becomes Sky (THI-464)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…, leaves chords, links and text fields alone, and cancels a rename on Escape; tinted cards keep their text at 4.5:1 (THI-464)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ts the tab colours' chroma, swatch sizes and menu (THI-464)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.

1 participant