Repository navigation
Delete unused context menus, commands and layouts - #1199
Merged
Merged
Conversation
FieldWorks no longer defines the 23 context menus that no layout part or code names, or the 20 commands that no remaining menu, toolbar, shortcut or code names. Until now they sat in the area configuration files. The Avalonia menu authority counted 11 of those menus as owned, though no row could show them. The code that only the deleted commands reached is gone too: the rule that offered Insert Stem or Insert Affix Allomorph by the entry's first allomorph. Deleted menus and commands: * mnuDataTree-Allomorphs, with CmdDataTree-Insert-StemAllomorph and CmdDataTree-Insert-AffixAllomorph * mnuDataTree-Allomorphs-Hotlinks * mnuDataTree-DeleteEtymology * mnuDataTree-DeletePronunciation * mnuDataTree-Example-ForNotes * mnuDataTree-MSA, with CmdDataTree-Merge-MSA and CmdDataTree-Delete-MSA * mnuDataTree-MSAs, with CmdDataTree-Insert-StemMsa, CmdDataTree-Insert-InflectionAffixMsa, CmdDataTree-Insert-DerivationAffixMsa and CmdDataTree-Insert-UnclassifiedAffixMsa * mnuDataTree-Senses * mnuDataTree-SubEntryLink, with CmdDataTree-Insert-SubEntryLink * mnuDataTree-Translations * mnuDataTree-Variant * mnuDataTree-Variants, with CmdDataTree-Insert-Variant * mnuDataTree-DeleteCustomItem, with CmdDataTree-Delete-CustomItem * mnuDataTree-SubAnnotationDefn, with CmdDataTree-Insert-AnnotationDefn * mnuDataTree-SubCustomItem * mnuDataTree-SubMorphType, with CmdDataTree-Insert-MorphType * mnuDataTree-CompoundRule-LinkerAffixAllomorph, with CmdDataTree-Create-CompoundRule-LinkerAffixAllomorph and CmdDataTree-Delete-CompoundRule-LinkerAffixAllomorph * mnuInflAffixTemplate-Help * mnuIText-FreeTrans, with CmdDeleteFreeTrans * mnuIText-LitTrans, with CmdDeleteLitTrans * mnuIText-Note, with CmdDeleteNote * PaneBar-ShowHiddenFields-scrNoteTypesEdit (no such tool exists) * PaneBar-ShowHiddenFields-weatherConditionEdit (no such tool exists) * CmdDataTree-Create-LexemeForm-StemAllomorph and CmdDataTree-Create-LexemeForm-AffixAllomorph (in no menu; the allomorph rule was their only gate) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
FieldWorks no longer keeps command definitions that exist only inside XML comments, or layouts, parts and menus that no screen displays. Until now one live menu item named a commented-out command, which would throw ConfigurationException if its menu were ever built; no shipped layout shows the rows that carry that menu. The commented-out include directives from 2012 and 2013 are gone too. With no such item left, the test that walks every context menu now fails on any item naming a missing command. Deleted: * CmdHelpCheckForUpdates, CmdInsertBoundaryMarker and CmdToggleRawAndInterlinear, with their commented-out menu and toolbar items * CmdWordformSpellingStatusUnknown, CmdWordformSpellingStatusGood and CmdWordformSpellingStatusDisapprove, with the commented-out mnuDataTree-WordformSpellingStatus submenu * CmdDataTree-Insert-FeatureStructure-ClosedFeature, CmdDataTree-Insert-FeatureStructure-ComplexFeature, CmdDataTree-Delete-FeatureStructure-Feature and CmdDataTree-Delete-FeatureStructure-ComplexFeature * mnuDataTree-FeatureStructure-Feature (its one item named the commented-out CmdDataTree-Delete-FeatureStructure-Feature) * mnuDataTree-FeatureStructure-Features (every item commented out) * FsFeatStruc detail layouts FeatureSpecs, MsFeatures, MsEnvFeatures, FromMsFeatures, ToMsFeatures, InflFeats, NestedInflFeats and EditFeatureSpecs * EditFeatureSpec layouts for FsFeatureSpecification, FsClosedValue and FsComplexValue * FsFeatStruc-Detail-FeatureSpecs * FsFeatureSpecification-Detail-Feature, FsFeatureSpecification-Detail-FeatureSpecs and FsFeatureSpecification-Jt-FeatureSummary * FsClosedValue-Detail-Feature, FsClosedValue-Detail-Value, FsClosedValue-Detail-FeatureSpecs and FsClosedValue-Jt-FeatureSummary * FsComplexValue-Detail-Feature, FsComplexValue-Detail-Value, FsComplexValue-Detail-FeatureSpecs and FsComplexValue-Jt-FeatureSummary * LexReference layout ShowSingleReference (its part never existed) * MoInflClass layout SubClasses (nothing used it) * The Role part ref in CmPerson's default layout (CmPerson has no Role field) * The ContextHelp.xml entry for CmdToggleRawAndInterlinear Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
FieldWorks no longer defines commands that nothing can run, either because no menu, toolbar or code names them or because no handler answers them, and no longer keeps the message handlers and strings that only those commands reached. Until now they sat in the area configuration files; File > Page Setup... showed but was always disabled, and five shortcuts did nothing because no handler existed. The commented-out menu items that named them are gone too. MorphologyListener.OnAnalysisApprove, which only the User Opinion submenu's Approve still calls, becomes the private ApproveAnalysis; mnuDataTree-Pronunciation loses the trailing separator that preceded its commented-out Writing Systems item; and the every-menu test now also fails on a main-menu or toolbar item naming a missing command. Deleted: * CmdBundleUp, CmdBundleDown, CmdBundleUpNc and CmdBundleDownNc (shortcut, no handler) * CmdShowMorphology (Ctrl+M, no handler) * CmdPrevIncompleteBundle (no handler) * CmdParse (no handler; its item in the Interlinear Texts Data menu was hidden and never enabled) * CmdPageSetup (no handler since Translation Editor's was removed in 2015; File > Page Setup... was always disabled), with its ContextHelp.xml entry * CmdMainObjectProperties (no handler), with the commented-out File > Properties submenu and its ContextHelp.xml entry * CmdDataTree-Pronunciation-WritingSystems (no handler) * CmdDataTree-Delete, CmdDataTree-Insert-Entry-Sense, CmdDataTree-Insert-ReversalSubPOS, CmdDataTree-MoveUp-Sense-Symbol and CmdDataTree-MoveDown-Sense-Symbol * CmdAnalysisApprove, with MorphologyListener.OnDisplayAnalysisApprove and the commented-out mnuDataTree-ParserProducedAnalysis-Hotlinks and mnuDataTree-HumanDisapprovedAnalysis-Hotlinks menus * CmdDataTree-Merge-MainWordform, with MorphologyListener.OnMergeWordform, MorphologyListener.OnDisplayMergeWordform and MEStrings ksCannotMergeWordformsYet * CmdWordformEditForm, with MorphologyListener.OnWordformEditForm, MorphologyListener.OnDisplayWordformEditForm and MEStrings ksTodo_WordformEditing * CmdWordformChangeCase, with MorphologyListener.OnWordformChangeCase and MorphologyListener.OnDisplayWordformChangeCase * CmdListColleagues, with Ticker.OnListColleagues * CmdStartLogging, with FwXWindow.OnStartLogging * CmdSynch, with LexTextApp.OnSynchronize * The SpellingStatus handlers under #if NOTYET in MorphologyListener, left from the commands the previous commit removed Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #1199 +/- ##
==========================================
+ Coverage 39.77% 39.88% +0.11%
==========================================
Files 1544 1542 -2
Lines 355185 355307 +122
Branches 41276 41315 +39
==========================================
+ Hits 141268 141726 +458
+ Misses 184552 184224 -328
+ Partials 29365 29357 -8
🚀 New features to boost your workflow:
|
NUnit Tests 1 files ±0 1 suites ±0 14m 27s ⏱️ + 5m 53s Results for commit dd7ea7f. ± Comparison against base commit d0d85cb. This pull request removes 3 and adds 5 tests. Note that renamed tests count towards both.♻️ This comment has been updated with latest results. |
Shipped menu, toolbar and layout references now have their own test fixture, which also fails when a layout part's menu or hotlinks attribute names a context menu the window configuration does not define. Until now the whole-configuration command check sat inside the Avalonia context-menu parity test, and nothing checked the layouts' menu references. Changed: * EveryCommandReference_NamesADefinedCommand, moved into the new WindowConfigurationIntegrityTests out of ResolveMenu_ReadsWhatChoiceGroupPopulates_ForEveryContextMenuId * EveryLayoutMenuReference_NamesADefinedMenu (new, same fixture) * ShippedLayouts_UnresolvedParts_AreExactlyTheRefsWithNoConfigurationPart, renamed from ShippedLayouts_UnresolvedParts_AreExactlyTheLegacyUnresolvableSet * IsOfferedOnEntry_AnyOtherInsert_OnAnyEntry no longer adds an allomorph the rule ignores * DetailObjectInsertion.IsOfferedOnEntry: its summary now says a null or invalid entry offers nothing * LexEntryMenuHandler.OnDisplayDataTreeInsert compares the AffixProcess suffix ordinally Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
thejambi
approved these changes
Oct 23, 2026
thejambi
left a comment
Contributor
There was a problem hiding this comment.
@thejambi reviewed 29 files and all commit messages, and made 1 comment.
Reviewable status:complete! all files reviewed, all discussions resolved (waiting on mark-sil).
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.
Start here:
DistFiles/Language Explorer/Configuration/Lexicon/DataTreeInclude.xmlholds most of the deletions;WindowConfigurationIntegrityTestsis what keeps them deleted.What it does
Deletes configuration and code FieldWorks defines but never uses, one kind per commit: 23 context menus that no layout or code names, with the 20 commands only they carried; command definitions that exist only inside XML comments, the feature-structure layouts and parts no screen displays, and three layout items with no part; and 22 commands nothing can run, with the message handlers and strings only they reached. The one change a user can see: File > Page Setup..., grayed out since at least 2012, is gone (approved on Slack).
The question you start with: what breaks?
Nothing reachable. Each deleted id was found by a scan (no layout, menu, toolbar, shortcut or code names it, or no handler answers it) and ids built in code were checked by hand. The question worth your time is whether the scan missed a way in.
WindowConfigurationIntegrityTestsnow fails if any menu or toolbar item names a command that does not exist, or any layout part names a context menu that does not, so a missed reference fails CI instead of throwing on right-click.Where to look
XWindow_KeyDownruns any command whose shortcut matches, menu or not. The six with live handlers stay:CmdFirstBundle,CmdLastBundle,CmdOpenCombo,CmdExportText,CmdRequestDebugInfo,CmdTestFollowLink.DetailObjectInsertion.IsOfferedOnEntrynow gates only Insert Affix Process; its Stem/Affix Allomorph rule served only deleted commands.MorphologyListener.ApproveAnalysis(was the publicOnAnalysisApprove): User Opinion > Approve still calls it.LayoutImportCoverageTests: the pinned unresolved-part set drops from 63 to 56, and its comments now say WinForms resolves the rest throughDistFiles/Parts.Not here
FwTMDefinition.xml,FwTMStrings,UIAdapterInterfaces): a separate PR.DistFiles/Partssupplies: LT-22772.Verification
build.ps1 -CommentHygiene -TokenHygieneclean for each commit; targetedtest.ps1runs all pass; probe runs prove the new integrity tests fail when they should. Manual WinForms checks passed on Sena 3, LT-19878 and LT-22280 Quechua MYL. The full suite runs in CI.Next: approve, or tell me what to change.
Reading this a year from now -- start here
This PR removed dead configuration and code in three commits. Each commit message lists the exact ids it deleted, so searching history for a menu or command id lands on the commit that explains it. The sections below hold the reasoning that the code no longer shows: why each kind of item counted as dead, and what was kept on purpose.
Decisions, and why
shortcutattribute alone:XWindow_KeyDownwalks the whole command set and runs the first enabled command whose shortcut matches. A command whose message has noOn<Message>handler is never enabled, so its shortcut is dead too (CmdBundleUp,CmdBundleDown,CmdBundleUpNc,CmdBundleDownNc,CmdShowMorphology).AreaListenerbuildsPaneBar-ShowHiddenFields-<tool>menus for custom lists itself, so the two static ones for tools that no longer exist (scrNoteTypesEdit,weatherConditionEdit) were dead.InflAffixTemplateMenuHandlerreadsmenu=from configuration, which the scan already covered.mnuDataTree-FeatureStructure-Featurenamed a commented-out command and would have thrown if built, but only theEditFeatureSpeclayouts used it, and nothing names those layouts. DataTree reuses the parent layout's name when an<obj>or<seq>has nolayoutattribute (DataTree.cs), and no feature-structure field is shown that way either. The whole chain went: both menus, eleven layouts, twelve parts and the four commented-out commands.CmdParse(hidden in the Interlinear Texts Data menu) has had noReParsehandler since at least 2012.CmdPageSetuplost its only handler, in Translation Editor'sFwMainWnd, in 2015; FLEx'sFwXWindownever had one.CmdParsestays.Main.xmlconcatenates every area's Data items, so that separator also divides Lexicon's group from Words'. XCore merges adjacent separators, so nothing changes on screen.<include>directives went only aftergit blamedated them to 2012-2013.Paths not taken
menu=attributes would then name missing menus, a trap for anyone who wires the layouts up later.Surprising findings
LayoutImportCoverageTestsdescribed its pinned refs as ones WinForms also omits. WinForms in fact loadsDistFiles/Partstoo (Inventory.csalways adds the codePartsfolder), whereStandardParts.xmland the build'sGeneratedParts.xmlresolve all but three. Those three (CmPerson-Role,LexReference-ShowSingleReference,MoInflClass-SubclassesAllA) had no part anywhere and were deleted here. The New UI composer reads onlyLanguage Explorer/Configuration/Parts; that gap is LT-22772.Evidence
.\build.ps1 -CommentHygiene -TokenHygiene, 0 warnings, 0 errors, both hygiene gates clean, for each commit..\test.ps1 -TestFilter,Total testschecked each time): 133/133 covering MorphologyEditor, LexTextDll, the Lexicon menu authority and execution tests,DetailObjectInsertionTests,LayoutImportCoverageTestsand the every-menu test; 88/88 and 59/59 in runs that include the layout-importer fixtures over the shipped layouts.Preflight review details
Code Review Summary
Branch: claude/elated-roentgen-2932d5
Base: main (merge base 363d3c8)
Date: 2026-10-22
Review model: Claude Opus 5.5
Files changed: 28 (3 commits)
Overview
The branch deletes configuration and code that FieldWorks defines but never uses: 23 context
menus no layout or code names, the commands only they carried, command definitions that exist
only inside XML comments, feature-structure layouts and parts no screen displays, three layout
items with no part anywhere, and 21 commands nothing can run, together with the message handlers
and strings only those commands reached. Two of those commands appeared in menus: File > Page
Setup... (always disabled; its only handler belonged to Translation Editor, removed in 2015) and
the hidden Interlinear Data > Parse item (no handler since at least 2012); removing Page Setup was
approved on Slack.
The analysis found the deletions complete and consistent: no remaining menu, toolbar or code
names a deleted id, and
WindowConfigurationIntegrityTestsnow asserts that. No native, installer, project-fileor script changes.
Contract/API Changes
DetailObjectInsertion.IsOfferedOnEntry(public static) no longer special-cases command idsending in
StemAllomorph/AffixAllomorph; it now gates only Insert Affix Process. Bothin-repo callers (
LexEntryMenuHandler,RecordEditView.LexiconMenus) were updated.MorphologyListener.OnMergeWordform,OnDisplayMergeWordform,OnWordformEditForm,OnDisplayWordformEditForm,OnWordformChangeCase,OnDisplayWordformChangeCase,OnDisplayAnalysisApprove, the#if NOTYETSpellingStatushandlers;
Ticker.OnListColleagues;LexTextApp.OnSynchronize;FwXWindow.OnStartLogging.MorphologyListener.OnAnalysisApprovebecame the privateApproveAnalysis.MEStrings.ksCannotMergeWordformsYet,MEStrings.ksTodo_WordformEditing;ContextHelp.xmlentries for deleted commands.messages.
Findings
Critical - Must address before merge
None.
Important - Should address before merge
No(author: cleanup, no ticket needed; the item could never be used)LT-ticket although File > Page Setup... disappears from a menu a tester can seeMinor - Consider
Removed(author: internal to FieldWorks, no known external users; none in the repo)public/public virtualXCore handlers could break an out-of-repo plugin that overrides or calls themAn installed extension's(author: internal to FieldWorks, no known external users; no extension ships inAreaConfigurationExtension.xmlnaming a deleted command id would throw when its menu is builtDistFiles/Language Explorer/Configuration/Extensions)Full test suite not run locally(author: rely on CI for the full suite)Required Validation / Evidence
.\build.ps1 -CommentHygiene -TokenHygiene: clean, 0 warnings, 0 errors, both hygiene gatesclean, for each commit.
.\test.ps1 -TestFilterruns, all passing: 133/133 (MorphologyEditor, LexTextDll,Lexicon menu authority/execution, DetailObjectInsertion, LayoutImportCoverage, every-menu
test), 88/88 and 59/59 (layout importer fixtures over shipped layouts), 63/63.
item naming a missing command; both probes removed, files byte-identical afterwards.
MYL): remaining Lexicon, Lists, Grammar, Texts & Words menus and toolbars, File and Data menus,
Pronunciation menu, keyboard shortcuts Ctrl+Home/End/M, Bulk Edit Phoneme Features, People.
Positive Observations
deleted.
WindowConfigurationIntegrityTestsnow fails on any menu or toolbar item that names amissing command and on any layout part that names a missing menu, so the broken-item class
this branch removed cannot return unnoticed.
(
DataTree.cs:2445), and the deleted layouts were never displayed, so none could be customized.CmdFirstBundle,CmdLastBundle,CmdOpenCombo,CmdExportText,CmdRequestDebugInfo,CmdTestFollowLink) were identified and kept.LayoutImportCoverageTestscomments now state correctly that WinForms resolves the pinned refsthrough
DistFiles/Parts.Interview Notes
LT-ticket; the author treats this as cleanup.external users.
that could never be enabled. And it's been that way in the product for over a decade."
Suggested Review Focus
WindowConfigurationIntegrityTests: every command, menu and hotlinks reference in theshipped configuration and layouts must name something defined.
DetailObjectInsertion.IsOfferedOnEntryandLexEntryMenuHandler.OnDisplayDataTreeInsertafter the Stem/Affix Allomorph rule went.
Morphology.fwlayoutandMorphologyParts.xml, and the three dead layout items.🤖 Generated with Claude Code
This change is