githubnext/chopinPublic

Let's compose rich plans together

Draw text fences as bare text, without code controls #430

OpenMaggieAppletonwants to merge 0 commits intomainfromrefs/pull/430/head
  1. MA

    ## Problem

    When the Planner writes a ```` ```text ```` fence (an ASCII wireframe, for example), it gets full code chrome: a language label and picker in the corner, and a "Show source" toggle that swaps between a "highlighted" copy and the identical source. Neither control does anything useful for plain text.

    ## Change

    - `plainText()` in `packages/editor/src/widgets/code.ts` recognises `text`, `txt`, `plaintext` and `plain` (case-insensitive). `kindOf()` maps them to `plain`, the existing kind for unnamed fences. They get no highlighted preview and so no show-source toggle. - The preview plugin marks such blocks `data-plan-text`. CSS hides their corner chrome with `visibility: hidden`, both at rest and on hover. The chrome only reappears while a writer's caret is in the block, or while the language menu is open or focused. A text block can still be turned into code from the existing menu, with no new UI. - Text blocks keep their lines (`white-space: pre`). A wide drawing scrolls inside the block instead of wrapping. The empty placeholder reads "Text", and touch layouts drop the empty controls band.

    ## Scope: unnamed fences are unchanged

    An unnamed fence looks exactly like a code block freshly inserted from the slash menu or toolbar, and that block needs the picker to choose a language. Unnamed fences keep their current behaviour, including the menu on hover. Only fences explicitly named as plain text lose the chrome.

    Known minor tradeoff: on touch screens, putting the caret in a text block brings back the controls band, so the content shifts down once.

    ## Tests

    - Unit test in `code.test.ts`: the aliases map to `plain`. `""`, `typescript` and `markdown` are not plain text. - New e2e in `e2e/code.e2e.ts`: a text fence next to a ts fence. Only the ts fence has a preview, a "Show source" button and a language menu, including while hovering the text. Clicking into the text shows the menu, and choosing TypeScript writes ```` ```typescript ````. - Locally: `bun test` (4220 pass), `bun run types`, `bun run ci` (design contract ok, no hash changes). E2E was not run locally and is left to CI. - I checked by hand on a fake-GitHub server. Before, the text fence had a "text" corner label and a show-source toggle. After, it is bare, with no picker, no toggle, `white-space: pre` and a horizontal scroll.

    馃 Generated with [Claude Code](https://claude.com/claude-code)

  2. Unknown GitHub usercommitted bcf4d38cc012last month on GitHub

  3. The preview deployment for **chopin** is ready. 馃煝

    [Open app](http://430-chopin.githubnext.com) | [Open Build Logs](https://next-appserver.tail49836a.ts.net/project/l9buznc9ua1if0vflxrjwajs/environment/lxqsvczv19eopxk29vfb46mj/application/hb85gdd9mwqqlfwcteflvpbj/deployment/dnoxedqqyvp2aedyu7i51uxc) | [Open Application Logs](https://next-appserver.tail49836a.ts.net/project/l9buznc9ua1if0vflxrjwajs/environment/lxqsvczv19eopxk29vfb46mj/application/hb85gdd9mwqqlfwcteflvpbj/logs)

    Last updated at: 2026-10-09 13:53:09 CET

  4. Unknown GitHub usercommitted 1b4154eadabclast month on GitHub

  5. MaggieAppletonauto-rebase-enabledlast month on GitHub

  6. MaggieAppletonreferenced this in Draw wireframe fences as chromeless, inert blueprints #436last month on GitHub