feat: alphabet index integration — locale-follow default + picker metadata - #31
Merged
Conversation
…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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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
aron a cold start selects Arabic (WorldAlphabets), loads, and renders.Picker metadata
Script name + RTL marker under each alphabet in the status-bar dropdown (
DropdownPickergains anoptionMetahook).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.