Repository navigation
Conversation
Shell blocks were Expressive Code terminal frames whose title bar the
terminal plugin then deleted. Expressive Code still offsets the copy button
by that title bar's height, so on every shell block the button sat 40px
below the top of the code: on the second line of multi-line blocks, and
hanging below one-line blocks such as `wt merge --no-ff` on /merge/.
`defaultProps: { frame: 'code' }` stops requesting terminal frames, so
there is no title bar to remove and the button sits on the first line. The
header-removal hook goes, and so does the `wt-commands-only` class: mobile
wrapping now keys on whether a block contains captured output. Expressive
Code strips comment lines from what terminal frames copy, so the eight
`bash` and `powershell` blocks with comments on /shell-integration/ now copy
them, as console blocks already did.
Blocks with several commands had a whole-block copy button and per-line
buttons in the same corner, handed over on hover by opacity. A hidden
button still takes clicks, so clicking one line's button copied the whole
block, and on touch screens one button covered another. Most of those
blocks are lists of alternatives, so they now get only the per-line
buttons, and the hover hand-off rule is deleted. Those blocks wrap, since a
per-line button sits at the end of its line and scrolled out of view on the
/list/ jq examples. A per-line button is no taller than its line, so
buttons on adjacent lines no longer overlap.
A browser test checks, on every page at 393px with touch and at 1376px,
that each copy button sits on the line it copies, inside the visible code,
without overlapping another. Against worktrunk.dev, and against a build
without the wrap and the height cap, it fails.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013U96NY8qKtZhavBSwnfCYq
worktrunk-bot
left a comment
There was a problem hiding this comment.
Two console blocks aren't menus of alternatives, and they lose a copy that was runnable as-is: the Equivalent to: recipe under How it works in wt step diff ($ cp "$(git rev-parse --git-dir)/index" /tmp/idx and the two GIT_INDEX_FILE=/tmp/idx lines that follow), and the stash recipe in the FAQ ($ git stash push -u / $ wt switch --create feature / $ git stash pop). Both only do anything run in order, so a reader now has to copy each line on its own. They're the only two of the site's 25 multi-command console blocks in that shape — the FAQ's plain-git comparison carries a # ...work, commit, push... placeholder mid-block, so its block copy was never runnable either — so the trade is right everywhere else and the open decision is just these two. docs/CLAUDE.md already names the form that would keep a block button for them: "Use bash for commands a reader can copy as a complete recipe." The FAQ one is a docs-only edit, but the step recipe lives in after_long_help in src/cli/step.rs, so dropping its $ prefixes also changes what wt step diff --help prints — worth deciding rather than assuming. I can push that commit if you want it.
Smaller, and latent rather than broken today: codeBlock.props.wrap = true keys on the command count alone, so a console block with several commands and captured output would get its output reflowed — the one thing custom.css deliberately protects, since :not(:has(.wt-output)) leaves output blocks scrolling instead of wrapping. No block on the site is that shape, so nothing renders wrong today; it's a constraint on future blocks that nothing currently records.
The FAQ's stash recipe and the `Equivalent to:` block under `wt step diff` only work run in order, so they are `bash` fences, the form docs/CLAUDE.md prescribes for a copyable recipe, and keep one copy button. Terminal help renders both fence kinds alike, so `wt step diff --help` is unchanged. A console block with several commands wraps only when it carries no captured output, so output keeps its columns. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_013U96NY8qKtZhavBSwnfCYq
On every shell code block the copy button sat 40px below the top of the code: on the second line of multi-line blocks, and hanging below one-line blocks such as
wt merge --no-ffon /merge/. Shell blocks were Expressive Code terminal frames, and the terminal plugin deleted their title bar, but Expressive Code still offsets the copy button by that bar's height.Changes
docs/astro.config.mjssetsdefaultProps: { frame: 'code' }, so no block is a terminal frame and there is no title bar to remove. The plugin's header-removal hook and itsprops.frame = 'terminal'go, and so does thewt-commands-onlyclass: mobile wrapping incustom.cssnow keys on whether a block contains captured output (:has(.wt-output)).wrapprop) unless they carry captured output, since a per-line button sits at the end of its line and scrolled out of view on the longjqexamples on /list/. A per-line button is no taller than its line, so buttons on adjacent lines no longer overlap.Equivalent to:block underwt step diff's How it works (insrc/cli/step.rs), are nowbashfences, the formdocs/CLAUDE.mdprescribes for a copyable recipe, so they keep one copy button for the whole recipe. Terminal--helprendersconsoleandbashfences alike (it strips$), and the help snapshots are unchanged.Side effect
Expressive Code strips comment lines only from what terminal frames copy. The eight
bashandpowershellblocks with comments on /shell-integration/ now copy them, as console blocks already did. Pasted into zsh withoutinteractivecomments, each comment line printscommand not found: #; the commands still run.Tests
A browser test checks every copy button on every page, at 393px with touch and at 1376px, for three things: it sits on the line it copies, it is inside the visible code, and it doesn't overlap another button. These checks fail against worktrunk.dev and against a build without the wrap and the height cap. The built-site and plugin tests now expect per-line payloads and no block payload on multi-command blocks, and a plugin test pins that blocks carrying output never wrap.
🤖 Generated with Claude Code
https://claude.ai/code/session_013U96NY8qKtZhavBSwnfCYq