Skip to content

Remove code and data that only the Translation Editor used - #1202

Merged
mark-sil merged 2 commits into
mainfrom
claude/competent-hypatia-cc9a20
Oct 26, 2026
Merged

mark-sil merged 2 commits into
mainfrom
claude/competent-hypatia-cc9a20

Conversation

@mark-sil

@mark-sil mark-sil commented Oct 23, 2026 •

Copy link
Copy Markdown
Contributor

Start here: Src/FwCoreDlgs/FwStylesDlg.cs -- the only behaviour change. Everything else is deletion.

What it does. Removes code and data that only the Translation Editor (TE) used, as agreed on Slack: TE's menu/toolbar definitions (FwTMDefinition.xml), its string table (FwTMStrings), unused page-setup strings and command id, the UIAdapterInterfaces project, TE-only members and hooks in RootSite, SimpleRootSite, Framework, FieldWorks and xWorks, and TE's switches in the Styles and Apply Style dialogs.

The unknown you start with: what breaks? The condition for removing TE leftovers was that Paratext Scripture import, and working with that Scripture in Interlinear Texts, keep working. Nothing on those paths changed. Every removal was re-checked unused across code, project files, FieldWorks.sln, the installer and localization config. The one visible change is in Format > Styles: the List box's "User-modified Styles" entry was filtering to the Dictionary styles. That came from a TE label swap that never ran in FLEx. It now lists styles whose modified flag is set. The label text is unchanged.

Where to look

  • FwStylesDlg.GetExcludedFlexStyleNames case 3 -- the new user-modified filter.
  • FwApplyStyleDlg designer and resx -- the always-hidden style-type panel removed, and its table-layout row dropped.
  • RootSiteEditingHelper -- only the TE ShowContextMenu(Point, ITMAdapter, ...) overload went. FLEx's spelling menu goes through SpellCheckHelper.ShowContextMenu, which is untouched.
  • Public signatures changed: the FwStylesDlg/FwApplyStyleDlg constructors, RunStylesDialogForCombo and ShowApplyStyleDialog. All in-repo callers are updated; no external callers are known.

Deliberately not here

  • In a new project, Normal still appears under "User-modified Styles". A liblcm bug marks it modified, and the same bug affects Reset. LT-22212 will get a comment citing this PR.
  • The Valid Characters dialog is untouched.

Verification. build.ps1 -CommentHygiene -TokenHygiene (native included): 0 warnings, 0 errors. Targeted runs pass: ParatextImportTests, ScriptureUtilsTests, ITextDllTests, RootSiteTests, SimpleRootSiteTests, FrameworkTests, FwCoreDlgsTests, FwCoreDlgControlsTests and LexTextControlsTests. Manually tested: Scripture in Interlinear Texts, the spelling context menu, Format > Styles, Format > Apply Style, and the Styles button in Configure Dictionary. Not run: a live Paratext 9 import, since Paratext isn't installed here; ParatextImportTests cover the importer.

Next: approve, or point at anything that should stay.


Reading this a year from now -- start here

TE was removed from FieldWorks around 2015, but some of its code, data and switches stayed in shared FLEx code. This PR removes what had no remaining FLEx caller. Where a TE switch was still read by FLEx (the Styles dialog switches), FLEx's constant answer was inlined and the switch removed. The first commit is pure deletion. The second removes the style-dialog switches, and with them a parameter chain (customUserLevel / nMaxStyleLevel / maxStyleLevel / MaxStyleLevelToShow) whose only reader was TE's "Custom Styles" branch.

Decisions, and why
  • "User-modified Styles" was fixed, not relabelled. The FwStylesDlg constructor set "Dictionary" aside to swap in for FLEx, but the swap only ran for TE. So FLEx showed TE's label with FLEx's Dictionary filter. Relabelling it "Dictionary" was considered. Making the entry do what its label says was preferred, and approved, because a Dictionary-only list adds little when All Styles already groups the Dictionary styles together.
  • The filter uses the dialog's existing mechanism: a list of names to exclude, built per list type. TE's separate ShowOnlyUserModifiedStyles filter could not be combined with that list, because BaseStyleListHelper returns early when an exclude list is set. So the TE filter was removed rather than revived.
  • The "Dictionary" resource (m_cboTypes.Items4) was deleted, and "User-modified Styles" (Items3) kept, so existing translations still match their keys.
  • FwStylesDlg.CanSelectParagraphBackgroundColor stays: RunStylesDialogForCombo and ImportCharMappingDlg still set it to false. Only the always-true callback was removed.
  • FwRegistryHelper.TranslationEditor stays: FLEx still uses it to delete old TE registry keys.
