Skip to content

Evenfire is an intelligence layer platform for running LLM agents that take real actions, on your infrastructure

TypeScript

fix(desktop): r2-h4 suppress concurrent palette logout

Josuéb629317a788d
diff --git a/desktop-app/src/__tests__/desktopCommands.test.ts b/desktop-app/src/__tests__/desktopCommands.test.ts
index 1df3baca4..0c7eaae78 100644
--- a/desktop-app/src/__tests__/desktopCommands.test.ts
+++ b/desktop-app/src/__tests__/desktopCommands.test.ts
@@ -130,6 +130,7 @@ describe('Desktop command registry', () => {
composerAvailable: false,
appMounted: false,
conversationOriginAvailable: false,
+ applicationBusy: false,
}
expect(isDesktopCommandEligible(getDesktopCommand('tabs.select1'), context)).toBe(true)
expect(isDesktopCommandEligible(getDesktopCommand('tabs.select2'), context)).toBe(false)
@@ -137,6 +138,13 @@ describe('Desktop command registry', () => {
expect(isDesktopCommandEligible(getDesktopCommand('search.current'), context)).toBe(false)
expect(isDesktopCommandEligible(getDesktopCommand('composer.focus'), context)).toBe(false)
expect(isDesktopCommandEligible(getDesktopCommand('search.open'), context)).toBe(true)
+ expect(isDesktopCommandEligible(getDesktopCommand('auth.logout'), context)).toBe(true)
+ expect(
+ isDesktopCommandEligible(getDesktopCommand('auth.logout'), {
+ ...context,
+ applicationBusy: true,
+ })
+ ).toBe(false)
expect(isDesktopCommandEligible(getDesktopCommand('app.refresh'), context)).toBe(false)
expect(
isDesktopCommandEligible(getDesktopCommand('app.refresh'), { ...context, appMounted: true })
diff --git a/desktop-app/src/desktopCommands.ts b/desktop-app/src/desktopCommands.ts
index fd87d4e11..5ea73f47b 100644
--- a/desktop-app/src/desktopCommands.ts
+++ b/desktop-app/src/desktopCommands.ts
@@ -16,6 +16,7 @@ export type DesktopCommandEligibility =
| 'composer-available'
| 'app-mounted'
| 'conversation-origin'
+ | 'not-busy'
export type SemanticShortcutBinding = {
key: string
@@ -46,6 +47,7 @@ export type DesktopCommandRuntimeContext = {
composerAvailable: boolean
appMounted: boolean
conversationOriginAvailable: boolean
+ applicationBusy: boolean
}
function tabSelectCommand<const Id extends `tabs.select${1 | 2 | 3 | 4 | 5 | 6 | 7 | 8}`>(
@@ -257,7 +259,7 @@ const definitions = [
order: 130,
defaultBinding: null,
sources: ['host', 'sandbox'],
- eligibility: 'always',
+ eligibility: 'not-busy',
editingPolicy: 'suppress',
modalPolicy: 'block',
actionOwner: 'renderer',
@@ -499,6 +501,7 @@ export function isDesktopCommandEligible(
if (command.eligibility === 'searchable-content') return context.searchableContent
if (command.eligibility === 'app-mounted') return context.appMounted
if (command.eligibility === 'conversation-origin') return context.conversationOriginAvailable
+ if (command.eligibility === 'not-busy') return !context.applicationBusy
return context.composerAvailable
}
diff --git a/desktop-app/ui/src/App.tsx b/desktop-app/ui/src/App.tsx
index 595b873ab..12701bcae 100644
--- a/desktop-app/ui/src/App.tsx
+++ b/desktop-app/ui/src/App.tsx
@@ -1112,6 +1112,7 @@ export function App() {
Boolean(activeSandboxUiApp) &&
sandboxUiMounted &&
Boolean(sandboxUiConversationOrigin),
+ applicationBusy: vm.busy,
}),
[
activeSandboxUiApp,
@@ -1119,6 +1120,7 @@ export function App() {
sandboxUiConversationOrigin,
sandboxUiMounted,
vm.activeChatId,
+ vm.busy,
vm.hostRuntimeStatus,
vm.navItem,
]