Repository navigation
LT-22679: Send Copy and Paste to the Sandbox in Analyze - #1258
Merged
Merged
Conversation
In Texts > Analyze, Edit > Copy, Edit > Paste, Ctrl+C and Ctrl+V often acted on the interlinear text instead of the word gloss being edited. Copy put the wrong text on the clipboard, and the menu items were grayed out depending on the text's selection. The main window sends these commands to the view ActiveViewHelper reports. InterlinDocForAnalysis.OnGotFocus moved focus into the focus box before raising its own GotFocus, so the Sandbox was recorded first and then overwritten by the text, which no longer had focus. The same late call also re-activated the text's selection and keyboard. Raise GotFocus before handing focus on, as BrowseViewer and ConstituentChart already do. The new test hosts a real Sandbox in a shown form and checks ActiveViewHelper reports it after the text is focused. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #1258 +/- ##
==========================================
+ Coverage 40.34% 40.48% +0.14%
==========================================
Files 1597 1598 +1
Lines 360082 360584 +502
Branches 42148 42191 +43
==========================================
+ Hits 145282 145995 +713
+ Misses 185121 184924 -197
+ Partials 29679 29665 -14
🚀 New features to boost your workflow:
|
The order now matches BrowseViewer and ConstituentChart, and the regression test pins it, so the comment adds nothing. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
thejambi
marked this pull request as ready for review
November 23, 2026 23:56
6 of 14 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.
In Texts > Analyze, Edit > Copy, Edit > Paste, Ctrl+C and Ctrl+V now act on the Word Gloss (or other field) being edited in the focus box. Until now they often acted on the interlinear text behind it instead: Copy put the wrong text on the clipboard, and the menu items were grayed out or enabled depending on what was selected in the text rather than in the gloss.
Reviewer notes
Root cause.
FwXWindowsends Copy and Paste to the root siteActiveViewHelperreports, andActiveViewHelperrecords whichever root site raised GotFocus last.InterlinDocForAnalysis.OnGotFocusmoved focus into the focus box before callingbase.OnGotFocus. The Sandbox raised GotFocus first and was recorded; then the text's own GotFocus ran late and overwrote it, although the text no longer had focus. That lateSimpleRootSite.OnGotFocusalso pointed the global focused root site, the selection activation and the keyboard at the text.Fix. Call
base.OnGotFocusfirst, then hand focus to the focus box, the orderBrowseViewerandConstituentChartalready use.InterlinDocForAnalysiswas the onlyOnGotFocusoverride that handed focus on before raising its own.Deliberate rules.
ActiveViewHelper.ViewGotFocusignore a sender that no longer has focus. It would cover any other view with the same ordering, but it changes code every main window shares and would leave the global focused root site and keyboard on the text.Tests. New
FocusBoxControllerTests.OnGotFocus_FocusBoxInstalled_SandboxIsActiveViewshows a form holding an interlinear text with a realSandbox(not a mock) and anActiveViewHelper, focuses another control, then focuses the text and expects the Sandbox to be reported. It failed before the fix (reported the text) and passes after. It needs real window focus; on a runner without an interactive desktop itsAssumemakes it inconclusive rather than failing. The test focus box owns its own Mediator and PropertyTable because the Sandbox writes to them while being disposed, after the text has disposed its own. The IText, RootSites and Discourse test sets pass (661 passed, 2 skipped, both already marked to skip).Manual tests (done). In FLEx, Texts > Analyze: selected a word's Word Gloss, copied it with Ctrl+C and with Edit > Copy, clicked another word, and pasted into its gloss with Ctrl+V and with Edit > Paste. The gloss text was pasted each time, the Edit menu items were enabled while the gloss had a selection, and the clipboard held the gloss rather than text from the interlinear view. Repeated across several words.
🤖 Generated with Claude Code
This change is