fix(studio): shell UX — data-loss guards, error surfacing, dialog contracts, toasts (#1964)

This commit is contained in:
Vance Ingalls
2026-07-06 16:56:06 -07:00
committed by GitHub
parent ccc1308839
commit 89e36da13d
23 changed files with 700 additions and 281 deletions
@@ -30,21 +30,27 @@ function renderToolbar() {
describe("TimelineToolbar — auto-keyframe toggle (#1808)", () => {
it("renders enabled (pressed) by default with no selection", () => {
const { host, root } = renderToolbar();
const btn = host.querySelector<HTMLButtonElement>('button[aria-pressed="true"]');
const btn = host.querySelector<HTMLButtonElement>(
'button[aria-label="Auto-record manual edits as keyframes"]',
);
expect(btn).not.toBeNull();
expect(btn?.getAttribute("aria-pressed")).toBe("true");
act(() => root.unmount());
});
it("flips autoKeyframeEnabled in the store when clicked", () => {
const { host, root } = renderToolbar();
const btn = host.querySelector<HTMLButtonElement>('button[aria-pressed="true"]')!;
const btn = host.querySelector<HTMLButtonElement>(
'button[aria-label="Auto-record manual edits as keyframes"]',
);
if (!btn) throw new Error("auto-keyframe toggle not rendered");
act(() => {
btn.dispatchEvent(new MouseEvent("click", { bubbles: true }));
});
expect(usePlayerStore.getState().autoKeyframeEnabled).toBe(false);
expect(host.querySelector('button[aria-pressed="false"]')).not.toBeNull();
expect(btn.getAttribute("aria-pressed")).toBe("false");
act(() => root.unmount());
});
});