Skip to content

This fixes LT-22616: Word Cat contents change when bundle selected#1007

Open
jtmaxwell3 wants to merge 2 commits into
mainfrom
LT-22616
Open

This fixes LT-22616: Word Cat contents change when bundle selected#1007
jtmaxwell3 wants to merge 2 commits into
mainfrom
LT-22616

Conversation

@jtmaxwell3

@jtmaxwell3 jtmaxwell3 commented Jul 13, 2026

Copy link
Copy Markdown
Collaborator

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 Reviewable

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.

@github-actions

github-actions Bot commented Jul 13, 2026

Copy link
Copy Markdown

NUnit Tests

    1 files  ±0      1 suites  ±0   10m 39s ⏱️ + 2m 29s
4 302 tests ±0  4 229 ✅ +38  73 💤 ±0  0 ❌  - 38 
4 311 runs  ±0  4 238 ✅ +38  73 💤 ±0  0 ❌  - 38 

Results for commit c8657d2. ± Comparison against base commit dda17ab.

♻️ This comment has been updated with latest results.

@codecov-commenter

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 16.66667% with 5 lines in your changes missing coverage. Please review.
✅ Project coverage is 32.96%. Comparing base (d4e14ac) to head (66112c7).
⚠️ Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
Src/LexText/Interlinear/SandboxBase.cs 16.66% 4 Missing and 1 partial ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##             main    #1007   +/-   ##
=======================================
  Coverage   32.96%   32.96%           
=======================================
  Files        1202     1202           
  Lines      278291   278295    +4     
  Branches    37166    37167    +1     
=======================================
+ Hits        91733    91743   +10     
+ Misses     158688   158677   -11     
- Partials    27870    27875    +5     
Files with missing lines Coverage Δ
Src/LexText/Interlinear/SandboxBase.cs 35.53% <16.66%> (-1.18%) ⬇️

... and 8 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@jasonleenaylor

Copy link
Copy Markdown
Contributor

Src/LexText/Interlinear/SandboxBase.cs line 4264 at r1 (raw file):

			{
				m_editMonitor.DoPendingMorphemeUpdates();
				CopyLexEntryInfoToMonomorphemicWordGlossAndPos(true);

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.

@jtmaxwell3

Copy link
Copy Markdown
Collaborator Author

@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.

@jtmaxwell3
jtmaxwell3 marked this pull request as draft July 15, 2026 16:56
@jtmaxwell3
jtmaxwell3 marked this pull request as ready for review July 15, 2026 20:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants