Repository navigation
refactor(ui): inline stroke attributes via shared strokeIcon shell - #113952
Conversation
|
Codex review: needs maintainer review before merge. Reviewed July 25, 2026, 9:54 PM ET / July 26, 2026, 01:54 UTC. ClawSweeper reviewWhat this changesThis PR wraps the Control UI’s standard 24×24 line-icon bodies in a shared SVG shell that supplies Lucide-compatible inline stroke presentation attributes. Merge readinessKeep this PR open for the protected maintainer review: it is a coherent, source-centralized fix for the shadow-root invisible-icon class, with direct visual proof and no concrete patch defect found. The remaining decision is whether to adopt the shared presentation-default contract across the full Control UI icon catalog. Priority: P3 Review scores
Verification
How this fits togetherControl UI components consume reusable Lit SVG templates from the shared icon catalog. Those templates flow into both ordinary light-DOM pages and Lit shadow-root components, where inline SVG presentation defaults avoid reliance on global CSS that cannot cross the shadow boundary. flowchart LR
A[Control UI component] --> B[Shared icon catalog]
B --> C[Shared SVG stroke shell]
C --> D[Inline Lucide presentation defaults]
D --> E[Light-DOM UI]
D --> F[Lit shadow-root component]
E --> G[Visible line icons]
F --> G
Decision needed
Why: This is an intentional catalog-wide rendering-contract change rather than a narrow local bug fix; source and screenshots support it, but maintainers must choose the long-term default for existing custom styling. Before merge
Agent review detailsSecurityNone. PR surfaceSource -360. Total -360 across 2 files. View PR surface stats
Review metricsNone. Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Adopt one shared inline Lucide-style shell after a maintainer verifies representative light-DOM overrides and the shadow-DOM lightbox on the refreshed head, while retaining deliberately non-line artwork outside that shell. Do we have a high-confidence way to reproduce the issue? Yes, the failure class is source-reproducible: open SVG paths without inline stroke defaults depend on global CSS, which does not enter Lit shadow roots. The supplied screenshots also show the intended after-fix result, though this review did not independently run the UI. Is this the best way to solve the issue? Yes, conditionally: a single shared shell is more maintainable than repeating component-local shadow-root CSS, provided maintainers accept inline presentation defaults as the catalog contract and verify existing CSS overrides on a refreshed merge result. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 2bffce62daac. LabelsLabel justifications:
EvidenceWhat I checked:
Likely related people:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (1 earlier review cycle)
|
|
Merged via squash.
|
What Problem This Solves
Shared Lucide icon templates in
ui/src/components/icons.ts/icons-tools.tscarried no SVG stroke presentation attributes — they relied entirely on global stylesheet rules (fill: none; stroke: currentColor; ...). Any icon rendered inside a shadow-DOM Lit component silently painted nothing, because global CSS cannot pierce shadow roots. That bug class already bit twice: the image lightbox close button (#113913) andfile-preview-modal.ts, each patched with component-local CSS.Why This Change Was Made
Real Lucide SVGs ship
fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"inline; the repo's copies had stripped them. This PR restores those defaults once, via a sharedstrokeIcon()shell inicons-tools.tsthat wraps every 24x24 icon body. Icon bodies use Lit'ssvgtemplate tag (anhtmlfragment would parse the shapes outside the SVG namespace and render nothing — verified live during development). CSS rules override presentation attributes, so every existing surface that sets its own stroke width (e.g. 1.5/1.8px contexts) keeps winning exactly as before.The multicolor lobster art icon (120x120 viewBox, gradient fills) intentionally stays outside the shell.
User Impact
No visual change on light-DOM surfaces (verified by before/after screenshots). Icons are now self-contained: any future shadow-DOM component gets visible icons without needing to know about global stylesheet coupling — the invisible-icon bug class is gone. Net −360 LOC.
Shadow-DOM lightbox still correct:
Evidence
pnpm dev:ui:mock+ Playwright; icon rendering verified identical (only dynamic mock content differs), and DOM inspection confirmed paths render as proper SVG-namespace siblings with the new attributes.node scripts/run-vitest.mjs ui/src/pages/chat/chat-composer.test.ts ui/src/components/image-lightbox.test.ts— 35/35 pass.oxlint+oxfmtclean on both files.check-changedclassification; typecheck/lint fan-out is proven by hosted PR CI instead.