Skip to content

feat: alphabet index integration — locale-follow default + picker metadata - #31

Merged
willwade merged 5 commits into
mainfrom
feat/alphabet-index
Aug 30, 2026
Merged

feat: alphabet index integration — locale-follow default + picker metadata#31
willwade merged 5 commits into
mainfrom
feat/alphabet-index

Conversation

@willwade

Copy link
Copy Markdown
Contributor

Consumes the generated alphabet_index.json (DasherCore, bundled via the Data assets).

Locale-follow default (the NB from the index discussion)

While the user hasn't explicitly picked an alphabet, the engine starts on the best match for the device/app locale: exact lang code → lang+script → language prefix, preferring maintained > WorldAlphabets > legacy, fuller alphabets within a tier. First explicit pick pins the choice; Settings → Reset re-enables following. Uses the activity's own resources so per-app locales (Android 13+) are respected — Resources.getSystem() silently ignores them.

Emulator-verified end to end: per-app locale ar on a cold start selects Arabic (WorldAlphabets), loads, and renders.

Picker metadata

Script name + RTL marker under each alphabet in the status-bar dropdown (DropdownPicker gains an optionMeta hook).

Crash fixes surfaced (in DasherCore #68, this PR's submodule pin)

Auto-selecting Arabic was the first code path to hit two pre-existing crash bugs: 132 shipped alphabet files contain duplicate symbols, and digraph-output symbols violate the single-codepoint assumption — selecting any of them from the menu SIGABRTed every v6 build to date. Fixed in DasherCore feat/lazy-alphabets; this PR pins the submodule there (9d8d158).

Degradation

Missing/unreadable index → empty list → no locale-follow, no badges; the engine (its own name scan) and the app keep working.

Stacked on DasherCore #68 — merge that first.

DCO signed.

…adata

Consumes the generated alphabet_index.json (DasherCore, bundled via the
Data assets):

- AlphabetIndex: loader (extracted file, asset fallback, empty-index
  degradation — the engine's own name scan is independent) plus
  suggestForLocale(): exact lang code → lang+script → language prefix,
  preferring maintained > worldalphabets > legacy and fuller alphabets.
- Locale-follow default: while the user hasn't explicitly picked an
  alphabet, the engine starts on the best match for the device/app
  locale. First explicit pick (or any menu selection) pins the choice;
  Settings reset re-enables following. Uses the activity's own
  resources so per-app locales (Android 13+) are respected.
- Picker badges: script name and RTL marker under each alphabet in the
  status-bar dropdown (DropdownPicker gains an optionMeta hook).

Emulator-verified end to end: per-app locale ar on a cold start selects
Arabic (WorldAlphabets), which loads and renders — this also exercised
DasherCore's duplicate-symbol and digraph tolerance fixes (the Arabic
alphabet previously SIGABRTed the app on selection; 132 shipped files
carry such data).

Stacked on DasherCore feat/lazy-alphabets (submodule at 9d8d158).

Signed-off-by: will wade <willwade@gmail.com>
With lazy alphabets (DasherCore #68), measured warm start reaches the
canvas in <1s on the emulator (engine realize ~450-650ms of which
alphabets are now 65-150ms) — the loader was flashing on every start
for a wait most of which is process + Compose startup that looks the
same either way.

The spinner now only appears if the wait exceeds 300ms (RFC 0018's
flash-avoidance rule): warm starts never show it; first launches keep
full coverage over the ~2-3s asset extraction (removing it there would
resurrect the black-screen report that prompted it).

Emulator-verified: warm — canvas at 600ms, no loader; cold — system
splash (0-1.5s) → loader (2.5s, extraction in flight) → canvas (~4s).
GTK needs no loader: window maps in 0.2-1.0s cold or warm with the
lazy-alphabet engine.

Signed-off-by: will wade <willwade@gmail.com>
Pins the stacked submodule to the commit addressing the lazy-scanner
review findings: entity-encoded names decoded (42 shipped files),
single-quoted attributes, no prefix window.

Signed-off-by: will wade <willwade@gmail.com>
…ldAlphabets variants

The suggestion scored candidates as tier * 1,000,000 + chars, so
worldalphabets (tier 1) always beat maintained (tier 0): every locale
followed onto an autoconverted WA alphabet. For en-locale devices that
selected 'English (WorldAlphabets)', whose tree barely expands (a
pre-existing engine bug in the WA corpus, reproduced on pre-lazy main)
— the canvas rendered flat, letters with no visible weighting.

Ranking is now tier-ascending (maintained > worldalphabets > legacy),
with the engine's historical default ('English with limited
punctuation') preferred within its tier, then fuller alphabets. Verified
on emulator: fresh install, en locale → back to 'English with limited
punctuation' with a weighted canvas.

suggestForLocale split into a pure suggestFrom(list, tag) with unit
tests pinning the ranking (maintained-beats-WA, engine-default-first,
legacy fallback, unknown-locale null).

Signed-off-by: will wade <willwade@gmail.com>
Signed-off-by: will wade <willwade@gmail.com>
@willwade
willwade merged commit 2e3c9e2 into main Aug 30, 2026
2 checks passed
@willwade
willwade deleted the feat/alphabet-index branch August 30, 2026 09:23
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