Skip to content

docs: keep code frames in the content column and dev-server styling current - #4076

Merged
max-sixty merged 2 commits into
mainfrom
margin
Sep 12, 2026
Merged

max-sixty merged 2 commits into
mainfrom
margin

Conversation

@max-sixty

Copy link
Copy Markdown
Owner

Code frames leave the content column on wide screens

#4000 stretched every terminal frame to the full content panel at 72rem and up, to give wt list --full room. Once the panel is wider than the 62rem column, Starlight offsets the column inside it, so shell snippets moved left of the prose they belong to and spanned past it on the right, while TOML frames stayed in the column. On https://worktrunk.dev/tips-patterns/ at 2560px, prose starts at x=760 and shell frames at x=248, 1504px wide.

#4039 had already made terminal output fit the column. With the stretch disabled, no output-bearing frame on any of the 15 pages overflows; three long one-line commands on /config/, /list/ and /step/ scroll, as long TOML lines already do. So the rule is removed rather than narrowed.

The desktop browser test ran only at 1152px and 1376px, where the panel and the column are the same width and the rule changed nothing. It now also runs at 1920px and asserts every code frame stays within the column; with the old rule restored, it fails on the homepage.

The dev server loses code styling after a merge

Astro caches rendered Markdown with the Expressive Code stylesheet URL baked in. That URL's hash comes from the code-rendering config and plugins, which Astro's content-cache key doesn't cover. A merge that changes astro.config.mjs and the terminal plugin under a running dev server makes Astro restart it in place: the server serves the new stylesheet while content keeps rendering with the old renderer, so every page links a stylesheet that returns 404. Restarting the process doesn't recover, because the cache survives it.

  • docs/package.json: dev passes --force, as build already does, so a restart re-renders.
  • .config/wt.toml: the docs hook sets ASTRO_DEV_BACKGROUND=1. When astro dev detects an AI agent, it respawns itself detached, which drops --force and escapes wt step tether; three worktrees currently run their dev servers that way.
  • docs/CLAUDE.md: explains the cache and says to restart with wt hook post-start docs after astro.config.mjs changes, since the in-place restart is Astro's to fix.

This was written by Claude Code on behalf of max-sixty

🤖 Generated with Claude Code

https://claude.ai/code/session_016NGjseUKXkyL8qHLhaXsnt

max-sixty and others added 2 commits September 12, 2026 13:13
#4000 stretched every terminal frame to the full content panel on
viewports of 72rem and up, to give `wt list --full` room. Once the panel
is wider than the 62rem column, Starlight offsets the column inside it,
so shell snippets moved left of the prose they belong to and spanned
past it on the right, while TOML frames stayed in the column. At 2560px
on /tips-patterns/, prose starts at x=760 and shell frames at x=248,
1504px wide.

#4039 had already made terminal output fit the column: `wt list`
examples render at 98 columns and the column widened to 62rem. With the
stretch disabled, no output-bearing frame on any page overflows; three
long one-line commands scroll, as long TOML lines already do. So the rule
goes rather than being narrowed.

The desktop browser test only ran at widths where the panel and column
are the same size, where the rule changed nothing. It now also runs at
1920px and asserts every code frame stays within the column; with the
old rule restored it fails on the homepage.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_016NGjseUKXkyL8qHLhaXsnt
Pages on a worktree's dev server lost all code-block styling after a
merge from main. Astro caches rendered Markdown with the Expressive Code
stylesheet URL baked in. That URL's hash comes from the code-rendering
config and plugins, which Astro's content-cache key does not cover. The
merge changed `astro.config.mjs` and the terminal plugin, Astro restarted
the server in place, and the restarted server served a new stylesheet
hash while content kept rendering with the old renderer. Every page then
linked `ec.fq08u.css`, which returned 404.

Restarting the process did not recover either, because the cached pages
survive a plain `astro dev`. The dev script now passes `--force`, as the
build already does, so a restart re-renders from the current renderer.
docs/CLAUDE.md says to restart with `wt hook post-start docs` after
`astro.config.mjs` changes, since the in-place restart can't be fixed
from this repo.

The hook also sets `ASTRO_DEV_BACKGROUND=1`. When `astro dev` detects an
AI agent (`CLAUDECODE`, `CODEX_THREAD_ID`), it respawns itself detached
and drops `--force`. The respawned server is reparented to launchd,
outside tether's process tree, so worktree removal can't stop it; three
worktrees currently run their dev servers this way.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_016NGjseUKXkyL8qHLhaXsnt
@max-sixty
max-sixty merged commit 4f26e9a into main Sep 12, 2026
40 checks passed
@max-sixty
max-sixty deleted the margin branch September 12, 2026 21:14
@max-sixty max-sixty mentioned this pull request Sep 16, 2026
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.

2 participants