refactor(ui): drop the dead [data-trow] chat rules - #2231
Merged
Conversation
Astro-Han
force-pushed
the
refactor/chat-css-drop-dead-trow-rules
branch
2 times, most recently
from
August 5, 2026 11:28
d98ea82 to
0cf4247
Compare
`data-trow` stopped being rendered in 6745aa1 ("render every tool row through Astryx"), which retired the bespoke trow renderer and moved permission / sandbox / interrupted rows onto ChatToolCalls. The four rules keyed on the attribute in chat-message.css outlived it: the hover arm and the trigger's type, box and chevron sizing. Nothing sets the attribute in source, and the built renderer bundle contains no `data-trow`, so none of them can match. The block's comment split three ways rather than going wholesale. Its opening line is dead with the rules. Its cascade note is live and is about the surviving icon boxes above — product CSS in `components` outranks Astryx's StyleX atoms on layer order, so this file needs no !important — so it moves onto them, minus a count of flags that no longer resolves to anything a reader can check. Its --maka-line-body note is dropped: the token's only use here is the supporting-leading rebind one rule earlier, which its own comment already explains, and the rules the note sat above declare nothing but width and height. check-dead-css's DYNAMIC_STYLE_HOOKS kept `astryx-collapsible-trigger` for chat-message.css; its live consumer is now settings/permission.css.
Astro-Han
force-pushed
the
refactor/chat-css-drop-dead-trow-rules
branch
from
August 5, 2026 11:31
0cf4247 to
fc42f42
Compare
Astro-Han
marked this pull request as ready for review
August 5, 2026 11:40
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.
Summary
chat-message.cssstill carried four rules keyed on[data-trow]: the hover arm inside@media (hover: hover), and the.astryx-collapsible-triggertype/box rule plus its two chevron-sizing rules. Nothing renders that attribute any more.The attribute went away in 6745aa1 ("render every tool row through Astryx"), which retired the bespoke trow renderer —
data-trow="group"/data-trow="row"were emitted bypackages/ui/src/tool-activity.tsxand are deleted in that diff — and moved permission / sandbox / interrupted rows onto AstryxChatToolCalls. Confirmations: nodata-trowanywhere inpackages/*/srcorapps/desktop/srcoutside this stylesheet, andgrep -o data-trow apps/desktop/dist-renderer/assets/*.jsis empty, so the shipped bundle has no element these selectors could match.The block's long comment split three ways rather than going wholesale:
componentslayer beats Astryx's StyleX atoms on layer order alone, which is why this file declares no!important. That is a fact about the surviving reasoning/tool-call icon boxes, so it moves onto them — minus its count of "all eight" flags, since some of those lived on the rules deleted here and the number no longer resolves to anything a reader can check. The mechanism it was evidence for still holds.--maka-line-bodynote. That token's only use in this file is the supporting-leading rebind one rule earlier, which its own comment already explains; the rules the note sat above declare nothing butwidthandheight, so it had no force where it stood.--maka-line-body,--radius-elementand--maka-text-labelall keep live consumers elsewhere in the file, so nothing became a dead token.One follow-on:
check-dead-css.mjskeepsastryx-collapsible-triggerinDYNAMIC_STYLE_HOOKSwith a comment pointing at chat-message.css. After this change its only consumer isstyles/settings/permission.css, so the comment is retargeted; the allowlist entry itself is still needed.Why
check:staledid not flag this — and what actually should havecheck:staleisscripts/check-stale-dist.mjs. It comparessrcmtimes againstdistmtimes per workspace to force a rebuild before tests. It never reads CSS and has no opinion about selectors, so it was never going to catch this — no gap there.The tool that is meant to catch dead CSS is
scripts/check-dead-css.mjs(wired intocheck:release, notcheck:stale). It also misses these rules, and that is the real find. Its class scan matches/\.(-?[_a-zA-Z][_a-zA-Z0-9-]*)/— class selectors only — and its token scan looks at--custom-properties. An attribute selector such as[data-trow]is in neither vocabulary, so a rule can be keyed entirely on adata-*hook that no component renders and the script still reports "no dead classes or tokens found ✓", exactly as it does before and after this PR.The two classes in these selectors did not help either:
maka-turnandastryx-collapsible-triggerare both live elsewhere (astryx-collapsible-triggeris in theDYNAMIC_STYLE_HOOKSallowlist precisely because it is rendered at runtime), so even a per-rule liveness check that reasoned over class names alone would have called this rule live. Detecting it requires scanning thedata-*attribute hooks a stylesheet keys on and checking each against source — a real extension to the script rather than a config tweak, and one that needs its own baseline because the renderer keys plenty of live rules ondata-*([data-sender],[data-maka-contract]in this file alone).Not doing that extension here: it would land a new detector plus its own baseline alongside an unrelated cleanup. Flagging it so the gap is on the record.
Verification
Rebased onto
mainafter #2228 landed; the two changes touch adjacent but disjoint rules in this stylesheet and merged without conflict.npm run format/npm run format:check/npm run lint— clean (Biome, no fixes applied).node scripts/check-dead-css.mjs—no dead classes or tokens found ✓(unchanged, and per above, unchanged for the wrong reason).node --test scripts/check-dead-css.test.mjs— 13/13 pass.apps/desktop/src/main/__tests__/:node --test "dist/main/**/*contract*.test.js" "dist/main/**/css-test-helpers.test.js"— 145/145 pass, 35 suites. This covers every test that parses this stylesheet throughcss-test-helpers/contract-css-helpers, includingchat-reasoning-wrap-contractand fix(ui): draw the reasoning chevron from the Astryx icon registry #2228'schat-disclosure-chevron-contract(the latter asserts the reasoning and tool-call rows declare a 10x10 chevron svg and wrapper, which the deleted trow rules never contributed to).tsc -p tsconfig.main.jsonreports pre-existing errors inruntime-host/ oauth / voice tests. They reproduce identically on a cleanmaincheckout and are unrelated to this change.