The Normal-is-modified bug (deferred)

From code reading; the symptom was seen live. StyleInfoTable.ConnectStyles (liblcm) gives paragraph styles with no based-on style their built-in defaults. A new project's Normal stores font size 10 pt and space before 0 explicitly, and both equal those defaults. When the dialog writes the tab values back, InheritableStyleProp.Save converts a value equal to the default into inherited and reports a change. The Font and Paragraph tabs then set StyleInfo.Dirty, which also sets IsModified. The fix belongs in liblcm's Save, so it is out of scope here.

Evidence

Targeted test runs (Total / Passed / Skipped):

Project Total Passed Skipped
ParatextImportTests 681 641 40
ParaText8PluginTests 1 0 1 (Paratext not installed)
ScriptureUtilsTests 26 23 3
ITextDllTests 210 209 1
RootSiteTests 106 105 1
SimpleRootSiteTests 115 115 0
FrameworkTests 27 27 0
FwCoreDlgsTests 366 361 5
FwCoreDlgControlsTests 55 55 0
LexTextControlsTests 368 365 3
Preflight review details

Code Review Summary

Branch: claude/competent-hypatia-cc9a20
Base: main (merge base d0d85cb, current with origin/main)
Date: 2026-10-23
Review model: Claude Opus 5.5
Files changed: 41 (2 commits, +37 / -5,543)

Overview

Removes code and data that only the Translation Editor (TE) used, after the team
approved it on Slack. Ken Zook's condition was that Paratext Scripture import and
working with that Scripture in Interlinear Texts must keep working; Jason excluded the
Valid Characters dialog, which is untouched.

Commit 1 deletes TE's menu/toolbar definitions, string table, page-setup strings and
native command id, the UIAdapterInterfaces project, and TE-only members and hooks in
RootSite, SimpleRootSite, Framework, FieldWorks and xWorks. Commit 2 removes TE's
switches from the Styles and Apply Style dialogs. That exposed a FLEx bug: the Styles
dialog's "User-modified Styles" list entry filtered to the Dictionary styles. It now
lists styles whose modified flag is set.

Contract/API Changes

  • UIAdapterInterfaces assembly removed (ITMAdapter, ISIBInterface, TMItemProperties).
  • Removed public members: RootSiteEditingHelper.ShowContextMenu(Point, ITMAdapter, ...),
    SpellCheckingStatus, SpellCheckStatus; EditingHelper.CastAs; AddToDictMenuItem.Word and
    WritingSystem; StylesXmlAccessor.AppDefaultFont, IsNormalStyle,
    ValidateParagraphContext; WindowsInstallerQuery; FwXWindow.OnUpdateArchiveWithRamp;
    FwStylesDlg.ShowTEStyleTypes; FwApplyStyleDlg.AllowSelectStyleTypes;
    BaseStyleListHelper.ShowOnlyUserModifiedStyles; StyleListItem.IsUserModifiedStyle.
  • IMainWindowDelegateCallbacks loses ShowTEStylesComboInStylesDialog,
    CanSelectParagraphBackgroundColor, PopulateParaStyleListOverride, MaxStyleLevelToShow.
  • Signatures: FwStylesDlg and FwApplyStyleDlg constructors lose customUserLevel;
    FwStylesDlg.RunStylesDialogForCombo loses nMaxStyleLevel;
    IMainWindowDelegatedFunctions.ShowApplyStyleDialog loses maxStyleLevel.
  • Native: #define kcidFilePageSetup removed from AfDef.h.
  • Resources: FwTMStrings.resx removed; four page-setup strings from FwStrings.resx;
    the Apply Style dialog's style-type list strings; FwStylesDlg's "Dictionary" entry.

Findings

Critical - Must address before merge

None.

Important - Should address before merge

None.

