DesktopHomeView wraps its page content in .onExitCommand { navigateHomeOnEscapeIfNeeded() } (DesktopHomeView.swift:1109), which is meant to back out of Conversations/Memories/Tasks/Rewind to the dashboard, and to close the full-screen Brain Map page. It never fires. onExitCommand is delivered through cancelOperation(_:) on the responder chain, and these pages contain no view that takes keyboard focus, so nothing is there to receive it.
Evidence, on a dev bundle of the current main behaviour (com.omi.omi-pr-9499, automation bridge on 47894):
- Navigate to the Memory hub's Memories destination, activate the app, send
key code 53. selectedTab stays Memories; the dashboard is never reached.
- Open a conversation detail via
omi-ctl open-conversation <id>, send Escape. The detail view stays open.
I also confirmed the SwiftUI-native alternatives do not help here: adding .onKeyPress(.escape) to ConversationsPage's body has the same problem for the same reason (I tried it, verified it was inert, and dropped it rather than ship dead code). RewindPage uses .onKeyPress(.escape) too, so its layered Escape handling is likely inert as well — worth checking.
The pattern that does work in this codebase is a window-scoped NSEvent.addLocalMonitorForEvents monitor: OverlayModalEscapeCatcher (AppsPage.swift:3382, whose own doc comment says "onExitCommand needs focus they never receive"), MemoryAtlasInputMonitor in the Brain Map, and FloatingControlBarWindow. Three separate copies of it exist already, which is probably the real fix: one shared escape monitor that reports handled/unhandled so pages can layer their dismissals and pass the key on when they have nothing to undo.
Related: PR #9499 gives the Brain Map layered Escape (search, then selection, then the island you entered, then the map itself) using its own monitor, so the atlas is not affected by this. Everything else on the window is.
DesktopHomeViewwraps its page content in.onExitCommand { navigateHomeOnEscapeIfNeeded() }(DesktopHomeView.swift:1109), which is meant to back out of Conversations/Memories/Tasks/Rewind to the dashboard, and to close the full-screen Brain Map page. It never fires.onExitCommandis delivered throughcancelOperation(_:)on the responder chain, and these pages contain no view that takes keyboard focus, so nothing is there to receive it.Evidence, on a dev bundle of the current
mainbehaviour (com.omi.omi-pr-9499, automation bridge on 47894):key code 53.selectedTabstaysMemories; the dashboard is never reached.omi-ctl open-conversation <id>, send Escape. The detail view stays open.I also confirmed the SwiftUI-native alternatives do not help here: adding
.onKeyPress(.escape)toConversationsPage's body has the same problem for the same reason (I tried it, verified it was inert, and dropped it rather than ship dead code).RewindPageuses.onKeyPress(.escape)too, so its layered Escape handling is likely inert as well — worth checking.The pattern that does work in this codebase is a window-scoped
NSEvent.addLocalMonitorForEventsmonitor:OverlayModalEscapeCatcher(AppsPage.swift:3382, whose own doc comment says "onExitCommandneeds focus they never receive"),MemoryAtlasInputMonitorin the Brain Map, andFloatingControlBarWindow. Three separate copies of it exist already, which is probably the real fix: one shared escape monitor that reports handled/unhandled so pages can layer their dismissals and pass the key on when they have nothing to undo.Related: PR #9499 gives the Brain Map layered Escape (search, then selection, then the island you entered, then the map itself) using its own monitor, so the atlas is not affected by this. Everything else on the window is.