fix(ui): restore the send-message button icon (#4478) - #4480
Conversation
App.css declared `.send-btn` twice at equal specificity. The later block
re-declared `padding: 0.75rem 1.5rem` and won the cascade, while
`width: 40px` still came from the earlier one. Under the global
`box-sizing: border-box`, 48px of horizontal padding inside a 40px box
leaves zero content width, so the flex child — `<UiIcon name="send"
size={16} />` — was squeezed to 0px wide and the button rendered as a
solid rectangle.
Verified in Chrome against the real stylesheet: before, the send icon
lays out at 0x16 while the `.send-btn.channel-action-btn` siblings are a
healthy 16x16 — those escaped only because their `padding: 0.5rem
!important` outranked the duplicate. After, the button is 40x40 with a
16x16 icon.
The duplicate also shadowed the `@media (max-width: 768px)` override for
`.send-btn`, which is declared between the two blocks, so mobile was
broken the same way (and is fixed here too).
Collapse the two blocks into one, keeping the values the cascade actually
produced so the button looks unchanged; only the padding conflict is
resolved. Pin `.send-btn > svg { flex-shrink: 0 }` so a future padding or
width regression cannot collapse the icon again.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01L9NzRtqE8eSMS8tvAeodUB
|
Claude finished @Yeraze's task —— View job PR Review: fix(ui): restore the send-message button icon (#4478)Tasks:
Overall AssessmentThis is an excellent, well-reasoned bug fix. The root cause analysis is thorough, the fix is minimal and correct, and the test suite is unusually thoughtful for a CSS regression. A few notes below, none of which are blockers.
|
Fixes #4478
Root cause
Not the icon mapping —
UiIcon'ssend→ lucideSendentry is correct, as the issue suspected.src/App.cssdeclared.send-btntwice at equal specificity. The later block (old L1986) re-declaredpadding: 0.75rem 1.5remand won the cascade, whilewidth: 40pxstill came from the earlier block (old L1274). Under the globalbox-sizing: border-box(src/index.css), 48px of horizontal padding inside a 40px box leaves zero content width, so the flex child —<UiIcon name="send" size={16} />— was squeezed to 0px wide.The
.send-btn.channel-action-btnsiblings (bell, position) escaped only because theirpadding: 0.5rem !importantoutranked the duplicate — which is exactly why the report singles out the send button.Verified in a browser, not just by reading
Worth doing: flex
min-width: autoon a replaced SVG could plausibly have resisted the squeeze, which would have made the above analysis wrong. It doesn't. Measured against the real stylesheet in Chrome:Two corrections to the issue report
--ctp-accent-textis#000000on--ctp-blue— fine contrast. The icon wasn't the wrong color; it had no width.)@media (max-width: 768px).send-btnoverride, silently shadowing it — the same cascade-ordering trap as Map features menu blocks sidebar connect button on mobile #3532. Confirmed broken before (icon 0 × 16 at 400px wide) and fixed after (44px button, 16 × 16 icon).The fix
Collapse the two blocks into one, keeping the values the cascade actually produced (blue background,
--radius-lg,1rem) so the button's appearance is unchanged — the only computed-style change is horizontal padding,1.5rem→0.5rem. Pin.send-btn > svg { flex-shrink: 0 }so a future padding/width regression can't collapse the icon again.Test plan
src/styles/sendButtonIcon.test.ts— jsdom implements neither cross-stylesheet cascade nor layout, so this asserts on stylesheet source: one unconditional.send-btnrule, and a box model that leaves room for the 16px icon.App.cssand pass after. (My first draft passed on broken code because it read only the first rule — rewritten to resolve declarations the way the cascade does, last-wins.)success: true, 3947 files, 12875 passed, 0 failed.npx tsc --noEmit— clean.npm run lint:ci— no FAIL lines.Follow-up (not fixed here)
Four other top-level selectors are still declared twice in
App.css—.dm-selector(699, 1878),.node-select(703, 1883),.device-info(814, 1060),.message-input-container(1245, 1908). Same fragility class; out of scope for this fix. Also noting the.send-btn:hoverbox-shadow is a green-tinted glow (rgba(166, 227, 161, 0.4)) on a now-blue button — preserved as-is since it's pre-existing rendered behavior, but it looks like a leftover.Generated by Claude Code