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

An app note's sentences live in one module, read by the note door, the notes action and the forge toolbar #5637

Merged opened this

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

Merged

The three sentences said when an app note is sent now live in one new module, `src/apps/note_words.ts`. No existing module owned this concept, so I made a new one. It exports `NOTE_EMPTY` ("Write a few words first."), `NOTE_FAILED` ("That did not go through. Try again.") and `NOTE_TOO_LONG` ("That is too long to send in one go.").

shipped production is serving it deploy f9c1fcc

opened this

The three sentences said when an app note is sent now live in one new module, src/apps/note_words.ts. No existing module owned this concept, so I made a new one. It exports NOTE_EMPTY ("Write a few words first."), NOTE_FAILED ("That did not go through. Try again.") and NOTE_TOO_LONG ("That is too long to send in one go.").

What moved where:

  • src/actions/app_notes.ts: the empty-note refusal uses NOTE_EMPTY.
  • src/apps/feedback.ts: the bad-request answer uses NOTE_FAILED.
  • src/apps/toolbar.ts: the pill's script is a template literal, so the sentences go in as ${JSON.stringify(NOTE_EMPTY)} and ${JSON.stringify(NOTE_FAILED)}. That writes out the same quoted string as before. The script hashes to the same sha256 (5223afe6…) before and after, so its content-addressed URL does not change.
  • src/tui/screens/report.ts and src/web/studio/toolbar.ts (both places it appeared): the too-long refusals use NOTE_TOO_LONG.

Only the lines with the sentences changed, plus one import in each file. No wording changed. grep -rn for each sentence under src/ now finds only note_words.ts.

Test: the new test/note-words.test.ts reads each of the five files as text. It checks that each one imports note_words.ts and contains none of the three sentences, so it fails if a copy is typed back. It also pins the exact wording and checks that the pill's script still carries the two sentences as quoted strings.

Checks run: bun x tsc --noEmit and bun scripts/design-lint.ts are clean. 14 test files passed with no failures and no test edited: the new test plus apps-feedback, apps-feedback-mirror, apps-report, apps-toolbar, apps-toolbar-tell, crew-feedback, toolbar-actions, toolbar-change-line, toolbar-live, toolbar-move, toolbar-page-timing, toolbar-signed-out and tui-report.

Left alone: sentences that are close but different, such as the terminal's "Say something first." and "That could not be sent." The issue names only these three, and folding the others in would change what people see.

To try it: open a preview app page, open the forge pill and press send with the box empty. It still says "Write a few words first."

🤖 Generated with Claude Code

Closes #5616

commented

The three sentences said when an app note is sent now live in one new module, src/apps/note_words.ts. No existing module owned this concept, so I made a new one. It exports NOTE_EMPTY ("Write a few words first."), NOTE_FAILED ("That did not go through. Try again.") and NOTE_TOO_LONG ("That is too long to send in one go.").

What moved where:

  • src/actions/app_notes.ts: the empty-note refusal uses NOTE_EMPTY.
  • src/apps/feedback.ts: the bad-request answer uses NOTE_FAILED.
  • src/apps/toolbar.ts: the pill's script is a template literal, so the sentences go in as ${JSON.stringify(NOTE_EMPTY)} and ${JSON.stringify(NOTE_FAILED)}. That writes out the same quoted string as before. The script hashes to the same sha256 (5223afe6…) before and after, so its content-addressed URL does not change.
  • src/tui/screens/report.ts and src/web/studio/toolbar.ts (both places it appeared): the too-long refusals use NOTE_TOO_LONG.

Only the lines with the sentences changed, plus one import in each file. No wording changed. grep -rn for each sentence under src/ now finds only note_words.ts.

Test: the new test/note-words.test.ts reads each of the five files as text. It checks that each one imports note_words.ts and contains none of the three sentences, so it fails if a copy is typed back. It also pins the exact wording and checks that the pill's script still carries the two sentences as quoted strings.

Checks run: bun x tsc --noEmit and bun scripts/design-lint.ts are clean. 14 test files passed with no failures and no test edited: the new test plus apps-feedback, apps-feedback-mirror, apps-report, apps-toolbar, apps-toolbar-tell, crew-feedback, toolbar-actions, toolbar-change-line, toolbar-live, toolbar-move, toolbar-page-timing, toolbar-signed-out and tui-report.

Left alone: sentences that are close but different, such as the terminal's "Say something first." and "That could not be sent." The issue names only these three, and folding the others in would change what people see.

To try it: open a preview app page, open the forge pill and press send with the box empty. It still says "Write a few words first."

🤖 Generated with Claude Code

Approved

Does what #5616 asked: three sentences in src/apps/note_words.ts, five files import them, wording unchanged, the pill script is byte-identical via JSON.stringify, and the new test fails if a copy is typed back. No behaviour, markup or CSS changed, so DESIGN.md is untouched; the preview answers 200. It is a small refactor outside the arm-stability list, but it is already scoped and low risk. Next, two things: (1) the test greps source text, so a reworded copy slips past it; consider a test of the served answers instead. (2) app_notes.ts still has its own too-long sentence ("That is a bit long...") and the terminal has "Say something first."; decide in a follow-up whether they belong in the module.

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs