Skip to content

Spruce up the website playground - #1840

Open
nedtwigg wants to merge 11 commits into
mainfrom
playground
Open

nedtwigg wants to merge 11 commits into
mainfrom
playground

Conversation

@nedtwigg

Copy link
Copy Markdown
Member

Sprucing up the website playground.

Desktop playground

  • Starfield. The Pocket tutorial's twinkling starfield now runs behind the desktop tutorial on every screen except FlappyTerm and the copy section. Text is laid out over it with soft wraps, and stars skip the cells text occupies.
  • Music video. YOUTUBE_MUSIC_VIDEO in website/src/lib/youtube.ts is the one place the video is named. It replaces the changelog pane as an iframe browser pane; ascii-splash is split vertically with the changelog beside it. YouTube's auto captions are unloaded each time the video starts playing (the video has its own captions), since cc_load_policy=0 alone does not stick.
  • dor open fix. Viewers announced at a numeric loopback address (127.0.0.1) are framed again, instead of "Can't frame this URL".
  • Ports and browsers section (after dor open):
    • Opening a pane's properties from right-click or ? credits the first item, now reported by a new contextOpen Wall event.
    • Running npm run dev in two terminals credits the second. The playground's pretend Vite takes the first free port from 5173, so the two report different ports in their properties.
    • The prose explains what the iframe, agent-browser, and Playwright panes can and cannot do, without demonstrating them.
    • Opening a running dev server's port in the system browser or as an iframe shows the music video instead of a dead localhost URL.

Pocket playground

  • The music video is a Session of its own, between the tutorial and the changelog.

Specs

docs/specs/tutorial.md covers the four-pane layout, the Ports credit rule, the contextOpen hook, the iframe-proxy rule for the video, and the Pocket video Session; its word budget is ratcheted.

Testing

  • website: pnpm test (type check + 502 tests) passes; new tests cover the starfield layout, caption hiding, the dev server program, the ports detector, and iframe/system-browser routing.
  • lib: Wall.test.tsx asserts contextOpen for ?, right-click, and !.
  • Clicked through by hand on the desktop playground. Caption hiding has not been checked on a real phone.

🤖 Generated with Claude Code

nedtwigg and others added 8 commits November 17, 2026 12:57
The starfield now draws behind every desktop tutorial screen but
FlappyTerm and Copy paste, whose text the user selects. Mouse capture
and wheel panning stay on Pocket's Gesture navigation screen alone.
Stars keep off each row's text, soft wraps included.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Tool serving frames a listener at its numeric loopback address since
327196a, so the playground refused its own viewers at 127.0.0.1.
Accept any loopback hostname under /playground-fs/, and test the URL
Tool serving actually builds from the port the playground's dor reports.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
YOUTUBE_MUSIC_VIDEO in website/src/lib/youtube.ts names the video the
site shows. The desktop playground's top-right pane is now an iframe
browser pane on its privacy-enhanced embed, which the playground's
iframe proxy passes through, and ascii-splash and changelog share the
bottom-right side by side.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The video burns in its own captions. YouTube ignores cc_load_policy=0
and reloads its captions each time playback starts, so the desktop
playground subscribes to each embed over the embed API and unloads the
captions module whenever a player starts playing.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
pocket-video is a browser Session between the tutorial and the
changelog: the YouTube embed, 16:9 so a portrait screen letterboxes it,
with YouTube's captions kept off and the video paused whenever the
Session is hidden.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The section has the user open a pane's properties (right-click its
header, or ? in command mode), run npm run dev in two panes, and find
each server's port in their properties. Its prose explains what the
iframe renderer and the agent-browser and playwright renderers can and
cannot do; the music video pane is the browser pane to try.

- npm run dev is a pretend Vite: each takes the first free port from
  5173 and reports it as the pane's open port, freeing it on Ctrl-C.
- Wall fires a contextOpen event, with its mode, on every terminal
  context opening, which the detector credits from.
- The playground's iframe proxy explains that a dev server's port has
  no page, rather than naming only its viewers.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The desktop playground's npm run dev serves nothing, so a system browser
opening its port showed a connection error. The playground's
openExternal now sends a running pretend dev server's loopback URL to
the music video, and passes every other link through.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The iframe embed action on a running npm run dev port tried to frame a
port that serves nothing. The playground's iframe proxy now frames the
music video's embed for it, as the system browser action opens the
video.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Nov 18, 2026 •

Copy link
Copy Markdown

Deploying mouseterm with  Cloudflare Pages  Cloudflare Pages

Latest commit: 758592c
Status: ✅  Deploy successful!
Preview URL: https://325ca84e.mouseterm.pages.dev
Branch Preview URL: https://playground.mouseterm.pages.dev

View logs

@dormouse-bot dormouse-bot left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The desktop tutorial now renders every screen except FlappyTerm and Copy paste through renderOverStarfield, and that path stops laying out text at the pane's last row (if (row >= rows) break;). The old desktop path wrote lines with \r\n, so in a short pane the overflow went to scrollback and the user could still read it. Now it is dropped with no way to reach it. The new Ports and browsers section makes this likely. Its three prose paragraphs plus the active hint come to roughly 27 rows at 70 columns, and its second step asks the user to split off two new panes. Splitting the tutorial pane brings it under 20 rows, so the prose and the "Section complete" line disappear. The menu's lower rows (FlappyTerm, Reset progress) can go the same way in a short pane while the cursor can still land on them. One option: on the desktop profile, fall back to the plain scrolling render when the laid-out text is taller than rows.

Comment thread website/src/lib/tut-runner.ts Resolved
Comment thread website/src/lib/tut-ports-detector.ts Resolved
… running servers

Text taller than the tutorial pane keeps its last rows over the starfield,
as the plain line-by-line render did, instead of dropping them. The desktop
starfield skips its ticks while the tutorial terminal is not on screen. The
ports credit forgets panes whose dev server stopped, so one server rerun in
another pane is never two.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@nedtwigg

Copy link
Copy Markdown
Member Author

Overflow fixed in f79cf0d: text taller than the pane now keeps its last rows over the starfield, so the active hint, the prose, and "Section complete" stay on screen when the pane is split short, and the menu's bottom rows stay reachable. One correction: the tutorial runs on the alternate screen, which has no scrollback, so the old \r\n render never kept the overflow readable either. It scrolled the top lines off, and this keeps the same rows it did.

# Conflicts:
#	website/src/components/PocketTerminalExperience.tsx

This branch has not been deployed

No deployments
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