fix(webui): scope sidebar autofocus to mobile navigation

This commit is contained in:
Xubin Ren committed 2026-09-21 16:26:57 +08:00
1 parent 13319dfe15
commit 7a317c3968
6 files changed
+98 -159

No files matched your search

+5
View File
@@ -287,8 +287,10 @@ import {
fetchBootstrap,
} from "@/lib/bootstrap";
import App from "@/App";
import { mockBrowserFocus } from "./browser-focus";
describe("App layout", () => {
let restoreBrowserFocus: (() => void) | undefined;
beforeEach(async () => {
await i18n.changeLanguage("en");
mockSessions = [];
@@ -342,6 +344,8 @@ describe("App layout", () => {
afterEach(() => {
cleanup();
restoreBrowserFocus?.();
restoreBrowserFocus = undefined;
Reflect.deleteProperty(window, "nanobotHost");
vi.useRealTimers();
vi.unstubAllGlobals();
@@ -2200,6 +2204,7 @@ describe("App layout", () => {
}, 15_000);
it("opens a mobile topic with one click and closes the drawer without a search tooltip", async () => {
restoreBrowserFocus = mockBrowserFocus();
const user = userEvent.setup();
mockSessions = ["First", "Second"].map((title, index) => ({
key: `websocket:mobile-${index}`,