Skip to content

Add FLEx-compatible per-writing-system collation to FwLite#2406

Draft
hahn-kev wants to merge 3 commits into
developfrom
feature/writing-system-collation
Draft

Add FLEx-compatible per-writing-system collation to FwLite#2406
hahn-kev wants to merge 3 commits into
developfrom
feature/writing-system-collation

Conversation

@hahn-kev

@hahn-kev hahn-kev commented Jul 3, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Store per-writing-system collation imported from FLEx (IcuCollationRules, SystemCollationLocale) on WritingSystem, with EF migration and import-only sync from fwdata
  • Wire collation into LcmCrdt headword sort and SQLite per-WS collations via IWritingSystemCollatorProvider
  • Use managed ICU4N collators in LcmCrdt (not icu.net) so custom sort works on Android/MAUI; FwData bridge still uses icu.net
  • Seed the example project's German vernacular with &b < a &B < A demo ICU rules for manual testing

Test plan

  • dotnet test backend/FwLite/LcmCrdt.Tests --filter "FullyQualifiedName~WritingSystemCollatorProvider|FullyQualifiedName~CustomCollationSorting|FullyQualifiedName~CanCreateExampleProject"
  • dotnet test backend/FwLite/MiniLcm.Tests --filter "FullyQualifiedName~WritingSystemSync"
  • Create a new example project on Android — headwords should sort Banane, Beere, Apfel, ... without crash
  • Import an fwdata project with custom collation on Windows and verify headword order matches FLEx for simple tailoring rules

Notes

  • ICU4N is ICU 60 (alpha NuGet); icu.net/FLEx uses ICU 72 — locale-specific ordering (e.g. Czech ch) may differ slightly from FLEx
  • ICU4N.Resources adds ~18MB; consider SatelliteResourceLanguages on FwLiteMaui in a follow-up if APK size is a concern

hahn-kev and others added 3 commits July 2, 2026 11:43
Persist compiled ICU rules and system locale on WritingSystem, extract them when mapping fwdata, sync into the CRDT, and add an EF migration. Collation is import-only via the fwdata update proxy; fix collation cache poisoning during mid-migration schema upgrades.

Co-authored-by: Cursor <cursoragent@cursor.com>
Register ICU-backed collators in DI, initialize ICU in FwLiteWeb, and apply custom collation in SetupCollationInterceptor with Unicode tie-break sorting.

Co-authored-by: Cursor <cursoragent@cursor.com>
Replace icu.net/libpalaso collators in LcmCrdt with managed ICU4N adapters so custom writing-system collation works on Android. Seed the example project's German vernacular with reversed A/B ICU rules for manual testing.

Co-authored-by: Cursor <cursoragent@cursor.com>
@coderabbitai

coderabbitai Bot commented Jul 3, 2026

Copy link
Copy Markdown

Important

Review skipped

Draft detected.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: 9ca0744d-71a6-4d85-a31b-0697d1ace55c

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feature/writing-system-collation

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.

@github-actions github-actions Bot added the 💻 FW Lite issues related to the fw lite application, not miniLcm or crdt related label Jul 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

💻 FW Lite issues related to the fw lite application, not miniLcm or crdt related

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant