Add Tools > Apply Motif changes - #1162
Open
johnml1135 wants to merge 2 commits into
Open
johnml1135 wants to merge 2 commits into
johnml1135 wants to merge 2 commits into
Conversation
Co-Authored-By: GPT-6 Luna <noreply@openai.com>
Run Motif at the save boundary and restore the cache according to its result. Co-Authored-By: GPT-6 Luna <noreply@openai.com>
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #1162 +/- ##
==========================================
+ Coverage 39.02% 39.03% +0.01%
==========================================
Files 1522 1525 +3
Lines 352937 353227 +290
Branches 40726 40779 +53
==========================================
+ Hits 137741 137898 +157
- Misses 185893 185997 +104
- Partials 29303 29332 +29
🚀 New features to boost your workflow:
|
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.
Linguists can review parser results in Motif, a separate tool for checking a project's analyses. Motif lets them approve or disapprove analyses and add new ones. Until now, the only way to get those decisions back into the FieldWorks project was to close FieldWorks and run Motif against the project.
This adds Tools > Apply Motif changes…. It is available in every area, like Send/Receive. FieldWorks asks for confirmation, saves the project, and releases its lock. It then runs Motif once, the same way it runs FLEx Bridge:
What happens next depends on Motif's result:
If relocking fails, FieldWorks reloads instead, so it never keeps editing a project that Motif may have written to. A wait cursor shows while Motif runs.
Finding Motif.
MOTIF_DIRenvironment variable, a folder containingmotif.exe.InstallationDirunderHKLM\SOFTWARE\SIL\Motif, in both registry views, which Motif's installer writes.FieldWorks never searches
PATHand writes nothing to the registry. If Motif is not installed, the command says so. The lookup is cached, so the menu doesn't query the registry on every idle update.FieldWorks references nothing of Motif's. It reads the exit code and a few stable JSON fields,
ok,applied,summaryandcode, and ignores anything else, so Motif can extend its output without breaking FieldWorks. There is no Undo for applied changes. The confirmation doesn't promise one.Code.
MotifExecutableResolverandMotifApplyRunnerare in FwUtils. Discovery and the process are injected.MotifApplyWorkflowholds the save, run, and reload-or-relock decisions, plus message selection.FLExBridgeListenerwires the command, reusing FLEx Bridge's save, unlock and reopen steps.LexEdStrings.resx, with translator comments.Tests. They need no Motif installation. FwUtilsTests cover discovery (environment variable, registry, not found), argument quoting, and every exit code and JSON case: malformed, missing, unknown fields, and a single invocation on exit 4. A real-process test drains more than 64 KB from both output streams. LexEdDllTests cover the save and unlock order, reload versus relock for each outcome, a relock that throws, reload failure, message selection, and the menu configuration.
The matching Motif change, which releases
apply --all-pendingand gives the result an exit code, is in Motif's repository. It will be available before this is used outside development.🤖 Generated with Claude Code
This change is