Skip to content

fix(desktop): route Escape in Chat-first shell - #11059

Merged
kodjima33 merged 2 commits into
BasedHardware:mainfrom
aryanorastar:fix/10698-chat-first-escape
Aug 4, 2026
Merged

kodjima33 merged 2 commits into
BasedHardware:mainfrom
aryanorastar:fix/10698-chat-first-escape

Conversation

@aryanorastar

@aryanorastar aryanorastar commented Aug 3, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

Fixes #10698.

Chat-first pages were using SwiftUI's focus-dependent onExitCommand, while the
shared window Escape dispatcher was only attached to the legacy shell. Escape
could therefore be swallowed on Chat-first Tasks, Goals, Memories,
Conversations, and More pages.

The Chat-first shell now registers navigation with the shared window-scoped
Escape monitor. Child handlers retain priority, and Escape remains unhandled on
Chat. Navigation behavior is centralized in ChatFirstShellNavigation and
covered by a regression test.

Verification

  • xcrun swift test --package-path Desktop --filter ChatFirstShellTests
    • 20 tests passed.
  • ./scripts/swift-format-wrapper.sh lint Desktop/Sources/MainWindow/ChatFirst/ChatFirstRoute.swift Desktop/Sources/MainWindow/ChatFirst/ChatFirstShell.swift Desktop/Tests/ChatFirstShellTests.swift
    • Passed with pinned swift-format 602.0.0.
  • python3 scripts/check_desktop_test_quality.py
    • Passed; test-quality debt remains at or below baseline.
  • OMI_APP_NAME="omi-10698-escape" ./run.sh --yolo --full --no-wait
    • Named bundle built, signed, installed, and launched successfully.
    • Interactive route verification was unavailable because the source dev bundle
      was signed out and agent-swift is not installed in this environment.

Invariants

No product invariants are affected.

Failure-Class: none

Review in cubic

@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

@cubic-dev-ai cubic-dev-ai Bot left a comment •

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All reported issues were addressed across 4 files

Reply with feedback, questions, or to request a fix.

Re-trigger cubic

@aryanorastar

Copy link
Copy Markdown
Collaborator Author

Fixed cubic P2 in fe29b16c: the rename TextField now registers .onEscapeKey(priority: .editing), so rename cancellation runs before the Chat-first shell navigation handler. Existing onExitCommand remains as a fallback. Formatter and desktop test-quality checks pass. The focused Swift test is blocked locally by the existing AudioKit macOS deployment-target mismatch (omi-lib 10.13 vs AudioKit 11.0).

@aryanorastar
aryanorastar force-pushed the fix/10698-chat-first-escape branch from fe29b16 to e154c10 Compare August 3, 2026 17:48
@aryanorastar

Copy link
Copy Markdown
Collaborator Author

Rebased the actual branch onto latest main and pushed e154c101. The prior Desktop Swift failure was the unrelated shared ChatTranscriptGestureHarnessTests.testRePresentingTheTranscriptOpensAtTheLiveEdgeAgain live-edge assertion. CI will rerun against the current desktop test baseline.

@Git-on-my-level

Copy link
Copy Markdown
Member

Solid fix — registering the Chat-first shell with the shared window Escape monitor at .navigation priority aligns it with the legacy shell and fixes the swallowed-Escape issue on Tasks/Goals/Memories/Conversations/More pages.

The cubic P2 (Escape during task rename navigating to Chat) is correctly handled on this head: the rename field's .onEscapeKey(priority: .editing) dispatches before the shell's .navigation handler, so rename cancellation wins. Centralizing the logic in handleEscapeNavigation() and adding a regression test covering both the secondary-route and on-chat cases is exactly right.

CI passes (Desktop Swift Build & Tests, Static & Test Contracts, Hygiene). Leaving a positive signal here — thanks for the clean, well-scoped fix.


by AI on behalf of David — if you need David’s attention urgently, please @Git-on-my-level and escalate with need human response.

@kodjima33 kodjima33 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Escape dispatcher was only wired to the legacy shell; Chat-first now registers with the shared window-scoped monitor. Regression test included, Swift build green. Desktop bug fix — merging (owner-override).

@kodjima33
kodjima33 merged commit 84de550 into BasedHardware:main Aug 4, 2026
30 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Escape does nothing on most desktop pages: onExitCommand never receives focus

3 participants