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(desktop): 保留隐藏侧栏的待处理命令

DavidShendaf528a9a159
diff --git a/apps/desktop/src/main/right-sidebar-window/__tests__/controller.test.ts b/apps/desktop/src/main/right-sidebar-window/__tests__/controller.test.ts
index 93df9bd8ee..0055b452f4 100644
--- a/apps/desktop/src/main/right-sidebar-window/__tests__/controller.test.ts
+++ b/apps/desktop/src/main/right-sidebar-window/__tests__/controller.test.ts
@@ -694,7 +694,7 @@ describe('setContext / routeCommand', () => {
await expect(h.controller.routeCommand(terminalRequest())).resolves.toBe('stale-context');
});
- it('allowOpen=false + window hidden: queued, flushed on ready', async () => {
+ it('allowOpen=false + window hidden: stays queued through prewarm and flushes on open', async () => {
const h = makeHarness({ detached: true });
h.controller.setContext(ctx);
const cmd = { type: 'close-orca-workers-tab' as const, sessionId: 's1' };
@@ -706,6 +706,9 @@ describe('setContext / routeCommand', () => {
h.controller.prewarm();
const win = h.windows[0];
markReady(h.controller, win);
+ expect(h.sends.filter((entry) => entry.channel === 'cmd-channel')).toEqual([]);
+
+ h.controller.open();
expect(h.sends.at(-1)).toEqual({ channel: 'cmd-channel', payload: cmd });
});
diff --git a/apps/desktop/src/main/right-sidebar-window/controller.ts b/apps/desktop/src/main/right-sidebar-window/controller.ts
index 129bd75ba8..aa06c56cf8 100644
--- a/apps/desktop/src/main/right-sidebar-window/controller.ts
+++ b/apps/desktop/src/main/right-sidebar-window/controller.ts
@@ -779,6 +779,7 @@ export class RsbWindowController {
if (
!this.deps.settings.read().detached ||
!this.presentationReady ||
+ !this.visible ||
!this.winRef ||
this.winRef.isDestroyed()
) {
@@ -788,6 +789,7 @@ export class RsbWindowController {
() => Boolean(
this.winRef &&
!this.winRef.isDestroyed() &&
+ this.visible &&
!this.destroyingWindow &&
!this.disposed,
),