Skip to content

fix(desktop): Esc closes the open modal instead of aborting the model#1685

Merged
esengine merged 1 commit into
mainfrom
fix/desktop-esc-closes-modal
May 24, 2026
Merged

fix(desktop): Esc closes the open modal instead of aborting the model#1685
esengine merged 1 commit into
mainfrom
fix/desktop-esc-closes-modal

Conversation

@esengine

Copy link
Copy Markdown
Owner

Summary

Two related papercuts in the desktop client:

  1. Esc during streaming with a modal open used to fire abort() and leave the modal sitting on screen. Now the global Esc handler bails out when any of settingsOpen / aboutOpen / jobsOpen / wdOpen is set; SettingsModal and AboutModal each install their own keydown listener that calls onClose(). JobsPop and WorkdirPop already had their own handlers, so this just rounds out the set.
  2. Clicking (or Enter-ing) the already-active session in the sidebar used to round-trip a session_load and clear live in-turn state (issue 运行中的时候我点击了一下近期里面的本此对话,右边和下面状态栏里面的上下文,本次花费、缓存命中率全部清空 #1653). Skip the dispatch when s.name === activeName.

Supersedes #1670

Took the focused fix from #1670 (4 files / 45 lines) and ported it on top of current main. The original PR was based on a pre-#1657 / pre-#1666 / pre-#1667 commit and would have silently rolled back the preset drop, the 4-option reasoning-effort, and the totalCompletionTokens carryover when squash-merged (MERGEABLE masked the conflict). Co-authored credit preserved.

Test plan

  • npx tsc --noEmit
  • npx vitest run desktop/src/App.test.ts tests/desktop-btw-status.test.ts — 12 passed
  • Manual: open settings during streaming → Esc closes the modal (no abort)
  • Manual: click the active session in sidebar mid-turn → no reload, live state intact

Two related papercuts in the desktop client:

1. Esc during streaming with a modal (settings / about / jobs popover /
   workdir popover) open used to fire `abort()` and leave the modal
   sitting on screen. Now the global Esc handler bails out when any of
   those flags is set; settings/about modals each install their own
   `keydown` listener that calls `onClose()`. JobsPop and WorkdirPop
   already had their own handlers, so this just rounds out the set.

2. Clicking (or Enter-ing) the already-active session in the sidebar
   used to round-trip a session_load and clear live in-turn state
   (issue #1653). Skip when `s.name === activeName`.

Co-authored-by: CVEngineer <129239603+CVEngineer66@users.noreply.github.com>
@esengine esengine merged commit 4ecfd87 into main May 24, 2026
3 checks passed
@esengine esengine deleted the fix/desktop-esc-closes-modal branch May 24, 2026 12:13
esengine pushed a commit that referenced this pull request May 24, 2026
…moved, persisted usage stats, plan dispatch gate

Headline themes:
- Desktop: bundle the CLI-hosted React dashboard, retire Tauri+Preact duplicate (#1418)
- Config: drop preset abstraction; flash/pro are direct model selections (#1657, #1630)
- Stats: persist cumulative usage to session meta + auto-restore on startup (#1667, #1680, #1643, #1628)
- Plans: editMode="plan" enforced at the ToolRegistry dispatch gate (#1681); step advance fix (#1629)
- Context: fold once at turn start, drop pre-flight + byte-ceiling (#1642, #1646); collapsible compacted card (#1649)
- Subagents: per-skill flash/pro override + Settings UI (#1632)
- Desktop polish: sidebar drag-resize (#1688), responsive collapse (#1585), copy/edit overlay + msg-history nav (#1645), Esc closes modal not turn (#1685), QQ tab isolation (#1672), DiffCard for edits (#1662), theme-aware highlighting (#1655), system events toggle (#1654/#1650), macOS TCC inheritance (#1614), dashboard.enabled (#1612)
- Dashboard polish: persistent session URL (#1586, #1589, #1599), theme-aware highlighting (#1664), IME confirm-enter guard (#1689), code-fence lang fix (#1677), vendor chunk split (#1587), markdown table h-scroll (#1562)
- TUI: Alt+S input stash/recall; static history isolated from input rerenders (#1635); legacy mouse drop (#1637, #1648); multi-edit gated in review (#1647)
- Diff: SplitDiff column border holds under CJK (#1686)
- MCP: workspace roots passed to servers (#1625); codeCommand honors mcpServers (#1603)
- Config plumbing: (baseUrl, apiKey) resolved as a tuple (#1658); stale model id self-heal (#1663)

See CHANGELOG for the full list.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant