Skip to content

LT-22333: Click on Preview pane and go to field - #818

Merged
jtmaxwell3 merged 12 commits into
mainfrom
LT-22333
Apr 16, 2026
Merged

LT-22333: Click on Preview pane and go to field#818
jtmaxwell3 merged 12 commits into
mainfrom
LT-22333

Conversation

@jtmaxwell3

@jtmaxwell3jtmaxwell3 commented Apr 7, 2026

Copy link
Copy Markdown
Collaborator

This fixes https://jira.sil.org/browse/LT-22333.

This code attempts to map Preview data elements to corresponding slices. There are three parts:

  1. settings.ConfigSource records the GUID of the source ICmObject of each preview config. This gets written out to the GeckoElements along with the field description.
  2. JumpToFieldAt extracts the nearest object and field from the selected GeckoElement and calls JumpToField with the object, field, and field value. It calls JumpToRecord first if the object and field belongs to a lex entry that is different from the current lex entry.
  3. JumpToField tries to find the corresponding slice. It first looks for a slice that matches the object and field. Failing that, it looks for a slice that matches the object and/or the value.

This change is Reviewable

@github-actions

github-actionsBot commented Apr 7, 2026

Copy link
Copy Markdown

NUnit Tests

1 files ±0 1 suites ±0 6m 15s ⏱️ -1s
4 103 tests +5 4 032 ✅ +5 71 💤 ±0 0 ❌ ±0 
4 112 runs +5 4 041 ✅ +5 71 💤 ±0 0 ❌ ±0 

Results for commit 6173a84. ± Comparison against base commit 7ef7052.

♻️ This comment has been updated with latest results.

@jasonleenaylor

Copy link
Copy Markdown
Contributor

Src/xWorks/ConfiguredLcmGenerator.cs line 3519 at r1 (raw file):

 public ILcmContentGeneratorContentGenerator=newLcmXhtmlGenerator();
public ILcmStylesGeneratorStylesGenerator=newCssGenerator();
public Dictionary<ConfigurableDictionaryNode, Guid>ConfigSource=newDictionary<ConfigurableDictionaryNode, Guid>();

I think this needs to be a ConcurrentDictionary for thread safety.

@mark-silmark-sil left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@mark-sil reviewed 7 files and all commit messages, and made 4 comments.
Reviewable status: 7 of 10 files reviewed, 4 unresolved discussions (waiting on jasonleenaylor and jtmaxwell3).


Src/Utilities/AlloVarGen/AlloGenService/AlloGenServiceTests/TestData/Quechua MYL CausDeriv.fwdata.lock line 1 at r1 (raw file):

{"__type":"FileLockContent:#Palaso.IO.FileLock","PID":6816,"ProcessName":"testhost.net48","Timestamp":639111542518543262}

This probably shouldn't be checked in.


Src/xWorks/XhtmlDocView.cs line 692 at r1 (raw file):

 {
#pragma warning disable 618// suppress obsolete warning
mediator.SendMessage("JumpToRecord", fieldLexEntry.Hvo);

This can be done through the Pub/Sub system instead of calling SendMessage(). Since SendMessage() executes immediately, you can have new code use Pub/Sub and old code still using the SendMessage() calls.


Src/xWorks/XhtmlDocView.cs line 703 at r1 (raw file):

Publisher.Publish(newPublisherParameterObject(EventConstants.JumpToField, arguments));
}
Application.Idle+=JumpToField;

Probably should talk to Jason about the best way to handle this. In general, I think we are trying to reduce our use of Idle.


Src/xWorks/xWorks.csproj line 98 at r1 (raw file):

 <EmbeddedResourceInclude="Resources\Texts 32.ico" />
<EmbeddedResourceInclude="Resources\Words 32.ico" />
</ItemGroup>

Are the changes in this file intentional?

@jtmaxwell3

