Skip to content

fix(aux-window): make the tool window behave as the modal it says it is - #138

Merged
thethinkmachine merged 1 commit into
mainfrom
fix/aux-window-modal
Oct 5, 2026
Merged

thethinkmachine merged 1 commit into
mainfrom
fix/aux-window-modal

Conversation

@thethinkmachine

Copy link
Copy Markdown
Owner

The window Library, Algorithms, Grammar and Reference share is aria-modal, but several things reached through it or hid behind it. Each was reproduced in headless Chromium before the fix and checked there after.

Behaviour

  • Canvas shortcuts leaked through. With the window open, Delete removed the selected states behind it; S/T/V/D switched the canvas tool, Shift+X raised the Clear confirm, Enter and the arrows stepped the simulation. auxWindowKey in ui.js now lets through only the window's own keys (Escape, view digits, the UTM simulator's keys in Algorithms) plus save and reopen-closed-tab.
  • Shift+Tab escaped the focus trap. It counted the strip's inactive tabs (tabindex=-1) as first and last. It now counts Tab stops only, and skips a collapsed phone sheet (visibility: hidden).
  • Escape in a field did nothing. It now closes the window, after a popover that took the key or a non-empty search box.
  • Messages from inside the window were invisible. showStatus wrote to the canvas toast under the window; while the window is open it writes to a new #aux-status.

Layering

  • .sym-suggest raised from 800 to 1100. It completes fields in the Algorithms and Grammar views and in the transition dialog's multi-tape Write fields, and was drawn under both the window (890) and modals (900).
  • On a phone the window is now z 195, under the header (a stacking context at 200). At 890 it covered every menu the header drops: More, the model picker, the workspace list.

Visual

  • Phone Grammar had a second 16px inset stacked on its children's own 14px, so content sat 30px from the edge. Its actions now start at the left when they wrap.
  • The Library rail gets the top inset the other three rails have.

Tests: four new cases in tests/aux-window.test.js: keys stop at the window, Escape from a field, the in-window toast, and the z-index relationships. Full suite: 2819 pass. npm run build succeeds.

- Canvas shortcuts stop at the window: Delete removed selected states from
  behind the Library, and S/T/V/D, Shift+X, Enter and the arrows reached the
  hidden canvas. Only the window's own keys and save/reopen get through.
- The focus trap counts Tab stops only, so Shift+Tab no longer walks out past
  the roving-tabindex tabs; a collapsed phone sheet is not a stop either.
- Escape from a field inside the window closes it, after any popover or
  non-empty search box has had the key.
- showStatus writes to the window's own toast while it is open; the canvas
  toast was underneath it.
- The symbol-suggest popover sits above the window and the modals (1100).
- On a phone the window sits under the header (195 < 200), so the menus the
  header drops are no longer covered.
- Phone Grammar loses its doubled padding and left-aligns its actions; the
  Library rail gets the top inset the other rails have.
Copilot AI balanced review requested due to automatic review settings October 5, 2026 01:07

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@thethinkmachine
thethinkmachine merged commit 0735df9 into main Oct 5, 2026
17 checks passed
@thethinkmachine
thethinkmachine deleted the fix/aux-window-modal branch October 5, 2026 01:07
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.

2 participants