You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
BUG: Saved-run technique and objective dialogs do not restore opener focus #3915
Closing saved-run Techniques and Objectives detail dialogs does not return keyboard focus to the button that opened them. Both Close and Escape leave BODY focused, interrupting sequential keyboard inspection.
Related hierarchy PR #3611 is merged (2026-11-01). Its focus work concerns saved-result Details; this report concerns the separate read-only Techniques and Objectives dialogs. Filed separately as requested because that PR is no longer open. No competing hierarchy implementation is proposed.
Historical source: frontend/src/components/Scenarios/ScenarioRunPage.tsx:658-665,708-724,812-813 and ScenarioRunDialogs.tsx:22-34,79-91 at the tested revision.
Steps/Code to Reproduce
Open a saved Scanner run containing multiple technique and objective detail buttons.
Focus and open a Techniques detail button, then activate Close.
Inspect document.activeElement and press Tab.
Repeat with another technique, dismissing with Escape.
Repeat Close/Escape for Objectives detail buttons.
The original fixture used a real local backend/private SQLite run plan, actual React UI and two fresh Chrome contexts. The saved plan was synthetic and had no executions. An assertion that the technique opener regained focus failed.
Expected Results
Restore focus to each still-mounted opening button after Close/Escape. Use a correctly associated Fluent DialogTrigger or per-dialog opening-element reference. Do not focus detached elements after navigation.
Cover both dialogs, multiple openers, keyboard activation, Close/Escape, reopening, and navigation/unmount safety. Preserve the existing read-only metadata behavior.
Actual Results
All four measured closures left BODY focused with triggerFocused=false. The next Tab focused the fixture's last objective instead of preserving the opener's inspection position.
No stored result changes, scan execution, or objective-text loss. Progress API content remained unchanged, and browser API traffic was GET-only.
Screenshots
Historical screenshots and exact active-element/network captures retained locally; no hosted attachment in this report.
Versions
Linux; headless installed Google Chrome, Playwright 1.64.1; PyRIT 1.2.0.dev0 at 01ce6ca66a315770b36c7dca1f320668c0d92d7c. Historical real browser/local backend reproduction, not a fresh latest-main retest. No screen reader, platform matrix, Azure, provider inference, or real attack execution. Full package-version output was not collected.
Scope update: #3938 is merged and restores opener focus for the saved-run Objectives dialog on both Close and Escape, with regression tests. The Techniques detail dialog is not covered by that change, so this issue now tracks the Techniques dialog only: restore focus to the opening button on Close and Escape, mirroring the approach in #3938.
Before writing code I checked current main, and the separate Techniques dialog the report describes (ScenarioRunDialogs.tsx:22-34 at the tested revision) no longer exists: ScenarioRunDialogs.tsx now only has ObjectiveDetailsDialog. Technique details open in the attack details dialog in ScenarioRunPage.tsx, and its Close button, the title's dismiss button and onOpenChange (Escape) all go through closeAttemptDetails(), which already restores focus to the stored opener when it's still connected, falling back to the groups toggle or the overview.
#3938 added a test for the Escape path from a technique's "Open details for ..." button. What isn't covered yet is the Close button and the dismiss icon from that opener, and keyboard activation of it. So my plan is:
Reproduce on main with keyboard activation (Enter on the opener) for Close, the dismiss icon and Escape.
Verified on current main: the separate Techniques dialog no longer exists (ScenarioRunDialogs.tsx only has ObjectiveDetailsDialog), technique details open in the attack details dialog, and all of its close paths — the dismiss button and Escape — go through useScenarioRunAttackDetails.close(), which restores focus to the stored opener when it is still connected. The Objectives half was fixed by #3938 with regression tests. So the behavior this issue reported is resolved; the remaining test coverage for the Close path from a technique opener is #4191. Closing in favor of that PR — thanks Khushi (@khushi-git-7) for flagging the staleness and picking up the tests.
Follow-up to the close note: #4191 was closed rather than merged — the scan results redesign (#4031/#4032) removed the UI its test targeted, and the rewritten ScenarioRunPage.test.tsx on main already covers the equivalent focus-restore paths, so no coverage gap remains.
Activity
romanlutz commentedon Nov 10, 2026
Scope update: #3938 is merged and restores opener focus for the saved-run Objectives dialog on both Close and Escape, with regression tests. The Techniques detail dialog is not covered by that change, so this issue now tracks the Techniques dialog only: restore focus to the opening button on Close and Escape, mirroring the approach in #3938.
khushi-git-7 commentedon Nov 10, 2026
I would like to take this.
Before writing code I checked current
main, and the separate Techniques dialog the report describes (ScenarioRunDialogs.tsx:22-34at the tested revision) no longer exists:ScenarioRunDialogs.tsxnow only hasObjectiveDetailsDialog. Technique details open in the attack details dialog inScenarioRunPage.tsx, and its Close button, the title's dismiss button andonOpenChange(Escape) all go throughcloseAttemptDetails(), which already restores focus to the stored opener when it's still connected, falling back to the groups toggle or the overview.#3938 added a test for the Escape path from a technique's "Open details for ..." button. What isn't covered yet is the Close button and the dismiss icon from that opener, and keyboard activation of it. So my plan is:
mainwith keyboard activation (Enter on the opener) for Close, the dismiss icon and Escape.ScenarioRunPage.test.tsxso it stays fixed, and this can be closed.closeAttemptDetails()the same way Restore opener focus for saved-run objective dialog (Escape and reopen) #3938 did for objectives, with tests for each path and for reopening.Does that sound right, Roman Lutz (@romanlutz)?
romanlutz commentedon Nov 18, 2026
Verified on current main: the separate Techniques dialog no longer exists (
ScenarioRunDialogs.tsxonly hasObjectiveDetailsDialog), technique details open in the attack details dialog, and all of its close paths — the dismiss button and Escape — go throughuseScenarioRunAttackDetails.close(), which restores focus to the stored opener when it is still connected. The Objectives half was fixed by #3938 with regression tests. So the behavior this issue reported is resolved; the remaining test coverage for the Close path from a technique opener is #4191. Closing in favor of that PR — thanks Khushi (@khushi-git-7) for flagging the staleness and picking up the tests.romanlutz commentedon Nov 18, 2026
Follow-up to the close note: #4191 was closed rather than merged — the scan results redesign (#4031/#4032) removed the UI its test targeted, and the rewritten
ScenarioRunPage.test.tsxon main already covers the equivalent focus-restore paths, so no coverage gap remains.