Skip to content

Remove dead code from XmlDocView and related classes - #1044

Open
mark-sil wants to merge 1 commit into
mainfrom
remove-xmldocview-dead-code
Open

Remove dead code from XmlDocView and related classes#1044
mark-sil wants to merge 1 commit into
mainfrom
remove-xmldocview-dead-code

Conversation

@mark-sil

@mark-sil mark-sil commented Aug 5, 2026

Copy link
Copy Markdown
Contributor

Summary

XmlDocView was the pre-XHTML Dictionary view; today only the Notebook Document tool (and its print path) instantiates it. This removes ~700 lines of code that could only execute when it hosted a dictionary:

  • The CheckJump warning path (XmlSeqView.OnJumpToRecord -> XmlDocView.OnCheckJump). Its guard required the lexiconDictionary tool, which uses XhtmlDocView - whose own OnJumpToRecord is the live equivalent of this logic.
  • Publication and configuration-view handling: OnPropertyChanged (SelectedPublication / DictionaryPublicationLayout), GetPubDecorator, the TitleBar Layout Menu region, and the Dictionary title-bar helpers. The persistContext for XmlDocView is only ever Notebk, so SetInfoBarText reduces to its base behavior.
  • MainEntryFromSubEntryTargetAdjuster, only reachable from root-based dictionary layouts, plus its assertion block in ItemClickedTests.
  • The entire SubitemRecordClerk feature (not dictionary-related): the class, the RecordClerk virtual hooks and relationToRelatedClerk branches, and the block in XmlDocView.SelectAndScrollToCurrentRecord. No configuration XML has ever referenced the clerk or the relationToRelatedClerk attribute in available history (2012 onward, checked locally across all branches and against upstream), so none of it could run.

No configuration that instantiates XmlDocView has a <decoratorClass> node, so the XmlSeqView publication argument is now passed as null.

Deliberately kept: IPreferedTargetAdjuster/NullTargetAdjuster (live API used by SubitemClicked), the decorator guard in AdjustedClerkIndex, and the layout-property fallback in RunConfigureDialog.

Validation

  • .\build.ps1 - 0 warnings, 0 errors
  • .\test.ps1 xWorksTests: 1221 passed, 0 failed
  • .\test.ps1 XMLViewsTests: 114 passed, 0 failed

🤖 Generated with Claude Code


This change is Reviewable

XmlDocView was the pre-XHTML Dictionary view; today only the Notebook
Document tool (and its print path) instantiates it. Remove code that
could only execute when it hosted a dictionary:
- The CheckJump warning path. The live equivalent is XhtmlDocView's
  OnJumpToRecord.
- Publication and configuration-view handling. The persistContext for
  XmlDocView is only ever Notebk, so SetInfoBarText reduces to its
  base behavior.
- MainEntryFromSubEntryTargetAdjuster, only reachable from root-based
  dictionary layouts.

The entire SubitemRecordClerk feature (not dictionary-related):
no configuration XML has ever referenced the clerk in available
history (2012 onward), so none of it could run.

No configuration that instantiates XmlDocView has a <decoratorClass>
node, so the XmlSeqView publication argument is now passed as null.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@codecov-commenter

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 0% with 6 lines in your changes missing coverage. Please review.
✅ Project coverage is 33.09%. Comparing base (72d5a38) to head (efcdc21).

Files with missing lines Patch % Lines
Src/xWorks/XmlDocView.cs 0.00% 4 Missing and 1 partial ⚠️
Src/xWorks/RecordClerk.cs 0.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1044      +/-   ##
==========================================
+ Coverage   33.05%   33.09%   +0.04%     
==========================================
  Files        1202     1201       -1     
  Lines      278326   277923     -403     
  Branches    37190    37125      -65     
==========================================
- Hits        91994    91981      -13     
+ Misses     158478   158152     -326     
+ Partials    27854    27790      -64     
Files with missing lines Coverage Δ
Src/Common/Controls/XMLViews/XmlSeqView.cs 19.35% <ø> (+0.34%) ⬆️
Src/xWorks/RecordClerk.cs 39.36% <0.00%> (+0.56%) ⬆️
Src/xWorks/XmlDocView.cs 7.41% <0.00%> (+1.80%) ⬆️
🚀 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.

@github-actions

github-actions Bot commented Aug 5, 2026

Copy link
Copy Markdown

NUnit Tests

    1 files  ±0      1 suites  ±0   8m 13s ⏱️ -12s
4 316 tests ±0  4 243 ✅ ±0  73 💤 ±0  0 ❌ ±0 
4 325 runs  ±0  4 252 ✅ ±0  73 💤 ±0  0 ❌ ±0 

Results for commit efcdc21. ± Comparison against base commit 72d5a38.

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.

2 participants