Skip to content

feat: add code-block, text to copy with a title bar and a copy button - #111

Merged
zyx1121 merged 1 commit into
mainfrom
feat/code-block
Nov 13, 2026
Merged

zyx1121 merged 1 commit into
mainfrom
feat/code-block

Conversation

@zyx1121

@zyx1121 zyx1121 commented Nov 13, 2026

Copy link
Copy Markdown
Member

What

A new registry:ui item, code-block: text a member copies and runs or pastes, such as a command, a request or a config file.

  • A 2.5rem bar with an optional title and a copy button; the icon turns into a check for 1.5 seconds after copying.
  • The text keeps its own line breaks and scrolls sideways, so a long line never breaks inside a word.
  • Same edge and corners as terminal and browser, but in the page's colors in both themes.
  • DESIGN.md says when to use it; README and the docs site list it.

Why

The portal's developer page shows its OAuth endpoints as lines of font-mono prose that wrap in the middle of words. terminal draws another program's window, and markdown's code has no copy button, so neither fits.

Verified

On the sandbox, against the static build, with Playwright: light and dark at 900 wide and dark at 390 wide. In each, 6 lines stay 6 rows, the page does not scroll sideways (the block does, on the phone), the clipboard holds the exact text, the button's name goes 複製, 已複製, 複製, and it works from the keyboard. 22 of 22 checks pass.

lint, prettier --check, tokens:check, theme:check, tsc and build pass.

🤖 Generated with Claude Code

For a command, a request or a config file a member copies and runs. The
text keeps its line breaks and scrolls sideways. Same edge and corners as
terminal and browser, in the page's colors.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
@zyx1121
zyx1121 merged commit e1aaf13 into main Nov 13, 2026
4 checks passed
@zyx1121
zyx1121 deleted the feat/code-block branch November 13, 2026 08:34
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.

1 participant