Implement homograph numbers and improve entry search/sort behavior#2220
Implement homograph numbers and improve entry search/sort behavior#2220myieye wants to merge 7 commits into
Conversation
|
Important Review skippedAuto incremental reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
📝 WalkthroughWalkthroughThis PR implements homograph number support to track and distinguish multiple entries sharing the same headword. It adds the Changes
Estimated code review effort🎯 4 (Complex) | ⏱️ ~50 minutes Possibly related PRs
Suggested labels
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 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 |
4246a62 to
2e82fa6
Compare
e3ec8c7 to
87c5dad
Compare
8d2c6c6 to
b95da37
Compare
|
The latest updates on your projects. Learn more about Argos notifications ↗︎
|
87c5dad to
8ed192f
Compare
aaf00bb to
0db4516
Compare
|
@coderabbitai full review |
✅ Actions performedFull review triggered. |
4be17e9 to
77a861f
Compare
8ed192f to
374b1b2
Compare
441aad1 to
08c9430
Compare
| ?? stemOrder.FirstOrDefault(); | ||
|
|
||
| var matchingEntries = await ( | ||
| from e in repo.Entries |
There was a problem hiding this comment.
Does this exclude the deleted entries?
There was a problem hiding this comment.
Yes. We mostly just read from Harmony's "projected tables" i.e. the clean relational ef-core database that Harmony projects its latest un-deleted snapshots to.
4028077 to
9683cf5
Compare
a08917b to
418b97c
Compare
418b97c to
54eb419
Compare
Add HomographNumber (int, 0 = unset) to the Entry model with full round-trip support through CRDT, FwData bridge, and sync. Key changes: - Entry model: add HomographNumber property with Copy() support - CreateEntryChange: persist HomographNumber in CRDT changes - CrdtMiniLcmApi: auto-assign homograph numbers on entry creation when HomographNumber is 0, respecting SecondaryOrder scoping. Updates existing lone entries from 0→1 when a second homograph appears. - FwDataMiniLcmApi: read HomographNumber from ILexEntry, set on create - UpdateEntryProxy: bidirectional HomographNumber sync to LibLCM - EntrySync: include HomographNumber in diff/patch operations - Sorting: uncomment HomographNumber in CRDT sort and search queries - Tests: uncomment sorting tests with HomographNumber, add auto- assignment tests, add sync test verifying LibLCM corrects numbers after entry deletion via two sync cycles https://claude.ai/code/session_01FJj2v135u6KdgVxoK4tRp2
Bumps SIL.LCModel to 11.0.0-beta0165 (depends on SIL.Core / SIL.WritingSystems 17.0.0). Replaces the previous deferral to LibLCM's auto-handling with an explicit call to ILexEntryRepository.CorrectHomographNumbers(entry) after assigning HomographNumber on create and update. This corrects out-of-range requests to current-max+1 and deduplicates collisions. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
ddb9afd to
db4738d
Compare
- Restore develop's sena-3-live.verified.sqlite (the rebase had taken the branch's older copy whose __EFMigrationsHistory referenced the pre-renumber MorphType migrations, causing LiveSena3Sync to fail with "table MorphType already exists"). - Add homographNumber to IEntry literals in 4 frontend files now that the field is required on the generated type. - Exclude HomographNumber from the FwData round-trip equivalence check in EntrySyncTests.CanSyncRandomEntries (a randomly faked value can't survive ILexEntryRepository.CorrectHomographNumbers renumbering). Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
The branch's copy was regenerated against an older fwdata/CRDT baseline (different entry GUIDs and content) and is unrelated to the homograph work. Restoring develop's version produces a clean diff for the final regeneration: only the new "HomographNumber":n field appearing on each entry. Accept the resulting .received.txt in the IDE to land the final snapshot. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Both the live CRDT sqlite and the fw-headless snapshot need to advance together (they encode the same post-sync state). Sync added the previously CRDT-absent entries with fresh CRDT GUIDs and surfaced HomographNumber across every entry; LiveSena3Sync passes locally with these accepted. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Pulls the existing CRDT and FwData homograph-number tests out of their respective CreateEntryTests.cs into HomographNumberTests.cs alongside new update-side coverage: - CRDT: respects explicit HomographNumber on both create and update - FwData: corrects out-of-range and dedups duplicates on both create and update (the renumber tie-breaks by DateCreated then Guid, so the update tests mutate the newest entry to keep the outcome intuitive) Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Summary
This PR adds homograph numbers to MiniLcm. Homograph numbers are now respected when sorting.
Homograph-number assignment
HomographNumberon create and update, the bridge callsILexEntryRepository.CorrectHomographNumbers(entry). This corrects out-of-range requests tocurrent-max + 1and deduplicates collisions by renumbering on(HomographNumber, DateCreated, Guid).Two FwData tests cover the new correction behavior:
CreateEntry_HomographNumberOutOfRange_IsClampedToMaxPlusOneandCreateEntry_DuplicateHomographNumber_IsDeduplicated.Bumps
SIL.LCModelto11.0.0-beta0165for the newILexEntryRepository.CorrectHomographNumbersAPI (formerly considered forILexEntry; landed on the repository instead).