Skip to content

theme: the composer's area and the open tab take shared tone roles; tiers a visible step apart (with ui-theme#33, PyQT-reactive#64) - #2121

Open
trissim wants to merge 1 commit into
mainfrom
fork-qt-theme-contrast
Open

trissim wants to merge 1 commit into
mainfrom
fork-qt-theme-contrast

Conversation

@trissim

@trissim trissim commented Nov 18, 2026

Copy link
Copy Markdown

Why

Tristan, on the phone app: the colours of adjacent UX items "don't differ enough … so it all looks like one thing"; later, "slightly more contrast between the colours of adjacent UX elements".

The owner of the cause is ui_theme's tone derivation, which both frontends draw from. Area tones were fixed shares of the background→foreground distance, and the page and sidebar landed 1.4–3.4 L* apart. That is fixed in OpenHCSDev/ui-theme#33, and the Qt tab roles in OpenHCSDev/PyQT-reactive#64. This PR is toad's part, two places where Qt and Textual disagreed:

  1. The composer's area.
    • Before: Textual's Prompt sits on PromptToneColour. Qt's Composer drew on the page itself (page/composer ΔL* = 0 in every scheme), so the input area read as part of the transcript.
    • After: one declaration on the shared PromptComposer, area_tone = PromptToneColour. Textual's Prompt points its TonePaint.tone at it; TonePaint precedes PromptComposer in its bases, so the class attribute would otherwise hide it. Qt's Composer paints its area with it and follows theme changes in paint_colours.
  2. The open tab.
    • Before: Qt drew it darker than the closed tabs (sunken, ΔL* −4 to −10). Textual marked it only with the underline.
    • After: both raise it a tier off the bar with ui_theme's new SelectedTabToneColour, Qt through pyqt-reactive's selected_tab_bg and Textual through SessionLabel.tone. paint_current refreshes the cached paint, because the tone follows selection.

No widget picks a colour. Each names its role.

The floor and its number

Every area tone sits at least TIER_GAP = 6 CIELAB L* past the surfaces it sits on or beside, solved per scheme.

Why 6: a just-noticeable lightness difference is about 2 L*. Daylight reflected off a phone's glass washes out dark tones most, which is where a dark theme's surfaces live (L* 5–25). Three times the JND reads as a separate surface outdoors. The tiers:

tier roles
0 the page
1 sidebar, prompt
2 rows, header, footer, turn band, float
raised hover, float hover, open tab

Muted text keeps 4.5:1 on the page and every area tone, as far as the scheme's own foreground reads there. Rules keep 3:1.

Measured on the rendered app (textual-dark, the phone's theme, 412×915 offscreen, qt_drive chrome)

Pixels sampled from chrome-2-channel.png, main → this branch with both library branches:

pair main ΔL* branch ΔL*
page / sidebar 3.3 6.3
sidebar / alternate rows 3.9 6.2
page / tab bar 5.8 12.5
tab bar / open tab −2.5 (sunken) +6.4 (raised)
page / composer 0.0 6.3

catppuccin-latte (chrome-4-thread-pane.png): page/sidebar 2.1 → 6.2, sidebar/rows 2.4 → 6.0, open tab sunken → raised 6.1, page/composer 0 → 6.2.

The per-scheme table for all 19 drawable schemes is in ui-theme#33. Every pair is ≥ 6.0 on the branch, against 1.4–5.8 on main.

What I saw in the screenshots (read, not just measured):

  • Main, textual-dark: the sidebar and page are near-identical blacks separated only by 1 px borders. The alternating rows are barely visible. The composer's placeholder sits on the same black as the transcript. The open tab is the darkest thing in the bar.
  • Branch: the sidebar is a visible grey panel and its rows stripe clearly. The composer and its delivery status sit on their own band under the transcript. The thread/settings pane reads as a separate column. The open tab is lifted, with its accent underline.
  • Light theme (catppuccin-latte): the same tiers, stepping darker.
  • TUI on the branch (pilot screenshot): the header bar, grey sidebar, darker page, lifted prompt area and footer, from the same members.

Gates, once, on the final head

These ran on an overlay runtime: the installed runtime hardlink-copied, with ui-theme#33 and PyQT-reactive#64 dropped in. The installed runtime itself is untouched.

On the final head, rebased onto main 19058d2 (which has #2112 and #2115):

gate result
qt_inherit_ratchet exit 0: Textual-UI 11/11, widgets imports 0, bare Qt classes 21/21, copies 0
shadow_check exit 0
glyph_check exit 0
tools/android/check.sh (PYTHONFAULTHANDLER=1) exit 0: the shipped app ran every view kind and bound key on a scratch bus
qt_drive arrival, history, chrome, menu not run on this head: see below

The four drives need the live bus, and it was down. At 04:53 the host ran out of memory and the OOM killer took the systemd user manager. After that, systemctl --user refuses connections and agent-comms status returns no threads. All four drives timed out at "welcome rows", before any step ran.

Run on the same change before the rebase, against the live bus:

drive result
arrival exit 0
chrome exit 0
menu exit 0
history exit 1, at qt_drive.py:649's one-shot sidebar next()

The history failure also happens on unmodified main. #2112, now in this head, replaces that lookup with a waiting one. The four drives must run on this head once the bus is back, before merge.

Library tests:

  • ui-theme: 78 passed.
  • pyqt-reactive: test_color_scheme_from_theme.py 38 passed. Of the 20 other files touching ColorScheme, 28 tests fail, an identical set on main.

Rollout

  1. ui-theme#33
  2. PyQT-reactive#64 (imports SelectedTabToneColour)
  3. rebuild the agent-comms runtime, which installs both at main
  4. this PR, then the APK

This PR imports SelectedTabToneColour, so it must not merge before the runtime has it.

Notes for other forks

The role API (FloatToneColour, FloatHoverToneColour, RuleColour, SurfaceHoverColour, the tier members) is in ui-theme#33. The menu and header-rule forks consume it.

🤖 Generated with Claude Code

https://claude.ai/code/session_01RnH6dT7wdh7i4tjJZQdFu3

… shared roles

Qt's composer drew on the page's own colour, so it read as part of the transcript,
while Textual's prompt sits on PromptToneColour. The composer's area tone is now one
declaration on the shared PromptComposer (`area_tone`); Textual's Prompt points its
TonePaint at it and Qt's Composer paints its area with it.

The open tab is raised a tier off the tab bar in both frontends
(ui_theme's SelectedTabToneColour). Qt had drawn it darker than the other tabs; the TUI
had marked it only by the underline.

Needs ui-theme's tier derivation (TIER_GAP, SelectedTabToneColour) and pyqt-reactive's
tab_bg / selected_tab_bg roles, so it merges after both and a runtime rebuild.

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