Skip to content

fix(chat): keep code block actions from covering unlabeled code - #49582

Merged
orca-remote-automation[bot] merged 1 commit into
mainfrom
fix/chat-codeblock-icon-gutter
Nov 26, 2026
Merged

orca-remote-automation[bot] merged 1 commit into
mainfrom
fix/chat-codeblock-icon-gutter

Conversation

@orca-remote-automation

@orca-remote-automation orca-remote-automation Bot commented Nov 26, 2026 •

Copy link
Copy Markdown
Contributor

ELI5

In chat, a code block with no language label shows its "wrap lines" and "copy" buttons over its top-right corner. Long lines ran underneath those buttons, so you couldn't read the end of the line. Now that corner is kept clear, and the code still scrolls sideways.

What Changed

  • Before: the unlabeled code block had pr-16, but in a horizontally scrolling <pre> overflowing text scrolls through the padding, so it still sat under the buttons.
  • After: the <pre> reserves a right margin (mr-17, 68px) plus a small right padding (pr-1.5). Its scroll area now stops before the buttons, so text never goes under them, whether it scrolls or wraps. The buttons stay in the corner, 24px each, and their inset changes from 8px to 6px (right-1.5 top-1.5).
  • Labeled and HTML code blocks show their buttons in a header row, so this change leaves them alone.
  • Adds component fixtures for the unlabeled variant: wide, narrow (320px), and wrapped.

Why

The approved design keeps the buttons in the corner and reserves space for them, so short blocks don't gain a header row. A margin is used instead of padding because only a margin moves where the scroll area clips. Checked against how comparable products handle this.

Linked Issue

N/A (maintainer UX fix)

Visual Proof

Component fixtures. The buttons are revealed with focus, since the shots can't hover.

Before After
560px, dark before after
320px, light before after
320px, wrapped, dark after

Testing

  • I manually tested these changes locally (pnpm fixtures:shot 'native-chat/markdown/code/NativeChatCodeBlock:*' --theme both: every variant, both themes, wide, narrow, long unbroken path, wrap on and off)
  • Automated tests added/updated, or explained why not below: this is a styling change, and per repo rules there are no UI tests
  • Every added test fails without this change and avoids the test anti-patterns (none added)

pnpm check:changed passes.

Performance

None, because this only changes static CSS classes on one element.

Risk

The only visible tradeoff is in unlabeled code blocks: the horizontal scrollbar now ends 68px before the right edge, and wrapped lines are 68px narrower. Labeled and HTML blocks are unaffected. Back it out with a plain revert.

Level: Low

AI Disclosure

Review

Agent skill upstream boundary

  • Not applicable, or this change copies or mechanically translates no upstream skill-installer source, tests, fixtures, registry entries, path tables, comments, or documentation.

Notes

Renderer CSS only. Mobile already shows these buttons in a header row. The fix is the same on every platform and on remote hosts.

Checklist

  • This PR is small and focused
  • I explained what changed and why (ELI5, the user-facing before/after, the mechanism, and why over the alternatives)
  • I stated the risk: what could break, for whom, and how to back it out
  • Before/after screenshots or videos attached for UI changes, or N/A with reason
  • Self-reviewed for correctness, security, and performance
  • Cross-platform, SSH/remote, and path/shortcut impact considered (or N/A)
  • pnpm lint, pnpm typecheck, pnpm test, and pnpm build pass (or CI will cover; local preferred)

@orca-remote-automation
orca-remote-automation Bot merged commit 60eb66f into main Nov 26, 2026
54 of 55 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants