Skip to content

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

TypeScript

fix(desktop): r3-m4 preserve app search request identity

Josué59af00e94840
diff --git a/desktop-app/ui/src/App.tsx b/desktop-app/ui/src/App.tsx
index 30758a366..30d7cde98 100644
--- a/desktop-app/ui/src/App.tsx
+++ b/desktop-app/ui/src/App.tsx
@@ -574,7 +574,6 @@ export function App() {
}, [vm.authenticatedPrincipalIdentity])
const handleSandboxUiOpening = React.useCallback((app: ActiveSandboxUiApp) => {
- setSandboxLocalSearchRequestId(0)
setSandboxUiMounted(false)
setActiveSandboxUiApp(app)
}, [])
diff --git a/desktop-app/ui/src/__tests__/App.deepLinks.test.tsx b/desktop-app/ui/src/__tests__/App.deepLinks.test.tsx
index 4303ecdc9..107bc742d 100644
--- a/desktop-app/ui/src/__tests__/App.deepLinks.test.tsx
+++ b/desktop-app/ui/src/__tests__/App.deepLinks.test.tsx
@@ -339,6 +339,17 @@ describe('App deep-link orchestration', () => {
act(() => emitCommand?.('search.current'))
expect(sandboxUiPageHarness.props?.localSearchRequestId).toBe(1)
expect(appHeaderHarness.props?.searchFocusRequestId).toBe(0)
+
+ act(() => {
+ sandboxUiPageHarness.props?.onEmbeddedAppOpening?.({
+ appRef: 'ns/replacement',
+ label: 'Replacement app',
+ defaultPath: '/',
+ })
+ sandboxUiPageHarness.props?.onEmbeddedAppMounted?.()
+ })
+ act(() => emitCommand?.('search.current'))
+ expect(sandboxUiPageHarness.props?.localSearchRequestId).toBe(2)
})
it('opens the palette, executes eligible registry actions, and captures the sandbox view', () => {
diff --git a/desktop-app/ui/src/pages/SandboxUiPage.tsx b/desktop-app/ui/src/pages/SandboxUiPage.tsx
index 2b3c5cbfe..349caa429 100644
--- a/desktop-app/ui/src/pages/SandboxUiPage.tsx
+++ b/desktop-app/ui/src/pages/SandboxUiPage.tsx
@@ -180,7 +180,7 @@ export function SandboxUiPage({
const embedSlotRef = useRef<HTMLDivElement>(null)
const activeFindClientRequestIdRef = useRef<number | null>(null)
const localSearchStateRef = useRef<AppFindState>({ status: 'idle' })
- const lastLocalSearchRequestIdRef = useRef(0)
+ const lastLocalSearchRequestIdRef = useRef(shortcutApp ? localSearchRequestId : 0)
const localSearchPreviousFocusRef = useRef<HTMLElement | null>(null)
const lastShortcutOpenRequestIdRef = useRef(0)
const lastActionRequestIdRef = useRef(0)
diff --git a/desktop-app/ui/src/pages/__tests__/SandboxUiPage.focus.test.tsx b/desktop-app/ui/src/pages/__tests__/SandboxUiPage.focus.test.tsx
index e58b1250a..42d09a511 100644
--- a/desktop-app/ui/src/pages/__tests__/SandboxUiPage.focus.test.tsx
+++ b/desktop-app/ui/src/pages/__tests__/SandboxUiPage.focus.test.tsx
@@ -124,8 +124,14 @@ describe('SandboxUiPage contextual-search focus ownership', () => {
await screen.findByRole('textbox', { name: 'Find in current app' })
first.unmount()
- render(<SandboxUiPage localSearchRequestId={0} />)
- await openApp()
+ render(
+ <SandboxUiPage
+ localSearchRequestId={1}
+ shortcutApp={{ appRef: apps[0]!.appRef, defaultPath: '/', title: 'Sales CRM' }}
+ shortcutOpenRequestId={1}
+ />
+ )
+ await screen.findByRole('button', { name: 'Back to apps' })
await new Promise(resolve => window.setTimeout(resolve, 0))
expect(screen.queryByRole('textbox', { name: 'Find in current app' })).toBeNull()