This fixes LT-22616: Word Cat contents change when bundle selected#1007
This fixes LT-22616: Word Cat contents change when bundle selected#1007jtmaxwell3 wants to merge 3 commits into
Conversation
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #1007 +/- ##
==========================================
+ Coverage 32.96% 33.03% +0.07%
==========================================
Files 1202 1202
Lines 278291 278272 -19
Branches 37166 37177 +11
==========================================
+ Hits 91733 91929 +196
+ Misses 158688 158491 -197
+ Partials 27870 27852 -18
🚀 New features to boost your workflow:
|
|
If a user has manually chosen a word gloss and word category will this overwrite them when they choose a different msa? I'm not sure that is desired if that is the case. |
|
@jasonleenaylor CopyLexEntryInfoToMonomorphemicWordGlossAndPos is poorly named because it only does the copy if the word gloss and/or category don't already exist. It should be something like GuessWordGlossAndPos. |
|
For clear developer understanding of this statement a comment would be good. With domain knowledge in mind I think this is probably correct, but just reading the code I would wonder "What if we have a derivedPOS and no stemPOS, shouldn't we just return the derived?" |
jasonleenaylor
left a comment
There was a problem hiding this comment.
I had one small comment request otherwise this change seems sound to me.
We want to make sure this is really hitting the felt user need of consistency between the focus box and the other sandbox views.
It seems like it does that, hopefully this will be an acceptable way.
@jasonleenaylor reviewed 3 files and all commit messages, and made 1 comment.
Reviewable status:complete! all files reviewed, all discussions resolved (waiting on jtmaxwell3).
jtmaxwell3
left a comment
There was a problem hiding this comment.
@jtmaxwell3 made 2 comments.
Reviewable status:complete! all files reviewed, all discussions resolved (waiting on jtmaxwell3).
Src/LexText/Interlinear/InterlinVc.cs line 2402 at r2 (raw file):
Previously, jasonleenaylor (Jason Naylor) wrote…
For clear developer understanding of this statement a comment would be good. With domain knowledge in mind I think this is probably correct, but just reading the code I would wonder "What if we have a derivedPOS and no stemPOS, shouldn't we just return the derived?"
I didn't write this code, I just moved it. I don't feel comfortable adding a comment about what it is supposed to do.
Src/LexText/Interlinear/SandboxBase.cs line 4264 at r1 (raw file):
Previously, jasonleenaylor (Jason Naylor) wrote…
If a user has manually chosen a word gloss and word category will this overwrite them when they choose a different msa? I'm not sure that is desired if that is the case.
I renamed the function to make it clear that it doesn't overwrite the word gloss and word category.
|
Code quote: // This is modeled after SandboxBase.SyncMonomorphemicGlossAndPos. |
This fixes https://jira.sil.org/browse/LT-22616. The root problem was that SandboxBase and InterlinVc were making different guesses about the word cat and gloss, which confused the user. The general principle is that when you first click on a word in the interlinear text, the sandbox should show whatever was showing in the interlinear text. The word cat and gloss should only change after the user makes a change to the sandbox.
I also added code to guess the word gloss and category whenever the morphemes change.
This change is
Devin's analysis:
The interlinear display (InterlinVc) and the editing sandbox (SandboxBase) had independent implementations for guessing word glosses and parts of speech from morph bundles. This caused inconsistencies—the display could show one guess while the sandbox applied a different one.
This PR:
Extracts the private guess methods from an inner class of InterlinVc into internal static methods at the InterlinVc class level, returning richer types (ILexSense, IPartOfSpeech) instead of just display strings.
Adds SandboxBase.GuessWordCatAndGloss which delegates to those same InterlinVc methods, ensuring consistent guesses.
Renames CopyLexEntryInfoToMonomorphemicWordGlossAndPos → CopyLexEntryInfoToWordGlossAndPosIfEmpty and adjusts CopySenseToWordGloss to accept a real HVO directly.
After morpheme updates in HandleSelectMorphComboItem, calls CopyLexEntryInfoToWordGlossAndPosIfEmpty to refresh guesses.