Skip to content

theming: tabs take declared tab roles; from_theme maps them to the header and selected-tab tones - #64

Open
trissim wants to merge 1 commit into
mainfrom
claude-a/tab-tone-roles
Open

trissim wants to merge 1 commit into
mainfrom
claude-a/tab-tone-roles

Conversation

@trissim

@trissim trissim commented Nov 18, 2026

Copy link
Copy Markdown
Contributor

Why

Under a ui_theme scheme, Qt's tab style drew a closed tab in button_normal_bg (ui_theme's surface hover) and the open one in panel_bg (the sidebar tone). So the open tab was darker than the closed ones in every scheme (ΔL* −4 to −10). That is the reverse of Textual's tab bar, where tabs sit on the header tone.

What changed

  • Two declared roles: ColorScheme.tab_bg and selected_tab_bg. generate_tab_color_style reads them.
  • Presets unchanged: the presets keep today's values (dark #404040 / #1e1e1e, light #e6e6e6 / #ffffff), so OpenHCS's tabs look the same.
  • from_theme: maps tab_bg to ui_theme's HeaderToneColour and selected_tab_bg to its new SelectedTabToneColour, which sits a TIER_GAP off the bar.

Tests

  • test_chrome_takes_the_theme_colours also states the two tab roles.

  • New test_touching_chrome_surfaces_are_a_tier_apart_and_text_reads_on_each: for every drawable scheme, these chrome pairs must be at least ui_theme's TIER_GAP L* apart:

    • window/panel
    • window/frame
    • panel/frame
    • panel/alternate rows
    • alternate rows/hover
    • closed/open tab

    It also checks that text_secondary reads at ≥ 4.5:1 (as far as text_primary does) on every area surface.

  • Results: test_color_scheme_from_theme.py 38 passed. The other 20 test files that touch ColorScheme or the style generator have 28 failing tests, the identical set on main (dock layout, widget projection, frame callbacks), so none are new.

Per-scheme before/after numbers are in OpenHCSDev/ui-theme#33.

Rollout

Needs OpenHCSDev/ui-theme#33 merged first, for SelectedTabToneColour and TIER_GAP. Then rebuild the agent-comms runtime, then merge the toad PR.

🤖 Generated with Claude Code

https://claude.ai/code/session_01RnH6dT7wdh7i4tjJZQdFu3

…eme's header and selected-tab tones

The tab style drew a closed tab in button_normal_bg and the open one in panel_bg, so under
a ui_theme scheme the open tab was darker than the others, the reverse of Textual's tab
bar. Tabs now read two declared roles, tab_bg and selected_tab_bg. The presets keep
today's values, so OpenHCS's tabs do not change. `from_theme` maps them to ui_theme's
HeaderToneColour and its new SelectedTabToneColour (a tier off the bar).

Test: every drawable scheme's touching chrome surfaces are at least TIER_GAP lightness
apart, and secondary text reads on every area surface.

Needs ui-theme's tone tiers (OpenHCSDev/ui-theme, claude-a/tone-tiers) merged first.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01RnH6dT7wdh7i4tjJZQdFu3

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.

1 participant