M1.5: main window layout and project tree against mocked engine events
Left Project tool window (hide/show stripe, pointer and keyboard resize), editor area placeholder and status bar. Project tree with lazy project.children listings, WAI-ARIA keyboard navigation, Lucide icons, dimmed ignored/excluded entries and refresh on TreeChanged. Empty state runs project.openDialog. Pinia store fed only by engine events and command results; events come through a local onEngineEvent adapter until the desktop bridge (M1.4) lands. Lucide via @lucide/vue (the renamed lucide-vue-next, ISC). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
parent
faadb05eb3
commit
003b7970e6
16 changed files with 1541 additions and 32 deletions
46
ui/tests/layout/ToolWindow.test.ts
Normal file
46
ui/tests/layout/ToolWindow.test.ts
Normal file
|
|
@ -0,0 +1,46 @@
|
|||
/**
|
||||
* Tests for the left tool window: hide and show, and keyboard resizing
|
||||
* clamped to the allowed range.
|
||||
*/
|
||||
import { mount } from "@vue/test-utils";
|
||||
import { describe, expect, it } from "vitest";
|
||||
import ToolWindow from "../../src/components/layout/ToolWindow.vue";
|
||||
|
||||
describe("ToolWindow", () => {
|
||||
it("hides to a stripe and shows again", async () => {
|
||||
const wrapper = mount(ToolWindow, {
|
||||
props: {
|
||||
title: "Project",
|
||||
open: true,
|
||||
"onUpdate:open": (open: boolean) => wrapper.setProps({ open }),
|
||||
},
|
||||
slots: { default: "<p data-test='content'>tree</p>" },
|
||||
});
|
||||
expect(wrapper.find("[data-test=content]").exists()).toBe(true);
|
||||
await wrapper.get("[data-test=tool-window-hide]").trigger("click");
|
||||
expect(wrapper.find("[data-test=content]").exists()).toBe(false);
|
||||
expect(wrapper.find("[data-test=tool-window-stripe]").exists()).toBe(true);
|
||||
await wrapper.get("[data-test=tool-window-show]").trigger("click");
|
||||
expect(wrapper.find("[data-test=content]").exists()).toBe(true);
|
||||
});
|
||||
|
||||
it("resizes with the keyboard within the limits", async () => {
|
||||
const wrapper = mount(ToolWindow, {
|
||||
props: {
|
||||
title: "Project",
|
||||
width: 200,
|
||||
minWidth: 150,
|
||||
maxWidth: 230,
|
||||
"onUpdate:width": (width: number) => wrapper.setProps({ width }),
|
||||
},
|
||||
});
|
||||
const splitter = wrapper.get("[data-test=tool-window-splitter]");
|
||||
await splitter.trigger("keydown", { key: "ArrowRight" });
|
||||
expect(wrapper.get("[data-test=tool-window]").attributes("style")).toContain("width: 212px");
|
||||
await splitter.trigger("keydown", { key: "ArrowRight", shiftKey: true });
|
||||
expect(wrapper.get("[data-test=tool-window]").attributes("style")).toContain("width: 230px");
|
||||
await splitter.trigger("keydown", { key: "ArrowLeft", shiftKey: true });
|
||||
await splitter.trigger("keydown", { key: "ArrowLeft", shiftKey: true });
|
||||
expect(wrapper.get("[data-test=tool-window]").attributes("style")).toContain("width: 150px");
|
||||
});
|
||||
});
|
||||
Loading…
Add table
Add a link
Reference in a new issue