Skip to content

Surface the translator's per-slide notes on the entry - #184

Open
kcarnold wants to merge 2 commits into
claude/confident-albattani-owiu8sfrom
claude/confident-albattani-owiu8s-notes
Open

kcarnold wants to merge 2 commits into
claude/confident-albattani-owiu8sfrom
claude/confident-albattani-owiu8s-notes

Conversation

@kcarnold

Copy link
Copy Markdown
Collaborator

Stacked on #182. The base branch is #182's, so this diff shows only the notes. Retarget it to main once #182 merges. Together the two replace #152.

What

set_translations has always accepted an optional per-segment note ("a genuine ambiguity or judgement call worth flagging"), and applySetTranslations threw it away. The note now rides on the slide translation entry, { text, provenance, note? }, next to provenance (and later #181's sourceId).

Why on the entry and not on the conversation (as #152 did): a note is a caveat about one text. Whatever replaces the text replaces the note too:

  • set_translations brings its own note or none;
  • revise_translation drops it;
  • a reviewer's Save drops it, because the human has dealt with it.

The model's wording stays in the stored conversation (the tool-call args are kept verbatim), so nothing is lost. Keeping notes on the entry also removes #152's bookkeeping: there is no loading of notes into a follow-up run and no item-wide replacement set. A slide a run doesn't write keeps its note in the doc.

Path: nlp.ts (working-copy notes, TranslationBlockResult.note) → translateItem → storeTranslations (translate-ahead) / the follow-up's updatedTranslations → the doc. The library never stores a note.

Review screen

  • A note shows above its cell's textarea.
  • The item <select> appends · 📝 n to items whose doc entries carry notes (countNotes). It counts per slide per language, so a repeated chorus counts at each occurrence, matching the grid.
  • Notes travel with the drafts in the grid state. They're replaced when a model result replaces the draft and cleared on Save.

The set_translations tool description now tells the model its note is displayed and counted, and that rewriting or revising withdraws it.

Smoke test

Touches §3 Proclaim sync. Open an item whose picker label shows 📝 n and check that n cells show a note. Save one and check that its note disappears and the count drops.

Verification

npm run typecheck, npm run lint, npm test (674 passed). New tests cover:

  • the note lifecycle in the agent (attach/trim, a rewrite withdraws it, a revision withdraws it but it stays in the conversation);
  • translateItem carrying the note;
  • storeTranslations keeping it;
  • countNotes;
  • note rendering in SlideReview.

Generated by Claude Code

set_translations always accepted a per-segment note ("a genuine ambiguity
or judgement call worth flagging") and we threw it away. It now rides on
the slide translation entry as `note?`, next to provenance.

A note is a caveat about one text, so whatever replaces the text replaces
the note: set_translations brings its own or none, revise_translation
drops it, and a reviewer's Save drops it. The model's wording stays in the
stored conversation. Because the note lives on the entry, nothing has to
seed notes into a follow-up run or replace an item-wide set: a slide the
run doesn't write keeps its note in the doc.

Review screen: a note shows above its cell, and the item picker appends
"· 📝 n" for items whose doc entries carry notes. The library never stores
a note. The tool description now tells the model the note is displayed and
that rewriting withdraws it.

Second half of #152, stacked on the tier removal.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01F2MPHXNLbLbVZuEDZToVvz

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants