Skip to content

Fix guest voucher portal focus, motion, and browser redemption - #50

Open
compnew2006 wants to merge 1 commit into
UserJoo9:mainfrom
compnew2006:codex/qm-08-captive-accessibility
Open

compnew2006 wants to merge 1 commit into
UserJoo9:mainfrom
compnew2006:codex/qm-08-captive-accessibility

Conversation

@compnew2006

Copy link
Copy Markdown
Contributor

Problem

The guest voucher form was marked hidden after approval, but the page's explicit grid layout overrode the native hidden styling. It also exposed an empty feedback region in the initial state. The status indicators kept animating for users who asked for reduced motion. An actual browser session exposed one more problem. If the browser retained a dashboard session cookie, the portal's voucher submission omitted the existing request-verification header and failed with HTTP 403 before redemption.

Changes

  • Respect the HTML hidden state for the voucher form and its feedback, and transfer focus to the browse action when approval hides a focused form.
  • Turn off the status-dot and ring animations when reduced motion is requested.
  • Add the same request-verification header that the dashboard already sends. Keep the server's protection and voucher rules in place.

Before and after

Scenario Before After
A valid voucher is accepted with focus in the form The form remains visible after approval The form is hidden, skipped by Tab, and focus moves to the browse link
The operating system requests reduced motion The status indicator keeps blinking The portal renders static status indicators
The browser retains its dashboard session cookie The voucher request can return HTTP 403 The request follows the existing CSRF header contract and reaches voucher validation

The change affects the standalone guest portal. It needs no data migration or new dependency. Reverting this PR restores the prior presentation and request headers.

Verification

  • Added regressions for the hidden state, focus, reduced motion and the request header.
  • Playwright MCP against a local FastAPI fixture verified desktop and phone widths, English and Arabic portal content, keyboard focus, reduced motion, and valid and invalid redemption with a real fixture session cookie. The invalid code returned 400 and the valid one returned 200, hid the form, moved focus, and redirected. The gateway's enforcement snapshot was simulated.
  • The captive and static UI suites passed locally (33 tests). Repository pyflakes and whitespace checks also passed.

This branch has not been deployed

No deployments
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