Minor - Consider

  • Public API removed; callers outside this repo would break (author: no external
    consumers known; every in-repo caller, including bundled plugins, compiles)
  • Normal appears under "User-modified Styles" in a new project (author: Ken
    approved the partial fix; the cause is liblcm InheritableStyleProp.Save, to be
    recorded on LT-22212 after merge)
  • User-visible Styles-dialog change without an LT ticket id in the title
    (author: no ticket id; LT-22212 will get a comment citing this PR)

Required Validation / Evidence

  • .\build.ps1 -CommentHygiene -TokenHygiene, native included: 0 warnings, 0 errors,
    hygiene gates clean (after each change set).
  • Targeted test runs, all passing (Total tests / passed / skipped):
    ParatextImportTests 681/641/40, ParaText8PluginTests 1/0/1 (Paratext not installed),
    ScriptureUtilsTests 26/23/3, ITextDllTests 210/209/1, RootSiteTests 106/105/1,
    FrameworkTests 27/27/0, SimpleRootSiteTests 115/115/0, FwCoreDlgsTests 366/361/5,
    FwCoreDlgControlsTests 55/55/0, LexTextControlsTests 368/365/3.
  • Author confirmed manual tests: Interlinear Texts Choose Texts on Scripture, the
    spelling context menu, File > Archive with RAMP, Format > Styles (list types,
    user-modified, paragraph background), Format > Apply Style, and the Styles button in
    Configure Dictionary. The author reports all tests pass.
  • Not run: Paratext 9 import followed by Interlinear Texts (Paratext 9 not installed).

Positive Observations

  • Every removal was re-verified unused by repo-wide search, including the solution,
    installer and localization config.
  • The style-dialog change replaces a mislabelled filter with the behaviour the label
    promises, and keeps the existing "User-modified Styles" string.

Interview Notes

  • Scope approved on Slack; Ken approved the partial fix of "User-modified Styles".
  • No external consumers of the removed API are known.
  • PR title carries no ticket id by the author's choice.

Suggested Review Focus

  • FwStylesDlg.GetExcludedFlexStyleNames case 3 (user-modified filter)
  • FwApplyStyleDlg designer/resx removal of the hidden style-type panel
  • RootSiteEditingHelper: FLEx's spelling menu path (SpellCheckHelper.ShowContextMenu) untouched

🤖 Generated with Claude Code


This change is Reviewable

mark-sil and others added 2 commits October 22, 2026 13:40
FieldWorks no longer carries the Translation Editor's menu and toolbar
definitions, its string table, its UIAdapterInterfaces project, or the
members and hooks that only it called or overrode. Until now these
stayed in DistFiles, FwResources, AppCore, FieldWorks, Framework,
RootSite, SimpleRootSite and xWorks, although nothing has loaded,
called or read them since the Translation Editor was removed.

Removed:
* FwTMDefinition.xml
* FwTMStrings
* IPublicationView
* IPageSetupDialog
* kstidPageSetupWithViewName
* kstidUndoPageSetupChanges
* kstidFilePageSetupMenuName
* kstidFilePageSetupMsg
* kcidFilePageSetup
* UIAdapterInterfaces (ITMAdapter, ISIBInterface, TMItemProperties)
* RootSiteEditingHelper.ShowContextMenu(Point, ITMAdapter, ...)
* RootSiteEditingHelper.MakeSpellCheckMenuOptions
* RootSiteEditingHelper.UpdateItemProps
* RootSiteEditingHelper.SpellCheckingStatus
* RootSiteEditingHelper.SpellCheckStatus
* RootSiteEditingHelper.itemAdd_Click
* AddToDictMenuItem.Word
* AddToDictMenuItem.WritingSystem
* EditingHelper.CastAs
* StylesXmlAccessor.AppDefaultFont
* StylesXmlAccessor.IsNormalStyle
* StylesXmlAccessor.ValidateParagraphContext
* WindowsInstallerQuery
* FwXWindow.OnUpdateArchiveWithRamp

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The Styles and Apply Style dialogs no longer carry the Translation
Editor's style-type options, and the Styles dialog's "User-modified
Styles" list now shows the styles changed from their factory settings.
Until now every FLEx window answered switches that only the Translation
Editor ever changed, the Apply Style dialog built a style-type list it
never showed, and "User-modified Styles" showed the Dictionary styles.

