Skip to content

Drop seven PropertyTable broadcasts that repeat finished work - #1215

Merged
mark-sil merged 1 commit into
mainfrom
claude/pubsub-dead-broadcasts-2-dd3fa0
Oct 29, 2026
Merged

mark-sil merged 1 commit into
mainfrom
claude/pubsub-dead-broadcasts-2-dd3fa0

Conversation

@mark-sil

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

Copy link
Copy Markdown
Contributor

Start here: Src/XCore/FlexUIAdapter/NavBarAdapter.cs -- the only edit that changes a stored value rather than just whether its change is broadcast.

Seven PropertyTable.SetProperty calls stop queueing an OnPropertyChanged broadcast that reached no handler, or reached only a handler repeating work finished before the item drained. Second round after #1179. Properties: ReversalIndexGuid, currentContentControlObject, ToolForAreaNamed_<area> (the null reset), ShowRecordList, DictionaryPublicationLayout, BestStyleName, WritingSystemHvo.

What breaks? Nothing visible is intended to change. Each site was checked against every OnPropertyChanged that names the property before editing; none was dropped.

Where to look

  • NavBarAdapter -- a remembered tool that no longer exists (a deleted custom list) now keeps its stale name instead of being reset to null. AreaListener.GetToolNodeForArea already falls back to the area's default tool for a stale name; a null read back with a "" default reaches its ConfigurationException once PropertyTable: a stored default no longer broadcasts #1213 lands. Pinned by AreaChoiceChange_RememberedToolIsGone_LeavesItsNameWithoutSettingAnyProperty.
  • RootSite / EditingHelper -- BestSelectionStyle no longer broadcasts, so the public EditingHelper.SuppressNextBestStyleNameChanged flag that muted the echo is removed. Pinned by BestSelectionStyle_StyleDiffers_StoresItWithoutQueueingAChange.
  • DataTree -- ShowObject raises the "just switched tools" flag itself before queueing the focus step. The deleted branch only added a stale raise in the popup entry window's DataTree, which could pull focus on a later refresh there.

Deliberately not here

  • No unit tests for DataTree (the flag is private) or GeneratedHtmlViewer (its Init runs the sketch transforms and builds a Gecko control).
  • WritingSystemHvo: the toolbar combo no longer gets an extra refresh before the first 1000 ms widget-timer tick.

Verification

  • build.ps1 -CommentHygiene -TokenHygiene clean.
  • LexEdDllTests 48/48, xCoreTests 25/25, RootSiteTests 106 (+1 skipped), DetailControlsTests 125 (+1 skipped), SimpleRootSiteTests 115/115, xWorksTests touched fixtures 28/28.
  • All four new tests fail against main's production code.
  • Full xWorksTests crashes the test host after 44-67 tests; main's code crashes at the same place.
  • Manual checks in Sena 3 for all seven sites passed (see Evidence).

Next: approve, or name a site to pull out.


Reading this a year from now -- start here

Part of the Mediator-to-Pub/Sub work: before a PropertyTable broadcast can be converted or removed, every broadcast that does nothing has to go. This PR removes seven. Each "no broadcast" test asserts the Mediator's job queue (JobItems) directly, with a bare Mediator plus one listening colleague so the queue is not short-circuited.

Decisions, and why
  • ReversalIndexGuid (ReversalListener.Init): the first index is chosen before any clerk exists to hear the change.
  • ShowRecordList (GeneratedHtmlViewer.PrepareToGoAway): the next tool sets its own value. The Init set stays broadcast. Traced on main: with the sketch as the window's first view and ShowRecordList persisted true, a refresh via FwXApp.RefreshAllWindows (Format > Styles with a change) opens an empty record-list panel; this branch keeps it hidden. The main-side glitch was traced, not reproduced.
  • DictionaryPublicationLayout (XhtmlRecordDocView.ShowRecord): the popup entry window also opens from Interlinear and Insert Entry, so a Reversal Indexes or Classified Dictionary view can hear the set. Its handler recomputes its own configuration, unchanged, and UpdateContent's same-configuration check returns.
  • BestStyleName: the only setter of the suppress flag was the broadcast it muted.
  • WritingSystemHvo (WritingSystemListHandler.Init): the combo reads the value on the toolbar's next update.
Evidence

Manual checks, Sena 3:

  1. Reversal Indexes with ConfigurationSettings set aside: the English index shows its entry.
  2. Lexicon Edit -> Category Edit -> Lexicon Edit: focus behaves as on main. The first-field focus path needs the edit pane to be the window's defaultFocusControl, which no edit-pane tool sets.
  3. Create a custom list, open it, Lists > Delete Custom List: the rebuilt window opens Academic Domains; switching areas and back works.
  4. Grammar Sketch as first view with ShowRecordList persisted true, then Format > Styles with a change: the record-list panel stays hidden.
  5. Lexicon Edit's Dictionary Preview and Lexicon > Dictionary show the same configuration.
  6. Interlinear Baseline: applying Emphasized Text, then moving the caret, updates the Styles combo.
  7. Startup in lexiconDictionary: the Writing System combo shows English.
Preflight review details

Code Review Summary

Branch: claude/pubsub-dead-broadcasts-2-dd3fa0
Base: main
Date: 2026-10-29
Review model: Claude Opus 5.5
Files changed: 12 (1 commit)

Overview

Second round of removing PropertyTable broadcasts that reach no handler, or
only a handler that repeats finished work. Seven sites stop queueing an
OnPropertyChanged item: ReversalIndexGuid, currentContentControlObject, the
ToolForAreaNamed_ reset, ShowRecordList, DictionaryPublicationLayout,
BestStyleName and WritingSystemHvo. Each site's check was run before the edit;
none was dropped.

