Repository navigation
Conversation
ComplexFormComponent gets read-time ComplexFormHomographNumber and ComponentHomographNumber fields. LcmCrdt computes them with linq2db from the referenced entries (EF ignores them, so no column or migration), FwData reads them from ILexEntry.HomographNumber. No change sets them and JSON skips the default 0, so Harmony snapshots don't carry them. CRDT's CreateComplexFormComponent now returns a linq2db read so its result has the numbers, as FwData's does. The editor badges render them with HomographNumber, and adding a link fills them optimistically from the picked entry. Generated TS types and the public OpenAPI schema are hand-edited (no .NET SDK in this environment); the sena-3 live snapshot fixture gains the six non-zero values. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AM78WBzrZB97vduoZFtHSr
Contributor
|
Important Draft PR not reviewedDraft PRs are not automatically reviewed by default.
To automatically review draft PRs, update your CodeRabbit configuration: reviews:
auto_review:
drafts: true
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. |
This was referenced Oct 31, 2026
Collaborator
Author
|
[Claude, autonomous] Combined into #2889 with #2883 and #2885. Generated by Claude Code |
5 of 6 tasks
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.
[Claude, autonomous]
Complex-form and component badges in the entry editor now show the linked entry's homograph number (bank₂), using the shared
HomographNumber.svelte. To support this,ComplexFormComponentgets two read-time fields,ComplexFormHomographNumberandComponentHomographNumber. They are filled on read and are never stored or synced. No change payload, no migration.Pre-Flight Check
ComplexFormComponent: adds the twointfields, and sets them inFromEntriesandCopy(). They are[JsonIgnore(WhenWritingDefault)], so the default 0 isn't written.LcmCrdtKernel: linq2db computes them withIsExpression(..., isColumn: true)from the existingQueryComponentEntry/QueryComplexFormEntryassociations (wrapped inCOALESCE(..., 0)), the same way the headwords are computed. EFIgnores them, so there's no column and the EF model snapshot doesn't change.AddEntryComponentChangedoesn't set them.CrdtComplexFormComponentApi.CreateComplexFormComponent: now returns the component from a new linq2db read,MiniLcmRepository.GetComplexFormComponent. The old EF read returned the stored headwords and 0 for the numbers. FwData already returned a live read. TheSubmit*/Move/Delete paths still use the EFFindComplexFormComponent.ToEntryReference/ToSenseReference: readHomographNumberfrom theILexEntry.EntrySync,CrdtFwdataProjectSyncService): not changed. Components are still keyed by GUIDs andReplaceignores everything else.JsonIgnore(WhenWritingDefault)is exported as optional (ForceNullable), because JS getsundefinedwhen the value is 0.Why
[MiniLcmInternal]isn't used[MiniLcmInternal]hides a member from the external JSON options. Those are the options JS interop uses (FwLiteJson), and the TS generator skips the member too. So the viewer would never see the fields.Why
JsonIgnore(WhenWritingDefault)Harmony snapshots, the sync
ProjectSnapshotand the regression fixtures all serialize this model. If a0were written for every component, the snapshot regression data, the migration fixtures and the sena-3 snapshots would all change. Leaving the 0 out means Harmony snapshots, where the fields are always 0, serialize exactly as before. Only aProjectSnapshottaken from live reads carries non-zero values. That's why thesena-3-live_snapshotfixture gains six lines.Why the headword strings were left unchanged
ComplexFormHeadwordis the sort key for complex forms (QueryHelpers.ComplexFormComparer,EntrySearchService), and FieldWorks sorts them alphabetically. A subscript would change that order.ComplexFormComponentHeadwords_UpdateWhenReferencedEntriesChange). FwData'sLexEntryHeadwordOrUnknownand CRDT'sQueryHeadwordWithTokensagree on plain headwords. Adding formatting in both would make that harder to keep true.HomographNumber.svelte,homographSubscript).Hand-edited generated files
There is no .NET SDK in the authoring environment, so these were edited by hand to match what the generators should produce.
task check-generated/fw-lite:has-stale-generated-typeson CI will confirm or correct them:frontend/viewer/.../MiniLcm/Models/IComplexFormComponent.ts:complexFormHomographNumber?: numberandcomponentHomographNumber?: number, in declaration order. They are optional because of theForceNullablerule above.backend/LexBoxApi/openapi/public.yaml: the two properties, copied fromEntry.homographNumber's int32 schema.FwLiteProjectSync.Tests/sena-3-live_snapshot.verified.txt: the six components whose linked entry has a non-zero homograph number, computed from the entries in the same file.Tests
ComplexFormComponentTestsBase(runs against CRDT and FwData):ComplexFormComponentHomographNumbers_ComeFromReferencedEntriescovers the create return value, both link directions, and a staleFromEntriesinput.ComplexFormComponentHomographNumbers_UpdateWhenAHomographIsAddedcovers promotion from 0 to 1.MiniLcm.Tests/Models/ComplexFormComponentTestscoversFromEntries,Copy()and JSON (0 is left out, other values round-trip).Id/MaybeId. Faker-built expectations go stale when the APIs renumber homographs: CRDT promotes 0 to 1, and FwData runsCorrectHomographNumbers. Without the exclusion, every faker-based entry comparison would need its own exclusion. This also coversSyncTests, so no per-testSyncTestsexclusion was added. The numbers are checked directly in the tests above.Test plan
vitest.config.ts, which this PR doesn't touch), vitest unit (281 passed), and i18n extract with noen.podriftfw-lite.yaml, dispatched by hand because this PR is stacked): build,ComplexFormComponentTests(CRDT + FwData),ComplexFormComponentTestsmodel tests,EntityCopyMethodTests, regression/Verified fixtures,Sena3SyncTests.LiveSena3Sync, stale generated typestask check-generated(OpenAPI drift)Not covered: the #2885 activity-header fallback and the diff-view badges read Harmony snapshots, which never carry these numbers. Where the current entry is available, the header already shows its homograph number through
Headwords.Generated by Claude Code