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

Contraction: one codebase, fewer frames — fold /big, the dev app page, landing and the no-JS search into studio and board; remove the TUI's app/run/crew and origins twins #401

Merged opened this in answer to

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

Merged

mason/forge:mason/386-contraction-one-codebase-fewer-frames-fo → main 1 commit fork

  • Merged. mason/386-contraction-one-codebase-fewer-frames-fo was merged into main as 121d182.

Review

Sign in to review this change.
6 files changed +7 −62
CLAUDE.md +1 −1
@@ -135,7 +135,7 @@ src/
135135 pages/{site,repo,issues,pulls,pull,thread,commits,refs,search,
136136 org,account,settings}, and studio/ — the app-as-the-unit
137137 surface, one module per concept: words (the vocabulary every
138 page says it in), asks, leans, previews, shelf (an app as one
138 page says it in), asks, previews, shelf (an app as one
139139 row, for any page that lists apps), home, app, change, tell,
140140 run, lists, actions, style (the page sheet, assembled)
141141 feed/ a viewer's feed (docs/FEED.md): items (candidates read through
src/core/decisions.ts +3 −40
@@ -9,9 +9,9 @@
99 import type { Database } from "bun:sqlite";
1010 import { id as newId } from "../kernel/id.ts";
1111
12 /** `lean` is which option on a studio ask card a careful owner would pick
13 * — see `web/studio/leans.ts`, which stores `{ card, head }` in `state` so
14 * `latestLean` can tell a fresh answer from one about a head that moved. */
12 /** `lean` was which option on a studio ask card a careful owner would pick.
13 * Nothing records one any more; older ledgers still hold rows of it, and the
14 * summaries that read them keep the word. */
1515 export type DecisionKind = "next" | "land" | "retry" | "lean";
1616
1717 export interface Decision {
@@ -146,43 +146,6 @@ export function resolveOpen(
146146 return true;
147147 }
148148
149 /**
150 * The newest `lean` decision still about the same head: the option a
151 * decider offered for one studio ask card, good only as long as the head it
152 * was asked about. `head` is a pull's head oid, or `""` for a card about a
153 * repository rather than a pull. A handful of rows back covers a card whose
154 * kind changed (the same issue asked as `stopped`, then as `look`) without
155 * a join on anything but what is already indexed.
156 */
157 export function latestLean(
158 db: Database,
159 repoId: string,
160 issueId: string | null,
161 card: string,
162 head: string,
163 ): Decision | undefined {
164 const rows =
165 issueId === null
166 ? db
167 .query<
168 Row,
169 [string]
170 >("SELECT * FROM decision WHERE kind = 'lean' AND issue_id IS NULL AND repo_id = ?1 ORDER BY created_at DESC, id DESC LIMIT 10")
171 .all(repoId)
172 : db
173 .query<
174 Row,
175 [string]
176 >("SELECT * FROM decision WHERE kind = 'lean' AND issue_id = ?1 ORDER BY created_at DESC, id DESC LIMIT 10")
177 .all(issueId);
178 return rows.map(toDecision).find((d) => {
179 const s = d.state as { card?: unknown; head?: unknown } | null;
180 return (
181 typeof s === "object" && s !== null && s.card === card && s.head === head
182 );
183 });
184 }
185
186149 export function listDecisions(
187150 db: Database,
188151 repoId: string,
src/web/pages/studio.ts deleted −17
@@ -1,17 +0,0 @@
1 /**
2 * The studio's old front door. Every page and every word moved to
3 * `web/studio/`, one module per concept — `words` (the vocabulary and its
4 * badge), `asks`/`leans` (what asks a person, and the decider's lean on it),
5 * `previews`, `home`, `app`, `change`, `tell`, `run`, `lists`, `actions` and
6 * `style`. Nothing renders here any more: this file exists so the tests that
7 * prove the move changed no byte of HTML could stay untouched while it
8 * happened. Import the module you need; nothing new belongs here.
9 */
10
11 export { decisionsFor } from "../studio/asks.ts";
12 export {
13 pullWord,
14 runWord,
15 servingHistory,
16 type WordCtx,
17 } from "../studio/words.ts";
src/web/studio/asks.ts +1 −1
@@ -3,7 +3,7 @@
33 * card — a pull the crew stopped on, a green pull waiting for a look, or a
44 * repository parked at its ceiling — read from the same tables the rest of
55 * the forge reads, with the same access the owner has. This module owns the
6 * card, the row, the panel of them and the bulk bar; every button here posts
6 * card, the row and the panel of them; every button here posts
77 * to the route a person could have posted to by hand (`actions.ts`).
88 */
99
src/web/studio/style.ts +1 −2
@@ -8,8 +8,7 @@
88 * `components` layer, last, which is where an inline block's rules used to
99 * win from: nothing else in the sheet styles a `.studio-*` selector, and the
1010 * few rules that reach a shared class (`.badge`, `.row-lead`, `.env-facts`)
11 * set properties those components do not. `bulkCss` is not written here at
12 * all: it is derived from the same table the bulk route enforces (`asks.ts`).
11 * set properties those components do not.
1312 *
1413 * `shell` and `rail` hold rules nothing in this directory draws any more,
1514 * and `rows` all but two of them. They are kept exactly as they were because
test/studio.test.ts +1 −1
@@ -54,7 +54,7 @@ import {
5454 runWord,
5555 servingHistory,
5656 type WordCtx,
57 } from "../src/web/pages/studio.ts";
57 } from "../src/web/studio/words.ts";
5858 import { servedPhrase } from "../src/web/ui.ts";
5959 import { repoDir } from "../src/git/repos.ts";
6060 import { appendRunLog } from "../src/runs/log.ts";

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs