Skip to content

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

TypeScript

fix(desktop): enforce modal shortcut precedence

Josué7f1d06cabca3
diff --git a/desktop-app/ui/src/App.tsx b/desktop-app/ui/src/App.tsx
index 5130bfd3c..bcd0e9ab4 100644
--- a/desktop-app/ui/src/App.tsx
+++ b/desktop-app/ui/src/App.tsx
@@ -114,6 +114,12 @@ function errorMessage(error: unknown): string {
return error instanceof Error ? error.message : String(error || 'Unknown error')
}
+function hasBlockingDesktopDialog(): boolean {
+ return Boolean(
+ document.querySelector('[role="dialog"][aria-modal="true"], .da-plugin-consent[role="dialog"]')
+ )
+}
+
function errorCode(error: unknown): string {
if (!error || typeof error !== 'object') return ''
const record = error as { code?: unknown; cause?: { code?: unknown } }
@@ -1090,10 +1096,8 @@ export function App() {
if (commandId === 'commands.open') closeCommandPalette()
return
}
- if (origin !== 'palette' && document.querySelector('[role="dialog"][aria-modal="true"]')) {
- return
- }
const command = getDesktopCommand(commandId)
+ if (origin !== 'palette' && hasBlockingDesktopDialog()) return
const state = chatViewTabsRef.current
if (!isDesktopCommandEligible(command, desktopCommandContext)) return
if (commandId === 'commands.open') {
diff --git a/desktop-app/ui/src/__tests__/App.deepLinks.test.tsx b/desktop-app/ui/src/__tests__/App.deepLinks.test.tsx
index 7f8743de3..31314fa22 100644
--- a/desktop-app/ui/src/__tests__/App.deepLinks.test.tsx
+++ b/desktop-app/ui/src/__tests__/App.deepLinks.test.tsx
@@ -288,6 +288,20 @@ describe('App deep-link orchestration', () => {
expect(appHeaderHarness.props?.searchFocusRequestId).toBe(1)
})
+ it('suppresses application commands while plugin consent owns the app surface', () => {
+ currentController = makeController({ initialExperienceLoading: false })
+ render(<App />)
+ const consent = document.createElement('div')
+ consent.className = 'da-plugin-consent'
+ consent.setAttribute('role', 'dialog')
+ document.body.append(consent)
+
+ act(() => emitCommand?.('search.open'))
+
+ expect(appHeaderHarness.props?.searchFocusRequestId).toBe(0)
+ consent.remove()
+ })
+
it('routes contextual search to the current sandbox app without opening global search', () => {
currentController = makeController({
initialExperienceLoading: false,