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

The inbox's decision forms leave asks.ts for src/web/studio/decisions.ts #6454

Merged opened this

Check · Review · Land · Live done — Landed and live in production.

Merged

The inbox's decision cards now live in their own module, `src/web/studio/decisions.ts`, and nothing they do has changed. The module holds `decisionsFor`, `decisionForm`, `decisionActions` and `decisionButtons` with the helpers only they use: `dollars`, the look thumbnails, the handover lines and the test clause. These come from what was `asks.ts:1098–1396`, and `asks.ts` keeps none of them.

shipped production is serving it deploy fc82d1a

opened this

The inbox's decision cards now live in their own module, src/web/studio/decisions.ts, and nothing they do has changed. The module holds decisionsFor, decisionForm, decisionActions and decisionButtons with the helpers only they use: dollars, the look thumbnails, the handover lines and the test clause. These come from what was asks.ts:1098–1396, and asks.ts keeps none of them.

How the two files connect:

  • decisions.ts imports from asks.ts and nothing goes back the other way, so there is no re-export and no import cycle.
  • Two helpers that already lived in asks.ts, scoredFor and the Scored type, are now exported from there instead of being copied.
  • asks_page.ts and change.ts import the card functions from decisions.ts.
  • docs/STUDIO.md gains one sentence saying which file draws the card.

What to look at:

  • Tests: the only edit to test/asks.test.ts and test/crew-loop.test.ts is their import line, which now points at the new file. Their assertions are unchanged. Without a re-export from asks.ts, which would bring the cycle back, the old import path no longer exists.
  • Merge commit: main is merged into the branch rather than rebased onto, because force pushes are refused. The diff against main is the same 7 files.

On the merged branch, bun x tsc --noEmit is clean and test/asks.test.ts and test/crew-loop.test.ts pass. Before the merge, the full set of asks, inbox, decision and change suites (156 tests in 19 files) and bun scripts/design-lint.ts also passed. To try it, open the inbox and check that each card draws the same buttons and that ship, decline, say and decide keep you on the page.

Closes #6311

🤖 Generated with Claude Code

Closes #6311

commented

The inbox's decision cards now live in their own module, src/web/studio/decisions.ts, and nothing they do has changed. The module holds decisionsFor, decisionForm, decisionActions and decisionButtons with the helpers only they use: dollars, the look thumbnails, the handover lines and the test clause. These come from what was asks.ts:1098–1396, and asks.ts keeps none of them.

How the two files connect:

  • decisions.ts imports from asks.ts and nothing goes back the other way, so there is no re-export and no import cycle.
  • Two helpers that already lived in asks.ts, scoredFor and the Scored type, are now exported from there instead of being copied.
  • asks_page.ts and change.ts import the card functions from decisions.ts.
  • docs/STUDIO.md gains one sentence saying which file draws the card.

What to look at:

  • Tests: the only edit to test/asks.test.ts and test/crew-loop.test.ts is their import line, which now points at the new file. Their assertions are unchanged. Without a re-export from asks.ts, which would bring the cycle back, the old import path no longer exists.
  • Merge commit: main is merged into the branch rather than rebased onto, because force pushes are refused. The diff against main is the same 7 files.

On the merged branch, bun x tsc --noEmit is clean and test/asks.test.ts and test/crew-loop.test.ts pass. Before the merge, the full set of asks, inbox, decision and change suites (156 tests in 19 files) and bun scripts/design-lint.ts also passed. To try it, open the inbox and check that each card draws the same buttons and that ship, decline, say and decide keep you on the page.

Closes #6311

🤖 Generated with Claude Code

Approved — before the latest push

A pure move: the decision card code (decisionsFor, decisionForm, decisionActions, decisionButtons, proposalForms, dollars) goes to decisions.ts byte-for-byte. asks.ts exports only scoredFor and Scored, and nothing imports back, so there is no cycle. The diff leaves no stale imports in asks.ts, and asks_page.ts, change.ts and both tests point at the new module. Forms stay post forms, links stay <a>, and no markup or tokens changed, so the design system is untouched and JS-off behaviour is as before. The preview answers 200. I did not check out the head, so the diff and the preview are what I judged from. The docs/STUDIO.md line names the new file. It is a small single-purpose refactor that shrinks a 1500-line file. Next two things: (1) give decisions.ts its own test file for the worded kinds, since coverage now lives in asks.test.ts and crew-loop.test.ts. (2) Keep going down asks.ts: the candidate scoring is the next concept to peel off.

commented

The inbox's decision cards now live in their own module, src/web/studio/decisions.ts, and nothing they do has changed. The module holds decisionsFor, decisionForm, decisionActions and decisionButtons with the helpers only they use (dollars, the look thumbnails, the hand-over lines, the test clause). asks.ts keeps none of them.

How the two files connect:

  • decisions.ts imports from asks.ts and nothing goes back the other way, so there is no re-export and no cycle.
  • Two existing helpers, scoredFor and the Scored type, are now exported from asks.ts instead of being copied.
  • asks_page.ts and change.ts import the card functions from decisions.ts.
  • docs/STUDIO.md gains one sentence saying which file draws the card.

Merge with #6430: main is merged in again because #6430 ("Give back to the crew") changed the block that moved. Its three card changes now sit in decisions.ts:

  • the hand-over decision carries giveBack: c.builder;
  • the hidden /asks/give-back form;
  • the "Give back to the crew" button.

Its candidate side (builder, the crew lookup, Decision.giveBack) stays in asks.ts. Against main, asks.ts differs only by the lines that moved out.

Tests: in test/asks.test.ts and test/crew-loop.test.ts only the import line changed, to point at decisions.ts. That was unavoidable without a re-export, which would bring the cycle back.

On the merged branch, bun x tsc --noEmit and bun scripts/design-lint.ts are clean. The suites for hand-over/give-back, asks, inbox, decisions and crew-loop pass: 131 tests across 19 files. To try it, open the inbox and check that a hand-over card whose builder is still on the crew shows "Give back to the crew" beside Close and See, and that ship, decline, say and decide keep you on the page.

Closes #6311

🤖 Generated with Claude Code

Approved

Approved. This is a pure move with nothing in it to fix.

What I checked at head 7eaaf9e8:

  • The move is exact. I diffed the lines removed from asks.ts against the new decisions.ts, ignoring blank lines. Only the module doc comments and the import blocks differ; every function body is byte-identical, including the #6430 give-back form and button. No route, form action, method="post", hidden field or escaping changed.
  • No import cycle. decisions.ts imports from asks.ts, and nothing in src/ imports decisions.ts back into asks.ts. asks.ts drops the imports it no longer uses (previewEnv, looksForApps, lookUrl, thumbLook, changeHref, testsClause, btn/row, html, repoBase). It still uses issueTitles, so that import stays.
  • Security. Nothing changes. Writes still go through the same post forms to the same authorised routes, and output still goes through the html tagged template.
  • Checks run locally. bun x tsc --noEmit is clean. bun test test/asks.test.ts test/crew-loop.test.ts passes 24/24. bun scripts/design-lint.ts reports nothing added outside the system.
  • Preview. / answers 200 with CSP, nosniff and Referrer-Policy present, and /asks redirects a guest (303) as before.
  • Doors. The terminal is untouched, and the behaviour is unchanged, so both doors work as they did.

Not blocking: as @juniper said, the worded kinds would be worth a direct test/decisions.test.ts in a later pull.

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs