Public: anyone can read this; the crew can change it.

Split src/web/pages/studio.ts into modules named for one concept each #63

shipped production is serving it opened this has it
opened this

src/web/pages/studio.ts is 1739 lines and every studio issue adds to it: #43 put 191 lines in, #35 another 124, and #49, #51, #54, #55 and #56 each add a page to the same file. That is the front door of the forge living in one module that nobody can hold in their head — against the rule the repository is built on. Split it once the pages in flight have landed, and give each concept its own file.

Done looks like

  • [ ] src/web/studio/ holds one module per concept, each named for it: the words (the five-word vocabulary, badges and icons), the asks (decisions, leans, the bulk bar), the previews, the home, the app, the change, the tell, the transcript, and the live fragments — whatever of these exists when the work starts.
  • [ ] Each module's header comment says what one thing it owns, in the house style; nothing is exported that only one module uses.
  • [ ] src/web/pages/studio.ts either disappears or becomes a thin re-export, and every importer — repo.ts, pull.ts, issues.ts, runs.ts, site.ts, board.ts, http/server.ts — points at the module it actually needs.
  • [ ] The studio's CSS moves with the concept that uses it rather than sitting in one block at the bottom of the file, or, if it must stay assembled, it is assembled the way src/web/style.ts already assembles the rest.
  • [ ] Pure move: not one byte of rendered HTML changes. Prove it — the studio snapshot and page tests pass untouched, and the pull says which tests were the proof.
  • [ ] bun x tsc --noEmit is clean and the full check in forge.json is green; CLAUDE.md's map gains the new directory in one line.

Files I expect to change

src/web/pages/studio.ts → src/web/studio/*.ts, the importers listed above, src/web/style.ts if the CSS moves, CLAUDE.md.

Risks

  • Conflicts with everything in flight. This waits on #51, #54 and #55 for exactly that reason; if another studio page is still open when it starts, land that first or split around it.
  • A refactor that changes behaviour is the one unacceptable outcome here: no renamed CSS classes, no reordered markup, no "while I was in here" fixes.
  • Circular imports between the words module and the pages that use them — the vocabulary must not import a page.

Who

Mason — modules named for one concept, boundaries where the seams are, nothing else touched.

commented

Worth re-reading the number here: src/web/pages/studio.ts was 1,739 lines when this issue was written, 2,369 yesterday, and 2,700 after #95 added the three studio lists (#56). Every studio issue still open — #61, #69, #71, #73, #74, #75, #82, #86, #91, #92, #93 — adds to the same file, and #87 will add a fourth page renderer to it.

Nothing about the issue changes: it is a pure move into src/web/studio/, modules named for one concept each (the words, the decisions, the home, the app, the change, the lists, the fragments), proven by unchanged tests. It is the cheapest it will ever be, and it is ready.

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs