Repository navigation
Description
Problem
apps/desktop/src/renderer/styles/chat-message.css reaches into the internal DOM of Astryx ChatToolCalls through positional selectors:
| Line | Selector |
|---|---|
| 127 | .maka-tool-activity-card > [role="button"] + div > div |
| 134 | .astryx-chat-tool-calls [role="button"] > span:nth-child(2) |
| 170 | .astryx-chat-tool-calls [role="button"] > span:last-child |
| 178–179 | … > span:last-child svg, … > span:last-child > * |
(.maka-tool-activity-card is a className passed to ChatToolCalls — see packages/ui/src/tool-activity.tsx:232.)
These encode child order and nesting depth that @astryxdesign/core never promised. This has already broken once: the comment at chat-message.css:154-159 records an earlier > span:not(:last-child) rule that silently stopped matching the reasoning text once the label, duration and preview were wrapped in a <div> — the exact row the rule existed for. The failure mode is a silent visual regression, not a build error.
The 0.4.0 upgrade (#2983) happened to miss these selectors, but that was luck: that release removed 15 wrapper elements elsewhere in the library.
Why this can't just be "use the stable class names"
Verified against @astryxdesign/[email protected]:
themeProps('chat-tool-calls')is applied only to the component root (dist/Chat/ChatToolCalls.js:297,310)- the only
data-slotischat-tool-call-rowon the row root (:125) - the label span and chevron span carry no theme target and no slot
So there is currently no supported way to address them. Any fix has to change what upstream exposes, or change who owns the DOM.
Note that the sibling .astryx-chat-reasoning rules are not affected: packages/ui/src/astryx-chat-reasoning.tsx is an ejected local component, so that DOM is ours.
Options
- Ask upstream for slots — request
data-sloton the tool-call label and chevron. Fixes the root cause; depends on upstream's release cadence. - Eject
ChatToolCallslocally, as we already did forChatReasoning. Full control, at the cost of another vendored component to keep in sync. - Pin the structure with a regression assertion — a Storybook/Playwright check that the label and chevron are still where the CSS expects them. Doesn't fix anything, but converts a silent visual regression into a red CI run.
Suggested sequencing: do (3) now because it is cheap and stops the bleeding, open (1) in parallel as the real fix, and fall back to (2) only if (1) is declined or goes unanswered.
Scope
Desktop renderer styling only. No change to chat behavior or to the Runtime Host boundary.
Drafted with Claude Code; the upstream API claims above were verified against the installed @astryxdesign/[email protected] sources.
Activity
Astro-Han commentedon Aug 14, 2026
Closing — the premise was wrong.
Re-reading
CallRowin@astryxdesign/[email protected](dist/Chat/ChatToolCalls.js:122-223):roleis only set whenhasDetailis true (:123), and the chevron span is only rendered whenhasDetailis true (:212). So[role="button"] > span:last-childis guarded by its own attribute selector — the last span is always the chevron, neverdurationorstats. Likewise the first child is always the status icon, so> span:nth-child(2)is always the tool name.These selectors are correct, not incidental. That makes this unlike the
> span:not(:last-child)bug recorded atchat-message.css:154-159, which genuinely assumed a flat structure that never held.What's actually left is that the reasoning above isn't written down anywhere. That's a comment in
chat-message.css, not a tracked issue.