refactor(webui): separate presentation views and expand component gallery (#6179)

* refactor(webui): organize shared components with an internal gallery

* refactor(webui): decouple views and expand component gallery

* fix(docker): include channel sources in WebUI build

* refactor(webui): cover all channel interfaces in gallery

* docs(webui): remove manual paragraph wrapping
This commit is contained in:
chengyongru authored and GitHub committed 2026-10-14 00:11:00 +08:00
1 parent db804ef94a
commit 30e43aec82
109 files changed
+7874 -3459

No files matched your search

@@ -210,6 +210,23 @@ it("keeps the current chat visible when discovery fails and permits a retry", as
expect(fetchAutomationChats).toHaveBeenCalledTimes(2);
});
it("aborts discovery for the previous task and ignores its delayed chat choices", async () => {
let first!: (value: AutomationChatsPayload) => void;
let second!: (value: AutomationChatsPayload) => void;
vi.mocked(fetchAutomationChats).mockImplementationOnce(() => new Promise(resolve => { first = resolve; }));
vi.mocked(fetchAutomationChats).mockImplementationOnce(() => new Promise(resolve => { second = resolve; }));
const { rerender } = render(<AutomationDetailDialog {...props} job={job} onChangeChat={vi.fn()} />);
const oldSignal = vi.mocked(fetchAutomationChats).mock.calls[0][2]!;
rerender(<AutomationDetailDialog {...props} job={{ ...job, id: "another-task", chat_binding_revision: "rev-next" }} onChangeChat={vi.fn()} />);
expect(oldSignal.aborted).toBe(true);
await act(async () => first({ ...choices, current: target }));
expect(screen.getByRole("combobox", { name: "Run in chat" })).toBeDisabled();
expect(screen.getByRole("combobox", { name: "Run in chat" })).not.toHaveTextContent("Product team");
await act(async () => second({ ...choices, current: target, revision: "rev-next" }));
expect(screen.getByRole("combobox", { name: "Run in chat" })).toHaveTextContent("Product team");
expect(screen.getByRole("combobox", { name: "Run in chat" })).toBeEnabled();
});
const webTarget = { ...target, channel: "websocket" };
const namedSessions: ChatSummary[] = [source, webTarget].map((chat) => ({
key: `websocket:${chat.id}`, channel: "websocket", chatId: chat.id,