Repository navigation
Add token commands with parity tests - #488
alex-rawlings-yyc wants to merge 2 commits into
Conversation
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars. ⚙️ Run configuration
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
a65b46a to
e6d1840
Compare
e6d1840 to
7243203
Compare
|
A host edit to a draft with no analysis languages writes the gloss under the session's fallback language ( The WebView's first save stores the language it picked. Edits should do the same: at |
b5b8c39 to
f539ff4
Compare
| } | ||
| } else { | ||
| target.gloss = { ...target.gloss, [lang]: value }; | ||
| delete target.glossSenseRef; |
There was a problem hiding this comment.
Typing a free-form gloss drops glossSenseRef, so editing a lexicon-backed gloss unlinks it. That goes against the model: TokenAnalysis.glossSenseRef says that when gloss and the ref are both present, "glossSenseRef is retained so the lexicon link is not lost." It's also inconsistent with the other two glosses, since morpheme and phrase gloss writes both keep their senseRef.
This is parity with writeGlossOntoAnalysis, so it isn't a bug in this PR. But the host is about to make this behavior permanent, and #227 starts filling these fields from FW Lite. I suggest keeping the ref in both the reducer and the command (drop the delete in each), plus a parity case with a linked analysis. If that's out of scope here, a follow-up issue before 4c (#455) works too.
Clearing is different and should keep dropping the ref: clearAnalysisGloss removes it once no gloss remains. Keeping it there would make an emptied field show the sense gloss again.
There was a problem hiding this comment.
Done: the reducer and the command both keep the ref on a rewrite, and the linked-analysis parity case now expects it kept. The catalog's writeGlossOntoAnalysis dropped it too, so it keeps it now as well.
9d5b5ef to
d4487d9
Compare
d4487d9 to
689bd3c
Compare
|
re: "A host edit to a draft..." Fixed. When the draft lists no analysis languages, an edit now stores the session's analysis language in the same undo step. |
Part of #426; closes #443. Stacked on #487.
Summary
The token commands, with the approval rule and parity tests, and the pattern 3e to 3i follow.
mergeAnalysesIntostays with 3i.AnalysisSessions.editapplies what a command staged as one undo step, after the approval rule passes, and marks the draft dirty. When the draft lists no analysis languages, that step adds the session's. A command staging nothing applies nothing and records no step.getScopejoins the seam, so that an edit can read the draft's analysis languages.Evidence
tscclean.Decisions with a strong alternative
isEmptyTokenAnalysisandclearAnalysisGlossmoved from the reducer into a util both use, with no change in behavior, so the two can't drift.Deferred
Pool buckets in replies (3k), and the collapse survivor the reducer reports, which only catalog edits read (3i).
Merge Danger
Door: two-way
Nothing calls the new commands. The reducers changed only by importing two helpers.
Blast Radius: the gloss reducers' content checks, through the moved helpers
🤖 Generated with Claude Code
This change is