fix(webui): gate focus indicators on keyboard navigation modality (#6734)
This commit is contained in:
1 parent
cb95277098
commit
c6fd1b3ecb
24 files changed
+355
-86
No files matched your search
@@ -4,9 +4,12 @@ import { ContextInspector } from "@/components/thread/ContextInspector";
|
||||
import { ComposerUsagePopover } from "@/components/thread/ComposerUsagePopover";
|
||||
import { TooltipProvider } from "@/components/ui/tooltip";
|
||||
import { initializeI18n } from "@/i18n";
|
||||
import { installFocusModality } from "@/lib/focus-modality";
|
||||
import type { ContextSnapshot } from "@/lib/types";
|
||||
import "../src/globals.css";
|
||||
|
||||
installFocusModality();
|
||||
|
||||
const snapshots: ContextSnapshot[] = [
|
||||
{ id: "first", contextWindowTokens: 10000, usage: { prompt_tokens: 1000 }, graph: {
|
||||
nodes: [{ path: "/a.md", name: "a.md", state: "loaded", tokens: 100 }], edges: [],
|
||||
|
||||
@@ -260,3 +260,20 @@ for (const [file, renderedIndex, sourceLine, reverse] of [["long.ts", 58, 59, fa
|
||||
await expect(line).toHaveCount(0);
|
||||
});
|
||||
}
|
||||
|
||||
test("diff toggle stays quiet on Shift+click and Escape, then shows ring on keyboard Tab", async ({ page }) => {
|
||||
await page.goto("/browser/fixture.html?case=file-diff");
|
||||
const toggle = page.getByRole("region", { name: "long.ts", exact: true }).getByTestId("file-edit-diff-toggle");
|
||||
await page.keyboard.down("Shift");
|
||||
await toggle.click();
|
||||
await page.keyboard.press("Escape");
|
||||
await page.keyboard.up("Shift");
|
||||
await expect(toggle).toBeFocused();
|
||||
await expect(toggle).toHaveCSS("outline-style", "none");
|
||||
await expect(toggle).toHaveCSS("box-shadow", "none");
|
||||
|
||||
await page.keyboard.press("Tab");
|
||||
await page.keyboard.press("Shift+Tab");
|
||||
await expect(toggle).toBeFocused();
|
||||
expect(await toggle.evaluate((node) => getComputedStyle(node).boxShadow)).not.toBe("none");
|
||||
});
|
||||
@@ -4,8 +4,11 @@ import { createRoot } from "react-dom/client";
|
||||
import { TooltipProvider } from "@/components/ui/tooltip";
|
||||
import { initializeI18n, setAppLanguage } from "@/i18n";
|
||||
import { LOCALE_STORAGE_KEY, normalizeLocale } from "@/i18n/config";
|
||||
import { installFocusModality } from "@/lib/focus-modality";
|
||||
import "../src/globals.css";
|
||||
|
||||
installFocusModality();
|
||||
|
||||
const parameters = new URLSearchParams(location.search);
|
||||
const fixtureCase = parameters.get("case");
|
||||
const historyPreview = parameters.get("preview");
|
||||
|
||||
@@ -12,8 +12,11 @@ import { DropdownMenu, DropdownMenuContent, DropdownMenuItem, DropdownMenuTrigge
|
||||
import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from "@/components/ui/select";
|
||||
import { TooltipProvider } from "@/components/ui/tooltip";
|
||||
import { initializeI18n } from "@/i18n";
|
||||
import { installFocusModality } from "@/lib/focus-modality";
|
||||
import "../src/globals.css";
|
||||
|
||||
installFocusModality();
|
||||
|
||||
function OverlayFocusFixture() {
|
||||
const composer = useRef<HTMLTextAreaElement>(null);
|
||||
const [preset, setPreset] = useState("First model");
|
||||
|
||||
Reference in new issue
Block a user