Skip to content

feat(orthography): full ainconv option set + four tu styles#30

Merged
mkpoli merged 2 commits into
masterfrom
feat/orthography-options
Jun 27, 2026
Merged

feat(orthography): full ainconv option set + four tu styles#30
mkpoli merged 2 commits into
masterfrom
feat/orthography-options

Conversation

@mkpoli

@mkpoli mkpoli commented Jun 20, 2026

Copy link
Copy Markdown
Owner

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 richer tu:

option effect
tu_style to ト゚ · tsu ツ゚ · twu トゥ · plain_tsu
use_small_i / use_small_u -y/-w coda → small ィ / ゥ (was the single small_glides)
use_small_n -n coda → ㇴ instead of ン
use_wi / use_we / use_wo keep ヰ / ヱ / ヲ instead of ウィ / ウェ / ウォ
  • Applied in kana::convert_with over ainconv's default output; w-kana are post-processed so a following coda survives (wen → ウェン → ヱン).
  • 8 new/updated unit tests (via the host harness); clippy -D warnings clean on the Windows target.
  • Settings dialog keeps the basic glides/tu checkboxes compiling; the full per-coda + w-kana set is config-file-driven (the GUI rework + a richer control is a separate PR).

⚠️ The small_glides key 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 + ShowSettings rundll32 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

    • Added finer orthography controls for small i/u, small n, and wi/we/wo rendering.
    • Expanded tu rendering styles with additional tu options.
  • Bug Fixes

    • Improved conversion/remapping behavior to follow the new per-option orthography settings (including wi/we/wo, small n, and tu variants).
  • Tests

    • Updated conversion and TOML round-trip tests to use the new schema fields and defaults.

@coderabbitai

coderabbitai Bot commented Jun 20, 2026

Copy link
Copy Markdown

Review Change Stack

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 309dc27b-6fae-49e5-a829-4a1e7fef095a

📥 Commits

Reviewing files that changed from the base of the PR and between e35e1f2 and dc32778.

📒 Files selected for processing (3)
  • src/config.rs
  • src/kana.rs
  • src/settings_dialog.rs

📝 Walkthrough

Walkthrough

TuStyle and Orthography gain new rendering options, convert_with uses the expanded flags and post-processing rules, and the settings dialog maps its glides checkbox to the new config fields.

Changes

Orthography rendering flow

Layer / File(s) Summary
Config schema and defaults
src/config.rs
TuStyle adds Twu and PlainTsu; Orthography replaces small_glides with explicit booleans; defaults and TOML tests use the new fields.
Kana conversion and remapping
src/kana.rs
convert_with uses the new orthography flags for coda glides and post-processes wi/we/wo, small n, and tu_style output; kana tests cover the updated cases.
Glides checkbox binding
src/settings_dialog.rs
The glides checkbox reads from use_small_i/use_small_u and writes both fields back into the config.

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
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~45 minutes

Possibly related PRs

  • mkpoli/ainuKey#19: Extends the same orthography configuration and TuStyle surface that this PR builds on.

Poem

I hopped through kana in the winter light,
with tiny n's and glides tucked neat and right.
Four tu forms twinkled in my bun-bun view,
and wi/we/wo danced home anew.
🐇✨

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly summarizes the main change: expanded orthography options and four tu styles.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/orthography-options

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

📥 Commits

Reviewing files that changed from the base of the PR and between 0338210 and e35e1f2.

📒 Files selected for processing (3)
  • src/config.rs
  • src/kana.rs
  • src/settings_dialog.rs

Comment thread src/settings_dialog.rs Outdated
@mkpoli mkpoli force-pushed the feat/orthography-options branch from e35e1f2 to cbf7a2a Compare June 27, 2026 10:20
mkpoli added a commit that referenced this pull request Jun 27, 2026
…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)
mkpoli added 2 commits June 27, 2026 22:38
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)
@mkpoli mkpoli force-pushed the feat/orthography-options branch from 726f0b8 to dc32778 Compare June 27, 2026 13:39
@mkpoli mkpoli merged commit 35f2448 into master Jun 27, 2026
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.

1 participant