feat(orthography): full ainconv option set + four tu styles#30
Conversation
|
Caution Review failedThe pull request is closed. ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (3)
📝 WalkthroughWalkthrough
ChangesOrthography rendering flow
Sequence Diagram(s)sequenceDiagram
participant SettingsDialog
participant Orthography
participant convert_with
participant ainconv
SettingsDialog->>Orthography: set use_small_i and use_small_u from ID_GLIDES
Orthography->>convert_with: provide rendering flags
convert_with->>ainconv: convert input text
convert_with->>convert_with: post-process wi/we/wo, small n, and tu_style output
Estimated code review effort🎯 4 (Complex) | ⏱️ ~45 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 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 |
cd26593 to
e35e1f2
Compare
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@src/settings_dialog.rs`:
- Line 61: The orthography checkbox logic in settings_dialog::SettingsDialog is
collapsing two config-only fields into one UI state and then writing both back
on save, which overwrites preserved per-coda choices. Update the save/load
handling around the checkbox representation so SettingsDialog only copies back
the orthography fields the UI can actually express, and leave config-file-only
state unchanged when use_small_i and use_small_u differ. Use the existing
orthography mapping and the OK/save path near the current UI checkbox binding
and the config writeback logic to locate the fix.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: d196e5a7-695c-4ceb-9fb9-485b227385d3
📒 Files selected for processing (3)
src/config.rssrc/kana.rssrc/settings_dialog.rs
e35e1f2 to
cbf7a2a
Compare
…ialog The single 'small glides' checkbox represents only both-on / both-off. Loading showed it checked when EITHER use_small_i/use_small_u was set, and saving wrote both — silently overwriting a per-coda state set via config.toml (e.g. use_small_i=true, use_small_u=false). Now the box is checked only when both are on, and OK writes both fields only when they already agree or the user turns the option on; an asymmetric file-set state is preserved. (CodeRabbit, #30)
Expands the katakana notation options to the canonical ainconv-tests set (options.schema.json) plus a richer `tu` rendering, all driven from config.toml: - tu_style gains Twu (トゥ) and PlainTsu (ツ) alongside To (ト゚) and Tsu (ツ゚). - small_glides split into use_small_i (-y → ィ) and use_small_u (-w → ゥ), and use_small_n added (-n coda → ㇴ instead of ン). - use_wi / use_we / use_wo keep ヰ / ヱ / ヲ instead of ウィ / ウェ / ウォ (post-processed, so a following coda stays intact: wen → ウェン → ヱン). kana::convert_with applies them over ainconv's default output. The settings dialog still exposes the basic glides/tu toggles; the full per-coda and w-kana set is config-file-driven for now. 8 new/updated unit tests (host harness). Note: the old `small_glides` key is renamed; configs auto-regenerate with defaults, so a hand-set value resets (early beta).
…ialog The single 'small glides' checkbox represents only both-on / both-off. Loading showed it checked when EITHER use_small_i/use_small_u was set, and saving wrote both — silently overwriting a per-coda state set via config.toml (e.g. use_small_i=true, use_small_u=false). Now the box is checked only when both are on, and OK writes both fields only when they already agree or the user turns the option on; an asymmetric file-set state is preserved. (CodeRabbit, #30)
726f0b8 to
dc32778
Compare
Addresses part of the config feedback: "the options are limited… see ainconv-tests for more orthographical options such as wi we etc… check tu mode, we have many options (twu トゥ / tu ツ゚ / to ト゚ / barely ツ)… allow customization."
Brings the katakana notation options up to the canonical set in
ainconv-tests/options.schema.json, plus a richertu:tu_styletoト゚ ·tsuツ゚ ·twuトゥ ·plain_tsuツuse_small_i/use_small_u-y/-wcoda → small ィ / ゥ (was the singlesmall_glides)use_small_n-ncoda → ㇴ instead of ンuse_wi/use_we/use_wokana::convert_withover ainconv's default output; w-kana are post-processed so a following coda survives (wen→ ウェン → ヱン).-D warningsclean on the Windows target.small_glideskey is renamed (→use_small_i/use_small_u); since config.toml auto-regenerates, a hand-set value resets to default — fine for the early beta.Follow-ups from the same feedback (separate PRs): self-documenting config.toml (inline comments + valid-value lists), and the Start-Menu shortcut +
ShowSettingsrundll32 export so the GUI is reachable on Windows 11 (where the language bar — and thus the langbar Settings menu — is hidden by default).Summary by CodeRabbit
New Features
wi/we/worendering.turendering styles with additionaltuoptions.Bug Fixes
wi/we/wo, smalln, andtuvariants).Tests