Files
MBN_STOCK_WEBVIEW/docs/UC1_TREE_EVENT_PARITY.md

1.9 KiB

UC1 tree event parity

Source evidence is the read-only original C:\Users\MD\source\repos\MBN_STOCK_N\MBN_STOCK_N\Control\UC1.cs:

  • UC1_Load checks Expand, selects the first rendered root, and calls EnsureVisible.
  • treeView_MouseDown, treeView_BeforeExpand, and treeView_BeforeCollapse prevent a double-click from also changing a root's expanded state.
  • treeView_DoubleClick activates either the selected leaf or every direct child of the selected root.
  • chE_CheckedChanged expands or collapses every root. Collapsing does not clear SelectedNode.

The WebView tree therefore owns only presentation state (open roots, selected node, focused node, and scroll position). C# remains the authority for every leaf/root action. A root label click selects without expanding; only its disclosure glyph changes open. A root or leaf double-click emits one closed native intent and does not invoke the browser's whole-summary toggle.

On each real tab activation/re-entry the presentation state is recreated like the original UC1: Expand is checked, all sections are open, and the first root is selected, focused, and scrolled into view. State-only renders within the same activation preserve per-section open state, selection, focus, and scroll position. Busy and fixed-section-batch states reject both actions and local expand/collapse changes.

Intentional defect exclusion

The original treeView_DoubleClick reads uc_3.FpSpread in the parent-node path before checking which UC1 file is active. For UC1 instances constructed with uc_3 == null, that can throw NullReferenceException; the surrounding empty catch silently drops the operator action. This is an original defect, not observable intended behavior, so the migration does not reproduce it. The WebView sends only the selected root identity and C# validates/materializes the corresponding section without dereferencing an unrelated comparison control.