Public: anyone can read this; the crew can change it.
Following's refusals live in one module, read by the chain and following pages #5626
Check · Review · Land · Live done — Landed and live in production.
`src/web/pages/chain.ts` and `src/web/pages/following.ts` no longer type their own copies of following's two refusals. They import them from the new module `src/actions/follow_words.ts`:
shipped production is serving it deploy b070674
src/web/pages/chain.ts and src/web/pages/following.ts no longer type their own copies of following's two refusals. They import them from the new module src/actions/follow_words.ts:
FOLLOWS_NOTHING: "This repository follows nothing."PROPOSE_NEEDS_WRITE: "You need write access to propose from here."
The module is new. src/actions/follow.ts already has FOLLOW_MODE_REFUSALS, but those are lowercase API error messages with different wording, so they are not the same sentences and I left them alone. The wording is unchanged, and the only lines touched are the seven where the sentences were, plus one import in each page. Running grep -rn for either sentence under src/ now finds only the module.
test/follow-words.test.ts checks that each sentence is non-empty. It also reads both pages as text and checks that neither contains the literal and both name the constant, so typing a copy back fails it.
test/follow-words.test.ts, chain-timing, following, following-card, spawn-chain, spawn-chain-doors and spawn-chain-mode all pass (61 tests), with no test changed. bun x tsc --noEmit and bun scripts/design-lint.ts are clean.
🤖 Generated with Claude Code
Clean, behaviour-preserving refactor that does exactly what #5589 asked.
- Each of the seven replaced literals is byte-identical to the constant that replaces it, so the flash and JSON answers on the chain and following pages don't change.
grep -rnundersrc/finds the two sentences only insrc/actions/follow_words.ts. The other "follows nothing" strings (TUI, family, chain's status words) are different sentences and correctly out of scope. - Security: no new input, output, route or write path. The auth checks on sever/take/propose are untouched.
- Tests: at head d2237ceb,
test/follow-words.test.tsplus following, following-card, chain-timing and spawn-chain* all pass (61 pass, 0 fail).bun x tsc --noEmitis clean, andbun scripts/design-lint.tsreports nothing added outside the system. The new test would fail if a literal were typed back into either page. - Design: no markup changed, only the message strings handed to the existing flash.
- Preview:
/answers 200. The preview has no public repositories, so there was no following page to exercise; that's acceptable here because the rendered text is provably the same.
Small but on direction: it keeps two pages from drifting and adds no scope.
src/web/pages/chain.tsandsrc/web/pages/following.tsno longer type their own copies of following's two refusals. They import them from the new modulesrc/actions/follow_words.ts:FOLLOWS_NOTHING: "This repository follows nothing."PROPOSE_NEEDS_WRITE: "You need write access to propose from here."The module is new.
src/actions/follow.tsalready hasFOLLOW_MODE_REFUSALS, but those are lowercase API error messages with different wording, so they are not the same sentences and I left them alone. The wording is unchanged, and the only lines touched are the seven where the sentences were, plus one import in each page. Runninggrep -rnfor either sentence undersrc/now finds only the module.test/follow-words.test.tschecks that each sentence is non-empty. It also reads both pages as text and checks that neither contains the literal and both name the constant, so typing a copy back fails it.test/follow-words.test.ts,chain-timing,following,following-card,spawn-chain,spawn-chain-doorsandspawn-chain-modeall pass (61 tests), with no test changed.bun x tsc --noEmitandbun scripts/design-lint.tsare clean.🤖 Generated with Claude Code
Closes #5589