Rename morpheme-editor Reset string key; test store hooks directly - #175
Conversation
The button labeled "Reset" and its behavior reset the morpheme breakdown rather than deleting it; align the localized string key and doc wording. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Replace the throwaway button-and-click components in the dispatch tests with renderHook + a shared renderStoreHook wrapper, calling dispatchers inside act and asserting on result.current. Document the convention in AGENTS.md. Rendered components are kept only where the DOM is essential (re-render counts, mount/unmount lifecycle). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
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 |
The forms row renders the first morpheme as a <button> but the rest as presentational <span>s. Only the button canceled the click's default action, so inside TokenChip's <label> a click on a later cell was forwarded to the token gloss input; that focus landed outside the just-opened modal editor and immediately dismissed it, leaving focus on the first morpheme gloss field instead of reopening the editor. Cancel the default action on every form cell. jsdom doesn't reproduce label focus-forwarding (so the TokenChip integration test, which stubs MorphemeBox, never caught it); the regression test asserts the preventDefault that suppresses it in a real browser. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
alex-rawlings-yyc
left a comment
There was a problem hiding this comment.
@alex-rawlings-yyc reviewed 8 files and all commit messages.
Reviewable status:complete! all files reviewed, all discussions resolved (waiting on imnasnainaec).
…he bare surface form (#173) * Make morpheme-break reset explicit; confirm before losing glosses * Dismiss morpheme popover on outside click with an empty draft handleSave returns early on an empty draft without closing, so an outside click after clearing the input left the modal popover stuck open. * Use platform Input/Label in the morpheme popover PR #168 migrated this popover's buttons to platform-bible-react `Button` but left the breakdown text field and its label as raw HTML. Bring them in line with the convention the three project modals already follow, so the field picks up the host's focus ring, disabled styling, and dark-mode tokens instead of the hand-rolled approximations. Drops the classes `Input` already supplies (rounded, border, border-input, px/py, text-sm) and keeps only `w-full` and the `font-mono` that the morpheme forms want. `Label` defaults to text-sm, so the popover's smaller `text-xs` stays as an explicit override. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> * Rename morpheme-editor Reset string key; test store hooks directly (#175) * Rename morpheme-editor Reset string key from delete to reset The button labeled "Reset" and its behavior reset the morpheme breakdown rather than deleting it; align the localized string key and doc wording. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> * Test AnalysisStore hooks directly via renderHook Replace the throwaway button-and-click components in the dispatch tests with renderHook + a shared renderStoreHook wrapper, calling dispatchers inside act and asserting on result.current. Document the convention in AGENTS.md. Rendered components are kept only where the DOM is essential (re-render counts, mount/unmount lifecycle). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> * Reopen the morpheme editor when any breakdown cell is clicked The forms row renders the first morpheme as a <button> but the rest as presentational <span>s. Only the button canceled the click's default action, so inside TokenChip's <label> a click on a later cell was forwarded to the token gloss input; that focus landed outside the just-opened modal editor and immediately dismissed it, leaving focus on the first morpheme gloss field instead of reopening the editor. Cancel the default action on every form cell. jsdom doesn't reproduce label focus-forwarding (so the TokenChip integration test, which stubs MorphemeBox, never caught it); the regression test asserts the preventDefault that suppresses it in a real browser. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com> Co-authored-by: D. Ror. <imnasnainaec@gmail.com>
Three small, independent changes on top of
improve-morph-break-ui:<button>and the rest as presentational<span>s; only the button canceled the click's default action. InsideTokenChip's<label>, clicking a later cell was forwarded to the token gloss input, and that focus landed outside the just-opened modal editor and dismissed it — so only the first cell reopened the editor. Now every form cell cancels the default action. jsdom doesn't reproduce label focus-forwarding (and theTokenChipintegration test stubsMorphemeBox), so the regression test asserts thepreventDefaultthat suppresses it in a real browser.%interlinearizer_morphemeEditor_delete%to%interlinearizer_morphemeEditor_reset%, and update theTokenChipdoc wording. The button is labeled "Reset" and resets the breakdown rather than deleting it, so the key name now matches the label and behavior.AnalysisStoredispatch hooks directly viarenderHookinstead of throwaway button-and-click components. Adds a sharedrenderStoreHookwrapper, drives dispatchers insideact(...), and asserts onresult.current. Rendered components are kept only where the DOM is genuinely needed (re-render / render-count assertions, mount/unmount lifecycle). Documented the convention inAGENTS.md.🤖 Generated with Claude Code
This change is