Copy link
Copy Markdown
CollaboratorAuthor
  1. I replaced Dictionary with ConcurrentDictionary.
  2. I deleted the lock file
  3. There are a lot of calls to mediator.SendMessage("JumpToRecord", ... ). I think that they should all be fixed together, but I don't think that it should be part of this change.
  4. I will ask Jason about alternatives to Application.Idle.
  5. The changes to xWorks.csproj were needed to get the resx resource to recompile automatically.

@jasonleenaylor

Copy link
Copy Markdown
Contributor

Src/xWorks/XhtmlDocView.cs line 703 at r1 (raw file):

Previously, mark-sil (Mark Kidder) wrote…

Probably should talk to Jason about the best way to handle this. In general, I think we are trying to reduce our use of Idle.

We do want to avoid OnIdle, if the JumpToRecord goes through the Pub/Sub is the delay still necessary? Does it not work until the record has rendered?

@jtmaxwell3

Copy link
Copy Markdown
CollaboratorAuthor

@jasonleenaylor: mediator.SendMessage("JumpToRecord", fieldLexEntry.Hvo) invokes JumpToRecord right away, so using Pub/Sub wouldn't solve the problem.

@mark-silmark-sil left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@mark-sil reviewed 3 files and all commit messages, and made 1 comment.
Reviewable status: 9 of 10 files reviewed, 4 unresolved discussions (waiting on jasonleenaylor and jtmaxwell3).


Src/xWorks/XhtmlDocView.cs line 692 at r1 (raw file):

Previously, mark-sil (Mark Kidder) wrote…

This can be done through the Pub/Sub system instead of calling SendMessage(). Since SendMessage() executes immediately, you can have new code use Pub/Sub and old code still using the SendMessage() calls.

Sounds good, I agree with your comment #3 in the 'Top Level Discussions' section.

Instead of using Application.Idle to execute JumpToField, use
Publisher.PublishAtEndOfAction.
Note: As more events start using PublishAtEndOfAction, the events
will be executed in a defined order. Currently EndOfAction uses
Idle to execute events, but may use a different way to determine
‘EndOfAction’ in the future.

@mark-silmark-sil left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@mark-sil reviewed 2 files and all commit messages, and resolved 1 discussion.
Reviewable status: all files reviewed, 3 unresolved discussions (waiting on jtmaxwell3).

@jasonleenaylorjasonleenaylor left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:lgtm:

@jasonleenaylor reviewed 11 files and all commit messages, and made 1 comment.
Reviewable status: all files reviewed, 3 unresolved discussions (waiting on jtmaxwell3).

@jtmaxwell3jtmaxwell3 left a comment

Copy link
Copy Markdown
CollaboratorAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jtmaxwell3 made 3 comments.
Reviewable status: all files reviewed, 3 unresolved discussions (waiting on mark-sil).


Src/xWorks/XhtmlDocView.cs line 692 at r1 (raw file):

Previously, mark-sil (Mark Kidder) wrote…

Sounds good, I agree with your comment #3 in the 'Top Level Discussions' section.

Done.


Src/xWorks/xWorks.csproj line 98 at r1 (raw file):

Previously, mark-sil (Mark Kidder) wrote…

Are the changes in this file intentional?

Done.


Src/Utilities/AlloVarGen/AlloGenService/AlloGenServiceTests/TestData/Quechua MYL CausDeriv.fwdata.lock line 1 at r1 (raw file):

Previously, mark-sil (Mark Kidder) wrote…

This probably shouldn't be checked in.

Done.

@mark-silmark-sil left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@mark-sil resolved 3 discussions.
Reviewable status: :shipit: complete! all files reviewed, all discussions resolved (waiting on jtmaxwell3).

@jtmaxwell3
jtmaxwell3 merged commit 8424e85 into mainApr 16, 2026
7 checks passed
@jtmaxwell3
jtmaxwell3 deleted the LT-22333 branch April 16, 2026 20:34
Sign up for freeto 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

@jtmaxwell3@jasonleenaylor@mark-sil