Skip to content

armgit / cindy

Public Imported from GitHub
0

Consider it done. The open-source AI agent that works out of the box · 想到,就能做到。开源、开箱即用的 AI Agent。

fix(bots): 让隐藏任务入口的键盘焦点可见

xuzini-xzn918616701940
diff --git a/apps/desktop/src/renderer/features/bots/BotChannelsPage.tsx b/apps/desktop/src/renderer/features/bots/BotChannelsPage.tsx
index e023a03d12..9118c0c455 100644
--- a/apps/desktop/src/renderer/features/bots/BotChannelsPage.tsx
+++ b/apps/desktop/src/renderer/features/bots/BotChannelsPage.tsx
@@ -473,7 +473,7 @@ function ConnectionLanes({ connectionId, botId, botName }: { connectionId: strin
<button
type="button"
onClick={() => navigate(`/bots/${encodeURIComponent(botId)}/history/${encodeURIComponent(lane.sessionId)}`)}
- className="min-w-0 flex-1 text-left focus-visible:outline focus-visible:outline-2 focus-visible:outline-[var(--focus-ring)]"
+ className="min-w-0 flex-1 text-left outline-none focus-visible:ring-2 focus-visible:ring-[var(--focus-ring)]"
>
<span className="flex min-w-0 items-center gap-1.5">
<span className="min-w-0 truncate text-12 text-[var(--text-primary)]" title={name}>
diff --git a/apps/desktop/src/renderer/features/bots/__tests__/botChannelsPage.test.tsx b/apps/desktop/src/renderer/features/bots/__tests__/botChannelsPage.test.tsx
index 959d3b2363..1e980053f0 100644
--- a/apps/desktop/src/renderer/features/bots/__tests__/botChannelsPage.test.tsx
+++ b/apps/desktop/src/renderer/features/bots/__tests__/botChannelsPage.test.tsx
@@ -112,7 +112,11 @@ describe('BotChannelsPage', () => {
render(<BotChannelsPage bot={{ ...mia, id: 'bot/1' }} />);
for (const lane of lanes) {
const name = lane.kind === 'owner-dm' ? 'bots.channels.lanes.ownerName' : lane.name;
- fireEvent.click(await screen.findByRole('button', { name: new RegExp(`^${name}`) }));
+ const open = await screen.findByRole('button', { name: new RegExp(`^${name}`) });
+ // globals.css 会用 outline:none !important 盖掉非输入控件的描边,键盘焦点必须走 ring。
+ expect(open.className).toContain('focus-visible:ring-2');
+ expect(open.className).not.toContain('focus-visible:outline');
+ fireEvent.click(open);
expect(mocks.navigate).toHaveBeenLastCalledWith(`/bots/bot%2F1/history/${encodeURIComponent(lane.sessionId)}`);
}
expect(lanesApi.resetLane).not.toHaveBeenCalled();