Repository navigation
Harden sidebar clicks against an exception and a missing tab - #1229
Merged
Merged
Conversation
A sidebar or list click whose handling throws no longer disables later clicks, and SidePane.CurrentItem returns null when no tab is selected, as documented. Until now ListPropertyChoice cleared its static click flag only when the click handler returned, so after an error the user chose to continue from, every later sidebar and list click was ignored for the rest of the session. SidePane.CurrentItem indexed its item areas with a null tab and threw, which SidebarAdapter would hit if a ToolForAreaNamed_<area> change arrived before the first areaChoice change; that order does not occur today. Affected members: * ListPropertyChoice.OnClick * SidePane.CurrentItem * SidebarAdapter.SetToolForCurrentArea (with no tab selected it now selects the tool instead of throwing) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #1229 +/- ##
==========================================
+ Coverage 40.45% 40.51% +0.06%
==========================================
Files 1552 1559 +7
Lines 355828 356090 +262
Branches 41530 41585 +55
==========================================
+ Hits 143949 144275 +326
+ Misses 182579 182501 -78
- Partials 29300 29314 +14
🚀 New features to boost your workflow:
|
thejambi
approved these changes
Nov 4, 2026
thejambi
left a comment
Contributor
There was a problem hiding this comment.
@thejambi reviewed 5 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.
A sidebar or list click whose handling throws no longer disables later clicks, and
SidePane.CurrentItemreturns null when no tab is selected, as documented. Until nowListPropertyChoicecleared its static click flag only when the click handler returned, so after an error the user chose to continue from, every later sidebar and list click was ignored for the rest of the session.SidePane.CurrentItemindexed its item areas with a null tab and threw, whichSidebarAdapterwould hit if aToolForAreaNamed_<area>change arrived before the firstareaChoicechange; that order does not occur today.Affected members:
ListPropertyChoice.OnClickSidePane.CurrentItemSidebarAdapter.SetToolForCurrentArea(with no tab selected it now selects the tool instead of throwing)Reviewer notes
Start here:
ListPropertyChoice.OnClick(Src/XCore/xCoreInterfaces/Choice.cs:642-655) -- the try/finally around the staticm_fHandlingClick. ThenSidePane.CurrentItem(Src/XCore/SilSidePane/SidePane.cs:346-353).Why now: both paths matter once sidebar property sets move from queued Mediator broadcasts to immediate delivery. Today the listeners of a click's property set run later, from the queue, outside
OnClick; immediately delivered, they run insideHandleItemClickwhile the flag is set, so one listener exception would disable the sidebar. The tool-switch redesign also reorders the startup notifications, which makes "tool before area" reachable.Where to look
ContinuableErrorExceptionis continuable, FieldWorks.cs:1194-1196). Later clicks now work instead of being ignored. Pinned byListPropertyChoiceClickTests.ClickAfterAClickThatThrew_IsHandled.CurrentItem's null return -- its callers areSidebarAdapter.SetToolForCurrentArea(NavBarAdapter.cs:624, where null means "not current", so the tool is selected) andSidePaneTests. Pinned bySidePaneTests.CurrentItem_whenNoTabSelected(all three item-area styles) andSidebarAdapterSelectionTests.ToolForAreaChange_BeforeAnyTabIsSelected_SelectsThatTool, which also asserts no property is set.Deliberately not here: no Pub/Sub conversion; the sidebar's property sets still broadcast through the Mediator.
Verification
.\build.ps1 -CommentHygiene -TokenHygieneclean..\test.ps1 -SkipNative -TestProject Src/XCore/xCoreTests: 27/27;-TestProject Src/XCore/SilSidePane/SilSidePaneTests: 149/149.ArgumentNullExceptionfromCurrentItem; one handled click instead of two).Next: approve.
Preflight review details
Code Review Summary
Branch: claude/pubsub-click-path-hardening-3b5006
Base: main (merge base 1903f5d)
Date: 2026-11-04
Review model: Claude Opus 5.5
Files changed: 5 (1 commit)
Contract/API Changes
SidePane.CurrentItemreturns null with no tab selected instead of throwingArgumentNullException. Its callers areSidebarAdapter.SetToolForCurrentArea(NavBarAdapter.cs:624) and SidePaneTests.cs:456; neither relied on the exception.Findings
Critical - Must address before merge
None.
Important - Should address before merge
None.
Minor - Consider
If the try/finally ever regresses,(left as is: the only remedy is resetting a private static by reflection, and the flag test itself fails with a clear message)ListPropertyChoiceClickTestsleaves the static flag set andSidebarAdapterSelectionTests.ItemSelectedOutsideTheAdapter_StillSetsThePropertyfails in the same runInterview Notes
SidePane.CurrentItem, rather than a guard inSetToolForCurrentArea.🤖 Generated with Claude Code
This change is