Removed:
* IMainWindowDelegateCallbacks.ShowTEStylesComboInStylesDialog
* IMainWindowDelegateCallbacks.CanSelectParagraphBackgroundColor
* IMainWindowDelegateCallbacks.PopulateParaStyleListOverride
* IMainWindowDelegateCallbacks.MaxStyleLevelToShow
* FwStylesDlg.ShowTEStyleTypes
* the customUserLevel parameter of FwStylesDlg and FwApplyStyleDlg
* the nMaxStyleLevel parameter of FwStylesDlg.RunStylesDialogForCombo
* the maxStyleLevel parameter of ShowApplyStyleDialog
* FwApplyStyleDlg.AllowSelectStyleTypes and its style-type list
* BaseStyleListHelper.ShowOnlyUserModifiedStyles
* StyleListItem.IsUserModifiedStyle
* the m_cboTypes.Items4 string of FwStylesDlg ("Dictionary")

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@github-actions

Copy link
Copy Markdown

NUnit Tests

    1 files  ±0      1 suites  ±0   14m 27s ⏱️ + 5m 53s
6 816 tests ±0  6 731 ✅ ±0  85 💤 ±0  0 ❌ ±0 
6 825 runs  ±0  6 740 ✅ ±0  85 💤 ±0  0 ❌ ±0 

Results for commit 7445ee3. ± Comparison against base commit d0d85cb.

@codecov-commenter

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 5.00000% with 19 lines in your changes missing coverage. Please review.
✅ Project coverage is 39.90%. Comparing base (d0d85cb) to head (7445ee3).

Files with missing lines Patch % Lines
Src/FwCoreDlgs/FwStylesDlg.cs 0.00% 8 Missing and 3 partials ⚠️
Src/Common/Framework/MainWindowDelegate.cs 0.00% 3 Missing ⚠️
Src/xWorks/FwXWindow.cs 0.00% 2 Missing ⚠️
Src/FwCoreDlgs/FwApplyStyleDlg.cs 0.00% 1 Missing ⚠️
...xt/LexTextControls/LexImportWizardCharMarkerDlg.cs 0.00% 1 Missing ⚠️
Src/xWorks/DictionaryDetailsController.cs 0.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1202      +/-   ##
==========================================
+ Coverage   39.88%   39.90%   +0.01%     
==========================================
  Files        1542     1541       -1     
  Lines      355361   355131     -230     
  Branches    41320    41300      -20     
==========================================
- Hits       141753   141732      -21     
+ Misses     184253   184064     -189     
+ Partials    29355    29335      -20     
Files with missing lines Coverage Δ
Src/Common/Framework/FwEditingHelper.cs 42.65% <ø> (ø)
Src/Common/Framework/StylesXmlAccessor.cs 43.56% <ø> (+<0.01%) ⬆️
Src/Common/RootSite/RootSiteEditingHelper.cs 24.00% <ø> (+3.71%) ⬆️
Src/Common/RootSite/SpellCheckHelper.cs 0.00% <ø> (ø)
Src/Common/SimpleRootSite/EditingHelper.cs 38.97% <ø> (+0.07%) ⬆️
Src/FwCoreDlgs/FwApplyStyleDlg.Designer.cs 0.00% <ø> (ø)
...wCoreDlgControls/StyleLists/BaseStyleListHelper.cs 68.14% <ø> (+0.65%) ⬆️
...Dlgs/FwCoreDlgControls/StyleLists/StyleListItem.cs 80.70% <ø> (+1.39%) ⬆️
Src/FwCoreDlgs/FwStylesDlg.Designer.cs 100.00% <100.00%> (ø)
...xTextControls/DataNotebook/ImportCharMappingDlg.cs 0.00% <ø> (ø)
... and 7 more

... and 1 file 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.

@thejambi thejambi 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:

@thejambi reviewed 41 files and all commit messages, and made 1 comment.
Reviewable status: :shipit: complete! all files reviewed, all discussions resolved (waiting on mark-sil).

@mark-sil
mark-sil merged commit 1860d10 into main Oct 26, 2026
9 checks passed
@mark-sil
mark-sil deleted the claude/competent-hypatia-cc9a20 branch October 26, 2026 12:41
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