[PR #2546] [CLOSED] web: the closed Sampling drawer leaves the keyboard's Tab order; opening it focuses it, closing returns focus #4110

Closed
opened 2026-11-07 15:33:18 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/Niko1221/Strata/pull/2546
Author: @qiuzan2001
Created: 10/15/2026
Status: ❌ Closed

Base: main ← Head: chief-docs/drawer-focus


📝 Commits (1)

  • b333897 web: the closed Sampling drawer leaves the keyboard's Tab order; opening it focuses it, closing returns focus

📊 Changes

3 files changed (+16 additions, -2 deletions)

View changed files

📝 serve/test_server.py (+11 -0)
📝 serve/web/app.js (+4 -1)
📝 serve/web/index.html (+1 -1)

📄 Description

What it changes. Closed, the Chat page's Sampling drawer is only moved off-screen (transform: translateX(100%)), so its 14 controls (Close, the four Thinking buttons, temperature, top-p, top-k, max tokens, seed, the switches, Reset, Apply) stayed in the keyboard's Tab order right after Send, inside aria-hidden="true". A keyboard user tabbed through invisible buttons, and a screen reader landed on controls it was told were hidden. Now:

  • the drawer is inert while closed (in index.html at load, and set in openDrawer);
  • opening it moves focus to its Close button (before, focus stayed on the button behind the scrim);
  • closing it (Escape, Close, Apply, a click on the scrim) puts focus back on the Sampling button (before, after Escape focus stayed on a button that was now off-screen).

What it leaves alone. The drawer's look, its settings and what they send, and every other part of the page. A browser without inert (Chrome < 102, Firefox < 112, Safari < 15.5) behaves as before, plus the focus moves.

How it was checked.

  • Headless Chromium (Playwright) against a running Strata 0.1.44.1 server (RTX 5070 Ti, Linux), with this branch's index.html and app.js served in place of the release's, Tab pressed 30 times from the message box:
    • before: 14 drawer controls reached with the drawer closed; after opening, focus on sampling-btn; after Escape, focus on a button inside the closed drawer;
    • after: 0 drawer controls reached; after opening, focus on drawer-close and Tab moves through the drawer; after Escape, focus on sampling-btn.
  • New static test WebApp.test_the_closed_drawer_is_out_of_the_tab_order (fails without the change). python -m unittest serve.test_server serve.test_security serve.test_frontend serve.test_request_hardening serve.test_monitor serve.test_runconfig: all pass (392 tests).

🤖 Generated with Claude Code


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/Niko1221/Strata/pull/2546 **Author:** [@qiuzan2001](https://github.com/qiuzan2001) **Created:** 10/15/2026 **Status:** ❌ Closed **Base:** `main` ← **Head:** `chief-docs/drawer-focus` --- ### 📝 Commits (1) - [`b333897`](https://github.com/Niko1221/Strata/commit/b333897412dd67404e9b56eeec4757c222575a33) web: the closed Sampling drawer leaves the keyboard's Tab order; opening it focuses it, closing returns focus ### 📊 Changes **3 files changed** (+16 additions, -2 deletions) <details> <summary>View changed files</summary> 📝 `serve/test_server.py` (+11 -0) 📝 `serve/web/app.js` (+4 -1) 📝 `serve/web/index.html` (+1 -1) </details> ### 📄 Description **What it changes.** Closed, the Chat page's Sampling drawer is only moved off-screen (`transform: translateX(100%)`), so its 14 controls (Close, the four Thinking buttons, temperature, top-p, top-k, max tokens, seed, the switches, Reset, Apply) stayed in the keyboard's Tab order right after **Send**, inside `aria-hidden="true"`. A keyboard user tabbed through invisible buttons, and a screen reader landed on controls it was told were hidden. Now: - the drawer is `inert` while closed (in `index.html` at load, and set in `openDrawer`); - opening it moves focus to its **Close** button (before, focus stayed on the button behind the scrim); - closing it (Escape, Close, Apply, a click on the scrim) puts focus back on the **Sampling** button (before, after Escape focus stayed on a button that was now off-screen). **What it leaves alone.** The drawer's look, its settings and what they send, and every other part of the page. A browser without `inert` (Chrome < 102, Firefox < 112, Safari < 15.5) behaves as before, plus the focus moves. **How it was checked.** - Headless Chromium (Playwright) against a running Strata 0.1.44.1 server (RTX 5070 Ti, Linux), with this branch's `index.html` and `app.js` served in place of the release's, Tab pressed 30 times from the message box: - before: 14 drawer controls reached with the drawer closed; after opening, focus on `sampling-btn`; after Escape, focus on a button inside the closed drawer; - after: 0 drawer controls reached; after opening, focus on `drawer-close` and Tab moves through the drawer; after Escape, focus on `sampling-btn`. - New static test `WebApp.test_the_closed_drawer_is_out_of_the_tab_order` (fails without the change). `python -m unittest serve.test_server serve.test_security serve.test_frontend serve.test_request_hardening serve.test_monitor serve.test_runconfig`: all pass (392 tests). 🤖 Generated with [Claude Code](https://claude.com/claude-code) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-07 15:33:18 +07:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Niko1221/Strata#4110
No description provided.