fix: populate script isRtl in controller and svelte - #152
Conversation
|
[Claude Opus 4.8] Consulted Devin on 2026-07-24 10:59 USMST up to commit Result: 0 Bugs, 0 Investigate flags, 1 Informational (not mirrored — low signal). The informational note observes that |
Completes feature parity for IScript.isRtl, which shipped in 0.4.0 for the React hook only. The language-chooser controller now stamps isRtl on the selected script at every selection path (normal selection, sole-script auto-selection, and customize-modal submit), so Svelte and other controller consumers receive the reading direction in the emitted orthography. The Svelte demo shows the script's RTL/LTR direction, matching the React DialogDemo. Also hardens isRTLScript to return false (instead of throwing) on a malformed or unknown script code. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
|
[Claude Opus 4.8] Consulted Devin on 2026-07-24 11:14 USMST up to commit Result: 0 Bugs, 0 Investigate flags, 3 Informational (not mirrored — low signal, no action). Re-review clean. |
What
Adds feature parity for the newly-added
IScript.isRtlproperty across the controller and Svelte language choosers.isRtlwas previously populated only by the React hook.Changes
language-chooser-controller): ascriptWithReadingDirection()helper stampsisRtl(viaisRTLScript(script.code)) onto the selected script at every path a script becomes selected — normal selection, auto-selection of a language's sole script, and customize-modal submit. It returns a fresh copy rather than mutating shared language data, which matches theFieldchange-detection contract. Svelte consumers (which derive the emitted orthography fromselectedScript) now receive the reading direction automatically.BasicDemo.svelte): the "Submitted selection" panel shows the script asName (RTL/LTR), matching the ReactDialogDemo.isRTLScript): wrappedIntl.Localeconstruction in try/catch so a malformed/unknown script code returnsfalseinstead of throwing. Behavior for valid codes is unchanged.isRtl, and added a test assertingisRtl: truefor an RTL script (Arabic).Verification
isRTLScriptchange)This change is
Devin review