Don't toggle a SettingsExpander when typing Space in a header TextBox #21021
All Vouch review confidence checks passed
Residual risk 0.19 = Change Risk (0.48) × (1 − Review Confidence (0.60)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.48 · 399 lines diff across 4 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.17 · 1 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Diff Size
diff_size
0.358
Shallow Review Depth
shallow_review_depth
0.289
Ai Authored
ai_authored
0.050
Real PR Conversation Timeline
1 comments
"Review active on #21021"
general
weight: 0.35
DHowett
If you typed in a space bar into the name field. the expander would flip vs putting in a space. This now allows a space to be put in.
If the expander is in focus and space is hit, it will expand / collapse still.
I manually validated put typing and expanding work now.
<img width="1101" height="413" alt="image" src="https://github.com/user-attachments/assets/3a51eb11-289a-4272-bba5-db71e40a2bf2" />
<!-- copilot-assessment:v1 -->
Agent assessment
Self-reported assessment, not an independent review.
Assessed revision:
7ddaaec103494d9255e8b53665397416cc734312| Dimension | Assessment | Rationale |
|---|---|---|
| Change confidence | 8.5/10 | ↑ Verified by hand in Terminal Dev with a real keyboard: Space types, no toggle; header Space still toggles.<br>↑ Same result from a scripted UIA check; key handling for the header itself is unchanged.<br>↓ Background image path box and the "Add a new profile" split button in a header weren't checked by hand.<br>↓ No automated test; gamepad and Narrator not checked. |
| Diagnosis confidence | 9.5/10 | ↑ ButtonBase key handling acts on any Space/Enter that bubbles to it and marks KeyDown handled.<br>↑ Scripted check reproduced the toggle on the unfixed build and not on the fixed one. |
| Evidence fit | 9.5/10 | ↑ Exactly the reported symptom (Space in profile Name toggles the expander), reproduced and fixed on a Dev build. |
<!-- /copilot-assessment -->
Summary of the Pull Request
Typing Space in a TextBox that sits in a SettingsExpander header (profile Name, background image path) toggled the expander instead of typing the space.
References and Relevant Issues
Regressed by #20232 (background image path moved into the expander header) and #20336 (profile Name moved into an expander header).
Detailed Description of the Pull Request / Additional comments
The expander header is a ToggleButton, and everything in
SettingsExpander.Contentlives inside it. ButtonBase acts on any Space/Enter/GamepadA that bubbles up to it, not just keys aimed at itself, and marks the KeyDown handled, so the TextBox never gets the character.The template's header ToggleButton is now
SettingsExpanderHeaderButton, a ToggleButton subclass that only passes key events to the base class whenOriginalSourceis the button itself. Keys from hosted controls stay unhandled. Space/Enter on the header itself still toggles.Validation Steps Performed
msbuild OpenConsole.slnx /p:Configuration=Debug /p:Platform=ARM64 "/t:Terminal\CascadiaPackage" /m: passed, deployed as Terminal Dev.PR Checklist
- If checked, please file a pull request on our docs repo and link it here: #xxx