From 2976db4b2cbe392859fe23e8a9c8d8b5765eddbf Mon Sep 17 00:00:00 2001 From: Shakker Date: Sun, 31 May 2026 22:43:58 +0100 Subject: [PATCH] fix: address Skill Workshop UI check failures --- ui/src/ui/app-render.helpers.node.test.ts | 8 ++-- ui/src/ui/app-render.helpers.ts | 18 ++++++-- ui/src/ui/app-render.ts | 49 ++++++++++++---------- ui/src/ui/chat/grouped-render.test.ts | 5 ++- ui/src/ui/components/file-preview-modal.ts | 12 +++--- ui/src/ui/public-assets.ts | 4 +- ui/src/ui/views/chat.test.ts | 2 +- ui/src/ui/views/config-quick.test.ts | 2 +- ui/src/ui/views/skill-workshop.ts | 6 +++ 9 files changed, 66 insertions(+), 40 deletions(-) diff --git a/ui/src/ui/app-render.helpers.node.test.ts b/ui/src/ui/app-render.helpers.node.test.ts index 5e343632816..d02706f67e8 100644 --- a/ui/src/ui/app-render.helpers.node.test.ts +++ b/ui/src/ui/app-render.helpers.node.test.ts @@ -1061,7 +1061,7 @@ describe("switchChatSession", () => { loadChatHistoryMock.mockResolvedValue(undefined); loadSessionsMock.mockResolvedValue(undefined); - switchChatSession(state, "agent:main:test-b"); + void switchChatSession(state, "agent:main:test-b"); await Promise.resolve(); expect(state.chatQueue).toStrictEqual([]); @@ -1133,10 +1133,10 @@ describe("switchChatSession", () => { loadChatHistoryMock.mockResolvedValue(undefined); loadSessionsMock.mockResolvedValue(undefined); - switchChatSession(state, "agent:main:other"); + void switchChatSession(state, "agent:main:other"); expect(state.chatQueue).toStrictEqual([]); - switchChatSession(state, "main"); + void switchChatSession(state, "main"); expect(state.chatQueue).toEqual([{ id: "queued-1", text: "message B", createdAt: 1 }]); }); @@ -1180,7 +1180,7 @@ describe("switchChatSession", () => { loadChatHistoryMock.mockResolvedValue(undefined); loadSessionsMock.mockResolvedValue(undefined); - switchChatSession(state, "main"); + void switchChatSession(state, "main"); await Promise.resolve(); expect( diff --git a/ui/src/ui/app-render.helpers.ts b/ui/src/ui/app-render.helpers.ts index 859b0f0dff5..2e6fbad7345 100644 --- a/ui/src/ui/app-render.helpers.ts +++ b/ui/src/ui/app-render.helpers.ts @@ -282,7 +282,13 @@ function renderCronFilterIcon(hiddenCount: number) { } export function renderChatSessionSelect(state: AppViewState) { - return renderChatSessionSelectBase(state, switchChatSession, { surface: "desktop" }); + return renderChatSessionSelectBase( + state, + (targetState, nextSessionKey) => { + void switchChatSession(targetState, nextSessionKey); + }, + { surface: "desktop" }, + ); } function chatAutoScrollLabel(mode: ChatAutoScrollMode) { @@ -586,7 +592,13 @@ export function renderChatMobileToggle(state: AppViewState) { }} >
- ${renderChatSessionSelectBase(state, switchChatSession, { surface: "mobile" })} + ${renderChatSessionSelectBase( + state, + (targetState, nextSessionKey) => { + void switchChatSession(targetState, nextSessionKey); + }, + { surface: "mobile" }, + )}
${renderChatAutoScrollToggle(state)}