debug: default triggered breakpoint picker to first breakpoint#313453
debug: default triggered breakpoint picker to first breakpoint#313453connor4312 merged 4 commits intomicrosoft:mainfrom
Conversation
There was a problem hiding this comment.
Pull request overview
Updates the debug breakpoint widget’s “Add Triggered Breakpoint…” flow so the trigger-breakpoint picker defaults to the first available breakpoint candidate (instead of defaulting to “None”) when candidates exist.
Changes:
- Adjusts triggered-breakpoint list refresh logic to auto-select the first available trigger candidate when no existing
triggeredByselection is present. - Preserves an existing
triggeredByselection when editing, as long as the referenced breakpoint still exists.
| // If no triggeredByBreakpointInput is set and there are available breakpoints, select the first one by default | ||
| if (!this.triggeredByBreakpointInput && this.availableBreakpoints.length > 0) { | ||
| this.triggeredByBreakpointInput = this.availableBreakpoints[0]; | ||
| selectedIndex = 1; | ||
| } |
There was a problem hiding this comment.
updateTriggerBreakpointList now auto-selects the first available breakpoint whenever triggeredByBreakpointInput is falsy. That also includes the state after a user explicitly selects "None" (which sets triggeredByBreakpointInput = undefined), so any subsequent refresh (e.g. breakpoint model change while the widget is open, or switching away from and back to the Trigger Point context) will override the user’s explicit "None" choice and re-select the first breakpoint.
Consider tracking an explicit "no trigger" selection separately (e.g. a userSelectedNone/hasUserSetTriggerSelection flag, or using null as an explicit sentinel distinct from the initial undefined), and only applying the default-to-first behavior when the selection hasn’t been set by the user yet (or only once on initial entry into Trigger Point mode).
There was a problem hiding this comment.
Good catch — agreed.
I updated the change so the default-to-first behavior only applies during the initial triggered-breakpoint picker setup. The breakpoint-list refresh path now only preserves an existing selected trigger if it still exists, otherwise it clears to None; it no longer reselects the first candidate just because the current selection is empty.
ae98c9f to
fc1aae4
Compare
|
@microsoft-github-policy-service agree |
Fixes #312509
Summary
Updates the "Add Triggered Breakpoint..." flow so that when valid trigger breakpoint candidates exist, the picker defaults to the first available breakpoint instead of defaulting to
None.The
Noneoption remains available so users can still clear or avoid a trigger relationship.Behavior
Before:
Noneeven when valid trigger breakpoints existed.After:
None.triggeredByselections are preserved when editing.Manual Validation
Validated locally in Code - OSS using a manual fixture workspace.
None.Nonebehavior appears unchanged: first candidate selected when available,Noneselected when no candidates exist.triggeredByreturned it to a normal breakpoint.Notes