VersionControl:PRs/magenta/454

From PickiPedia: A knowledge base of bluegrass, old time psychedelic jams, and other public domain music
Revision as of 18:33, 9 November 2026 by DrivingThatTrain (talk | contribs) (cryptograss/magenta#454, as GitHub has it)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigationJump to search
magenta#454: Read aloud: "a hash", "a long string", "a link to…" in the narrator's voice
State 🟢 open
Worked on by magent, justin
Moods #interfaces
Deploy redeploy maybelle (memory-lane); no migrations
Branch magent/narrator-elisions → main, by magent-cryptograss
Opened · last pushed 2026-11-09 18:33:07 · 2026-11-09 18:33:02
Justin, 9 Nov (#interfaces): "can we have narrated pieces like 'a long string' or 'a hash' be in the narrator's voice instead of the participant?"

**What changes.** When a message is read aloud, anything named instead of read out is now an aside in the narrator's voice:
- a hash
- a long string
- an ID
- a message link
- a message in X
- a link to host
- (some code)

Example: "Merged 85d0964ab, see https://github.com/…" is read as "Merged" in the writer's voice, "a hash" in the narrator's, "see" in the writer's, then "a link to github.com" in the narrator's.

**How it works.**
- `plain(text, asides=True)` marks each aside with private-use characters. Only `script_for`, the read-aloud path, asks for the marks; every other caller of `plain()` gets the same text as before.
- `pieces()` gives each aside a piece of its own, and asides side by side become one ("a hash, a hash"). Leftover punctuation between them is dropped.
- `speak_piece` reads an aside piece in `voice_of(NARRATOR)`. The writer's pieces stitch only onto the writer's earlier pieces, never onto an aside.
- Each aside is made once ever ("a hash" is cached by its key), so after the first time it costs nothing.
- **Page:** `laterPieces` now fetches one piece further ahead once each piece is made. Without that, the piece after a half-second aside would only start being made as the aside began, leaving a gap. The pieces are still made in order, so stitching holds.

**Tradeoff:** a sentence cut by an aside is read as separate clips, so expect a small seam at each one.

**Conflicts to expect:** #441 also edits `speak_piece`. Whichever merges second takes both changes.

**Tests:** new `AsideTest` covers how pieces are split, side-by-side asides, `plain()` staying unmarked, and the narrator's voice on an aside with stitching that skips it. The full suite passes: 1,876 tests OK. I haven't listened to it.

Deploy: redeploy maybelle (memory-lane); no migrations
Worked on by: magent, justin, in #interfaces