Contract/API Changes

EditingHelper.SuppressNextBestStyleNameChanged (public) is removed. Its only
setter was RootSite.BestSelectionStyle, which no longer broadcasts.

Findings

Critical - Must address before merge

None.

Important - Should address before merge

  • Briefed manual steps for the deleted custom list and the Grammar Sketch
    F5 could not be performed
    (steps rewritten to reachable paths; the user ran
    them)
  • The briefed origin of XhtmlRecordDocView's popup was wrong (the popup
    also opens from Interlinear and Insert Entry; its listeners recompute the same
    configuration and UpdateContent's same-configuration guard returns, so the
    edit stays safe)

Minor - Consider

  • The popup entry window's DataTree no longer gets a stale "just switched
    tools" flag from the main window's broadcast
    (intended; named in the PR)
  • After a refresh, ShowRecordList stays true while the sketch shows
    (no visible effect today)
  • No unit tests for the DataTree and GeneratedHtmlViewer edits (the
    DataTree flag is private with nothing observable; the viewer's Init runs the
    sketch transforms and builds a Gecko control)
  • Fourth copy of a small ListeningColleague test stub (left as is)

Required Validation / Evidence

  • build.ps1 -CommentHygiene -TokenHygiene: clean.
  • Targeted tests: LexEdDllTests 48/48, xCoreTests 25/25, RootSiteTests 106
    passed 1 skipped, DetailControlsTests 125 passed 1 skipped,
    SimpleRootSiteTests 115/115, xWorksTests (four touched fixtures) 28/28.
  • Control run with main's production code: all four new tests fail.
  • Full xWorksTests crashes the test host after 44-67 tests; main's code
    crashes at the same place.
  • Manual tests in Sena 3: run and passed by the author.

Positive Observations

Each "no broadcast" test asserts the Mediator's job queue directly and was
proven against main.

Interview Notes

The author ran the manual tests, reviewed the code and approved the commit
message before the PR. Jira: the author's standing rule is no tickets for the
Pub/Sub work.

Suggested Review Focus

  • NavBarAdapter: leaving a vanished remembered tool name in place instead
    of resetting it to null
  • RootSite/EditingHelper: removal of the suppress flag

🤖 Generated with Claude Code


This change is Reviewable

Seven property changes no longer run OnPropertyChanged work that was
already done. Until now each queued a broadcast that reached no
handler, or only a handler repeating work finished before the item
drained.

Affected properties and their sites:
* ReversalIndexGuid: ReversalListener.Init, before any clerk exists
* currentContentControlObject: DataTree's handler branch is removed
* ToolForAreaNamed_lexicon, ToolForAreaNamed_textsWords,
  ToolForAreaNamed_grammar, ToolForAreaNamed_notebook and
  ToolForAreaNamed_lists: NavBarAdapter no longer resets a missing
  remembered tool to null
* ShowRecordList: GeneratedHtmlViewer.PrepareToGoAway
* DictionaryPublicationLayout: XhtmlRecordDocView.ShowRecord
* BestStyleName: RootSite.BestSelectionStyle, with EditingHelper's
  SuppressNextBestStyleNameChanged removed
* WritingSystemHvo: WritingSystemListHandler.Init

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

Copy link
Copy Markdown

NUnit Tests

    1 files  ±0      1 suites  ±0   11m 21s ⏱️ - 3m 58s
6 925 tests +4  6 840 ✅ +4  85 💤 ±0  0 ❌ ±0 
6 934 runs  +4  6 849 ✅ +4  85 💤 ±0  0 ❌ ±0 

Results for commit bdde4c1. ± Comparison against base commit 002280d.

@codecov-commenter

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 66.66667% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 40.33%. Comparing base (10f08c9) to head (bdde4c1).
⚠️ Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
Src/xWorks/GeneratedHtmlViewer.cs 0.00% 1 Missing ⚠️
Src/xWorks/XhtmlRecordDocView.cs 0.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1215      +/-   ##
==========================================
+ Coverage   40.29%   40.33%   +0.04%     
==========================================
  Files        1547     1547              
  Lines      355556   355560       +4     
  Branches    41446    41450       +4     
==========================================
+ Hits       143258   143420     +162     
+ Misses     182980   182844     -136     
+ Partials    29318    29296      -22     
Files with missing lines Coverage Δ
Src/Common/Controls/DetailControls/DataTree.cs 47.94% <ø> (+0.02%) ⬆️
Src/Common/RootSite/RootSite.cs 46.22% <100.00%> (+5.87%) ⬆️
Src/Common/SimpleRootSite/EditingHelper.cs 40.15% <ø> (+1.17%) ⬆️
Src/LexText/Lexicon/ReversalListener.cs 49.01% <100.00%> (ø)
Src/XCore/FlexUIAdapter/NavBarAdapter.cs 73.00% <100.00%> (+0.96%) ⬆️
Src/xWorks/TextListeners.cs 27.50% <100.00%> (ø)
Src/xWorks/GeneratedHtmlViewer.cs 0.00% <0.00%> (ø)
Src/xWorks/XhtmlRecordDocView.cs 0.00% <0.00%> (ø)

... and 6 files 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 12 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 936ae91 into main Oct 29, 2026
9 checks passed
@mark-sil
mark-sil deleted the claude/pubsub-dead-broadcasts-2-dd3fa0 branch October 29, 2026 16:34
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