Skip to content

fix(web): keep Settings focus and restart progress clear - #1116

Merged
frahlg merged 2 commits into
masterfrom
fix/settings-dialog-focus
Sep 7, 2026
Merged

fix(web): keep Settings focus and restart progress clear#1116
frahlg merged 2 commits into
masterfrom
fix/settings-dialog-focus

Conversation

@frahlg

@frahlg frahlg commented Sep 7, 2026

Copy link
Copy Markdown
Member

Settings left keyboard focus behind its overlay. Tab could leave the form,
Escape did not close it, and Close did not return focus to the opening button.
The dialog now takes focus after loading, keeps Tab within its visible controls,
and returns focus on close, including when More opens it on mobile. Controls in
closed sections stay out of the tab order. An action that replaces its own
button keeps focus on the selected Settings tab.

The restart prompt keeps focus while open and makes the background inert.
Tab cycles through its two buttons; Escape chooses Restart later while idle.
During a pending restart, focus stays on the prompt and Escape cannot close
it. Closing restores the prior background state and focus. Progress stays
hidden until Restart now sends the request; a local CSS rule fixes the
earlier premature “Restarting…” message.

Validation:

  • 577 web tests pass, including ten new keyboard behavior tests.
  • make verify passes.
  • Chrome desktop and 390 x 844: open, both Tab boundaries, collapsed/open
    Chargers sections, in-form tab changes, Escape, Close and opener focus.
  • Synthetic restart responses: idle and Later hide progress; a pending request
    shows it; a failed request hides it again and enables both buttons. Tab and
    Shift+Tab stay within the top prompt, including while buttons are disabled.
    Escape closes it while idle and keeps it open while pending. Chrome's native
    accessibility tree exposes only that prompt.

Browser checks used the actual web files with local synthetic APIs. No physical
box config or restart was performed. Human visual review remains per AGENTS.md.

Base: 8617c7e, including #1115. The coordinator reviewed the overlapping files
in #1052, #826 and #735: their settings.js help/escaping and style.css tooltip
changes cover separate code. This PR leaves those sections, the Weather tab,
maps and index.html untouched.


Note

Low Risk
Client-only settings UI and accessibility behavior; no API or config persistence changes beyond existing restart/save flows.

Overview
Improves keyboard and screen-reader behavior for the Settings overlay and the post-save restart required prompt.

Settings now exposes proper dialog semantics (role, aria-modal, label), moves focus to the close control after config loads (without stealing focus during the fetch), traps Tab to visible/enabled controls (including closed <details> summaries only until opened), closes on Escape and backdrop click via shared closeSettings(), and returns focus to whoever opened it—including the More menu shortcut—not invalid hidden/disconnected openers. Tab re-renders that drop focus fall back to the active tab or close button.

Restart prompt ignores duplicate save responses while open or pending, marks the inner panel as a modal dialog, sets inert on other page roots (without clearing pre-existing inert), focuses Restart later, wraps Tab between the two actions, treats Escape as Later only when buttons are enabled, locks focus on the dialog during an in-flight restart (Escape cannot dismiss), and restores prior focus/inert on close. Restart progress stays hidden until Restart now runs; CSS adds #restart-progress.hidden { display: none }.

Adds a large settings-shell.test.mjs suite with a richer DOM shim covering these flows.

Reviewed by Cursor Bugbot for commit 0de0c9c. Bugbot is set up for automated code reviews on this repo. Configure here.

@frahlg
frahlg force-pushed the fix/settings-dialog-focus branch from 5cc8178 to 0de0c9c Compare September 7, 2026 19:34
@frahlg
frahlg marked this pull request as ready for review September 7, 2026 19:40
@frahlg
frahlg merged commit f7cf38e into master Sep 7, 2026
13 checks passed
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 7, 2026

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review Completed 2026-09-07T19:41:21.575654Z 0de0c9c Draft marked ready
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@cursor

cursor Bot commented Sep 7, 2026

Copy link
Copy Markdown

Bugbot couldn't run - usage limit reached

Bugbot is counted against Cursor usage for this user or team, and this run hit a usage or spend limit.

A user or team admin can review and increase usage limits in the Cursor dashboard.

(requestId: serverGenReqId_8bd37f57-1623-4830-a9f6-397caa82baf0)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant