Repository navigation
readability wave: one calm body ink, a palette that measures the terminal, ink that settles - #34
Merged
Merged
Conversation
The transcript's brightest thing was the paragraph. A reply's markdown is rendered by internal/tui2/prose, which resolves colour from internal/tui2/tokens, so the body wore tokens' #E6E6F0 while every row this surface drew around it wore tui3's own, dimmer ink — two whites on one screen, the louder one on the thing a person reads most. tokens.Styler.WithBodyInk is the seam: the colour authority a caller hands prose may be asked to say the body tier in the caller's own voice. One Styler, one answer to which white, and the heading ladder, the code ramp and the raised plane under an inline span all stay prose's. prose's painter now asks the Styler for a foreground rather than reaching past it to the token, so a bold word and a link label move with the paragraph around them. The v2 surface is untouched: the override travels on the Styler and never enters the table. And the ink itself comes down. #D8DEE9 measured 12.65:1 against the middle of the assumed dark grounds — half again as bright as the person's own accent, on a surface whose accent budget is one lit element per screen. #C6CDDA holds the hue at 219 degrees, drops L 88.0 to 81.6, measures 10.70:1, and resolves to xterm-256 252, which is claimed by nothing on either ladder. The light ladder's #3B4252 was already inside the band at 10.06:1 and a value in band is not touched. THE GLARE LAW is now a test: the reading tier's top rung sits between 8:1 and 11:1 against the middle of its assumed ground, on both ladders, and stands a clear step above the second voice. A second test renders a reply through the surface's real styler and asserts the palette's own ink reaches the row on the truecolor rung and on the 256 rung, where two nearest-neighbour walks with different metrics have to agree. Co-Authored-By: Claude Fable 5 <[email protected]>
THE GROUND LADDER's comment said the terminal's own background was unknown to us and no query a constructor could block on. That wall has a door: bubbletea v2 answers tea.RequestBackgroundColor with an event, so Init asks on the first frame and nothing waits for the reply. adaptive.go is the arithmetic — pure functions from one measured colour to a finished ladder. The three ground steps are composited out of the terminal's own background at the ratios the file already aimed at, so they inherit its tint and land on the grey ramp on the 256 rung. The reading tiers are held in bands, and a value in band is not touched: an ordinary terminal sees nothing change, a black screen stops glaring, a tinted page stops disappearing. The signal set is verified against the real ground and may only be moved as one, which is the isoluminant band kept by construction rather than checked. A light reply flips the ladder outright, which makes theme detection exact instead of COLORFGBG's guess. Silence stays a supported answer and costs nothing: no timer, no deadline, no fallback path — the authored palette simply stands, which is what every wave before this one shipped. Co-Authored-By: Claude Fable 5 <[email protected]>
A reply that is still arriving is the one live thing on the screen, and the accent budget says the one live thing may lead. It cannot lead in the accent — nothing the model writes is ever painted in the person's own hue — and it cannot lead in weight, because weight belongs to markdown. So it leads the only way left: ONE LIGHTNESS STEP up the reading ladder, in the body's own hue. hueLive (#D8DEE9, 254 on the grey ramp) is the value hueInk carried before the readability wave calmed the body down, taken here on purpose: a tier defined as "one step above the body" has to be authored against the body, and the step the body vacates is the one already measured and already inside the "nothing bright" law. lightLive (#2E3440, 237) makes the light ladder's move — on a page a growing edge leads by being darker. Both round onto the grey ramp, both were checked against every other role, and while hueInk is still #D8DEE9 the two are one colour and the effect is simply ABSENT rather than backwards. Only the plain tail is lifted — the bytes since the last markdown promotion, which IS the growing edge. The promoted head carries prose's own styling and is left alone: every promotion is the surface deciding those bytes are final enough to format, so a calm head under a lit tail says in ink what the promotion already says. Below the 256 rung nothing is drawn at all. Every other hue in the table falls back to weight and this one may not — a bolded live reply is indistinguishable from one that opened in bold, and faint says the opposite of what the tier means. With no hue to spend there is nothing honest to degrade to. The settle itself is closeLive's stale flag, which was already there and is now load-bearing: a settled block is not one of the shapes that bypass the row cache, so without it the bright rows would outlive the turn by hours. Co-Authored-By: Claude Fable 5 <[email protected]>
# Conflicts: # internal/tui3/styles.go
# Conflicts: # internal/tui3/designlanguage_test.go
Three lanes landed one wave — the body ink came down off its glare, a live tier appeared above it, and the whole palette learned to measure the terminal instead of assuming it. Each lane was correct alone and none of them could close the joins, because a join is only visible once both sides exist. This is the joins. THE STYLER FOLLOWS THE PALETTE. A model's markdown is painted by internal/tui2/prose, and the only reason it comes back in this surface's body white is that markdown.go states the ink on the Styler prose is handed. That statement was made once, at startup, against an assumed ground. adaptive.go re-derives the ink the moment a terminal answers — so an adapted session repainted every row on the screen against the measured ground and left the ONE THING A PERSON READS MOST on the ladder nobody measured: the two-whites defect this wave removed, walking back in through the door this wave added. The styler is now held on the app and rebuilt in [app.repaintPalette], which is already the "the ladder changed" hook. Nil is the whole of "this surface has measured nothing", so every session that never hears back from its terminal — most of them, and every test — reads the process-wide styler and pays nothing. The three call sites that had an app to ask (the transcript's markdown, an opened table's splice, a highlighted source block) go through [app.styler]; the package-level [renderMarkdown] stays a pure function, because tests need one. THE DERIVATION COVERS THE LIVE TIER. adaptive.go was written before the live tier existed, so a measured terminal got three reading tiers re-aimed and the fourth left where an assumed ground had put it — which on a black screen meant a body pulled down to comfort with the streaming text still up at the glare. [liveOver] holds it one clear step above the ink derived beside it, in [liveStep]: a band, like every other tier, except that this one is a MULTIPLE of the ink's own contrast rather than a contrast, because "the body, still arriving" is a RELATION and a relation cannot be held to an absolute number. Both authored pairs sit inside it, so A VALUE IN BAND IS NOT TOUCHED keeps them byte-identical on the grounds they were authored against. Where a ground has no headroom above its ink the tier is ABSENT and live IS the ink — the degradation styles.go already named, and the reason settle_test.go asserts live >= ink. THE GLARE LAW NAMES ITS ONE EXCEPTION. hueLive stands above the ceiling deliberately: the law is about a colour somebody reads for minutes and this one is gone in seconds. An exception with nothing holding it is a hole, so it now has two bounds of its own — it may not climb back into tokens' own #E6E6F0, the white this wave took away, and the STEP itself is held inside [liveStep] so a retune cannot walk the streaming paragraph into glare by widening the gap while leaving the ceiling alone. Both are in TestTheLiveTierIsTheGlareLawsOneException. ONE IDEOLOGY, EVERY CHAT SURFACE. tui3 draws a conversation in three places — the transcript, a node's room, and a run's node journal — and the first two laws hold on all three for free, because all three go through one deck and one set of renderers. That is now asserted rather than assumed (TestANodesRoomSettlesLikeTheConversation). The third did not hold, and it is fixed here. [app.roomRows] keeps a laid-out row list of its OWN, and [app.repaintPalette] dropped the app's and not the room's — so a background reply that arrived while somebody was standing in a node's page left that page in yesterday's ladder for as long as they stayed on it. One flag, and the test that would have caught it. AND ONE MERGE SEAM IN A LANE'S OWN TABLE. adapt picked #282828 as "a dark ground the authored ink already clears", and against the ink of the day it did. The calmed ink measures 9.23:1 there, under the floor, so the derivation lifts it — correctly. The case moves to #1e1e2e, which is what it was ever testing. Co-Authored-By: Claude Fable 5 <[email protected]>
…inal hueData was nord's #88C0D0 for four waves, and on the rung where hues are rounded it was not a cyan at all: it resolves to xterm-256 110, which is #87afd7 — a steel blue, and the exact index hueMuted rounds to. So on every 256-colour terminal the payload rule's datum wore the second voice's own colour. The rule exists to lift a model id, a figure or a key chord out of a dim line by giving it a hue of its own; a lifted datum painted in the tier it was lifted out of is the rule doing nothing while appearing to work. The move is the smallest one that fixes it and it is the move this file always makes: hue held at 193°, saturation held at 43%, lightness up L 67.5 -> 70.0. That is the first step onto 116 — #87d7d7, an actual cyan, claimed by nothing on either ladder. L 69.0 still rounds to 110 and L 73.0 has gone on to 152, so the window is narrow and this is inside it. The signal band is unmoved: the spread it measures runs from hueDel's L 61.0 to hueAccent's L 75.9 and this sits between them. Contrast against the middle of the assumed dark range goes 8.54 -> 9.07, still under the accent's 9.26, because a datum may not outrank the person's own hue. The collision was found by reading a comment, which is the part worth fixing. styles.go asks for a 256-neighbour check on every line it authors and every one of those checks was done — one line at a time. Nobody ever asked the whole table at once. TestNoTwoRolesShareA256Index does, on both ladders, so the next one fails instead of shipping. Co-Authored-By: Claude Fable 5 <[email protected]>
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.
What this wave does
Three lanes plus a seam-closing merge, all aimed at one defect: the reply — the thing a person reads most — was the loudest object on the screen.
b4dea05f): the assistant markdown body wore tui2'sTextPrimary#E6E6F0(~14:1 on a dark ground) while tui3's own palette authored#D8DEE9— two whites on one screen, and halation making strokes read heavier than they are. Now the transcript body goes throughtokens.Styler.WithBodyInkand wears tui3's ink, retuned to#C6CDDA(~10.7:1). THE GLARE LAW is pinned by test so the ceiling holds.c6281a3f): the streaming tail arrives one lightness step above the body (hueLive) — the one live thing — and the ink dries to calm when the turn settles. Absent below 256 colours, honestly.310e1aa8): the palette stops assuming the terminal's background and measures it (bubbletea v2 background query, async, never blocking). Ground ladder derived at the stated ratios, reading tiers clamped into bands, signal isoluminance preserved, exact light/dark flip. Silence keeps the authored palette byte-for-byte.21c09d09): the markdown styler follows the adapted palette; the live tier is derived with the ink (a 1.15–1.30× band over it); the glare law nameshueLiveas its one bounded exception; a node's room drops its cached rows on a background reply like the conversation does.7678e5d7:hueMutedandhueDataboth rounded to 256-index 110 — the datum wore the second voice's colour on every 256-colour terminal.hueDatamoved to#91C5D4(index 116), andTestNoTwoRolesShareA256Indexnow gates what was only ever a habit.A fourth lane (DEC 2026 synchronized output) landed no code: bubbletea v2 already brackets every frame, verified at source and empirically.
Verification
go build ./...clean;go vetclean;go test ./internal/tui3/ok (262.8s, full suite); all 20internal/tui2packages ok;internal/manualok;make buildok. Manual pages updated under the manual law (adaptive colors section in screen.md; the stale "OSC 11 is deliberately not queried" denial removed).🤖 Generated with Claude Code