ReviewOS

stacks/the-settlers-iii-remake

Keep new-settlement confirmation keyboard focus inside its dialog

#224
Closed chris opened this 6 days ago ·
6 days ago

The production New settlement confirmation does not take or contain keyboard focus. In the rebuilt browser game, opening it leaves focus on the header button; pressing Tab focuses the map canvas behind the confirmation. Escape then reaches the map and leaves the confirmation open. Its accessibility node is an unnamed container rather than a named dialog.

Reproduction through actual browser input:

  1. Start and pause an original tutorial settlement.
  2. Click New settlement.
  3. Press Tab. The focused element is the Settlement map canvas, while Start a new settlement? remains visible.
  4. Press Escape. The confirmation remains visible and focus remains on the map.

Source owner: the application confirmation in resources/views/index.stx, using maintained stx/Stacks UI focus and dialog primitives. Related #90 and the shared keyboard controls. Do not add document/window access to the STX script or copy a framework focus runtime into the app.

Acceptance:

  • Retain a real production-browser keyboard regression for opening, Tab/Shift+Tab, Escape and focus restoration.
  • Give the confirmation its proper accessible name and dialog semantics. Focus the seed input or another appropriate initial control when it opens.
  • Contain keyboard navigation and prevent underlying game shortcuts while the confirmation is open. Preserve its own input editing.
  • Restore focus to New settlement when cancelled, and to the map after starting a new settlement. Retain seed validation/error behavior and existing checkpoint replacement behavior.
  • Use maintained stx/Stacks UI capabilities, correcting an upstream defect in its owner if the required primitive does not deliver its documented behavior.
  • Verify short desktop and narrow screens, reduced motion, lint/types and the full production browser gate. Qualify pushed CI diagnostics before closing.

The separate remembered-world correction is tracked in #222.

6 days ago

The confirmation now uses the maintained STX Dialog with a named title, initial seed focus, contained Tab/Shift+Tab navigation, Escape/cancel focus restoration, invalid-seed focus, and map focus after starting a new settlement. The panel fits desktop, short landscape and narrow phone viewports. Native browser input passed those flows at all three sizes, including a saved seed surviving checkpoint reload and reduced-motion/device-scale checks.

The added native outside-click check exposed an upstream component defect: DialogPanel's full-screen layout covers DialogBackdrop. The owning fix and native pointer regressions are tracked in stacksjs/stx#2124. Both centered and sheet variants now pass locally with the source correction. Publication, Stacks adoption and the production game gate remain required before this issue closes.

6 days ago

The confirmation now uses the maintained dialog components. It takes seed focus, contains Tab and Shift+Tab, preserves native input editing and validation, restores the opener on cancellation, and focuses the map after replacing the settlement. The upstream backdrop hit-testing defect is corrected in STX #2124, delivered through STX 0.2.719 and Stacks 0.75.328.

The new production-browser regression passed 135 steps across desktop, short landscape at 2x, and narrow screens with reduced motion. All 17 local browser suites passed 681 steps, including the unchanged ten-minute rival battle, with no recorded browser errors. Unit tests passed 426 tests; lint, types, original assets and the production build passed too.

The receipt includes original publication verification and the UI review. CI is running; this stays open until its browser diagnostics are qualified.

6 days ago

The settlement confirmation now has named dialog semantics, seed focus, contained keyboard navigation, native input editing and validation, Escape/cancel/outside-click dismissal, and correct focus restoration. Successful replacement focuses the map and restores the new checkpoint on reload. Short and narrow screens retain usable scrolling and visible focus; placeholder contrast and paragraph spacing are improved.

CI passed: 426 unit tests and all 17 production-browser suites, totaling 681 steps with no recorded browser errors. The original diagnostic ZIP was downloaded and checked against its API digest, size, every CRC and the exact JSON/log allowlist. The full rival battle and existing original-terrain checks were retained.

The receipt records the upstream fixes and verified STX 0.2.719 / Stacks 0.75.328 adoption. This completes the confirmation issue; broader game accessibility and original Gold qualification remain separate work.

Sign in to comment on this issue.