Skip to content

fix(desktop): reopen the dashboard from the macOS app icon - #5735

Closed
fflake33 wants to merge 1 commit into
lidge-jun:devfrom
fflake33:codex/fix-macos-dashboard-reopen
Closed

fflake33 wants to merge 1 commit into
lidge-jun:devfrom
fflake33:codex/fix-macos-dashboard-reopen

Conversation

@fflake33

@fflake33 fflake33 commented Sep 24, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Closing the OpenCodex window on macOS leaves the app running, but clicking its Dock icon or opening it again from Finder does not restore the dashboard. The single-instance callback handles a new process notifying the running process; it does not handle macOS reopening an already-running application.

Handle macOS RunEvent::Reopen through the existing show_dashboard entry point, including popup dismissal and deferred dashboard loading. Add a focused event-wiring regression guard and update the desktop structure contract and all eight desktop-guide locales. No new window, proxy restart, dependency, or GUI component is introduced.

Verification

Head: 920c0527eef08acf4c6d07a170e0ea42d311b10c, based on dev at 8b562bfc7.

  • The new wiring guard failed before the fix (16 pass / 1 fail). After the fix: bun test tests/clients/desktop-exit-ownership.test.ts tests/clients/desktop-startup-surface.test.ts tests/clients/desktop-tray-availability.test.ts — 46 pass / 0 fail. This guard checks source wiring; it is not presented as a native UI test.
  • bun run typecheck, bun run structure:check, bun run privacy:scan, git diff --check — passed.
  • cargo fmt --manifest-path desktop/src-tauri/Cargo.toml --check, cargo clippy --locked --manifest-path desktop/src-tauri/Cargo.toml --all-targets -- -D warnings, cargo test --locked --manifest-path desktop/src-tauri/Cargo.toml — passed; 127 Rust tests passed.
  • cd docs-site && bun install --frozen-lockfile && bun run build — passed; 505 pages and 67,206 internal links checked.
  • Real macOS 27.0 reproduction on installed 2.64.0: close window → click Dock icon failed twice; close → LaunchServices open also failed. In each case, Open Dashboard from the tray restored the same window. Notifying the single-instance callback was a passing control.
  • Native fixed-shell check: built this head with TAURI_CONFIG='{"identifier":"com.opencodex.reopentest","productName":"OpenCodex Reopen Test"}' cargo build --locked --features tauri/custom-protocol --manifest-path desktop/src-tauri/Cargo.toml, then staged a separate, ad-hoc-signed test .app with the existing 2.64.0 bundled CLI/web assets. Used isolated HOME/CODEX_HOME/OPENCODEX_HOME, a separate port, and preclaimed login markers. AppleScript drove the real close button and Dock/LaunchServices actions: window counts were 1 → 0 → 1 for both reopen paths. Accessibility inspection confirmed the proxy dashboard loaded at the isolated endpoint. Tray recovery also passed; tray Quit stopped the test shell and its proxy. The installed application was not replaced. This validates the native shell change, not a newly released full package.
  • Additional scoped gate run: bun run test -- tests/clients/desktop-exit-ownership.test.ts tests/clients/desktop-startup-surface.test.ts tests/clients/desktop-tray-availability.test.ts tests/clients/desktop-start-at-login-default.test.ts tests/ci-workflows/structure-ssot.test.ts tests/test-layout.test.ts tests/test-layout-tooling.test.ts — 121 pass / 0 fail.
  • Full suite did not complete and is not green. The first bun run test was interrupted (exit 130) after the real-home guard refused scratch cleanup inside this ~/.codex worktree. Retried bun run test in a detached /tmp worktree at this exact head. After 674 seconds, 20 failing cases had been reported; the log had not advanced for 143 seconds and both runner/test processes were at 0% CPU. The interrupted-run report named tests/cli/ocx-launcher-runtime.test.ts as still running (292 seconds). I stopped this run with SIGINT (exit 130); later serial lanes were not executed. This is the documented resource exception, not a full-suite pass. Local readiness relies on the focused regression, Rust, typecheck, documentation, structure, privacy, and native-shell checks listed above; remaining full-suite coverage is left to hosted CI.
  • Clean-base comparison at 8b562bfc7, in a separate /tmp worktree: bun run test -- tests/adapters/anthropic/anthropic-fast-opt-in.test.ts tests/server/management-provider-validation.test.ts tests/service/service-claim.test.ts tests/service/service-wsl-home-ownership.test.ts tests/codex-integration/codex-retained-root-serialization.test.ts — 150 pass / 14 fail / 1 unhandled error; bun run test -- tests/clients/remote-workspace-command-runner.test.ts tests/codex-integration/native-codex-toggle.test.ts — 23 pass / 3 fail. These reproduce 17 of the 20 observed failing cases without this patch. The other three are WSL ownership cases: bun run test -- tests/service/service-wsl-home-ownership.test.ts passes 4/4 at both base and PR head. Their full-suite-only failure remains unexplained; I am not claiming every full-suite failure is diagnosed or resolved.
  • Hosted status inspected at the exact PR head: target/description enforcement, PR hygiene, and labeling passed. Cross-platform CI, Service lifecycle, and React Doctor report action_required (maintainer approval needed for the fork run). CodeRabbit completed its review of this exact head (run 255ad719-e2d5-48cf-bd49-13d2f66fb94f) and reported no actionable comments; no unresolved review threads remain. Its separate docstring-coverage advisory reports 50% against its 80% threshold. This warning is retained here and is not represented as a passing check; it does not identify a behavior defect or an unresolved review finding. Hosted required CI remains a merge gate.
  • Codex completed separate Standards and Spec reviews of 920c0527eef08acf4c6d07a170e0ea42d311b10c: no actionable findings on either axis. These were static diff and call-path reviews, not a rerun of the native experiment. At this check, the branch is one commit behind dev (359616ef200e10ea04948237003b9df4f212698e), within the repository readiness limit.

The patch touches no authentication, credential handling, release automation, workflow permissions, or dependency declarations. Reviewer findings must be resolved before readiness; hosted required checks and maintainer approval remain merge gates; skipped or approval-pending checks are not passing evidence.

Checklist

  • Scope stays focused and avoids unrelated cleanup.
  • Docs or release notes were updated when needed.
  • Security-sensitive changes were reviewed for secrets, auth, and unsafe defaults.

Review readiness checklist

This PR stays in draft until every box below is ticked. Tick all four boxes once the requirements are met:

  • Required local validation passed; commands, results, and any full-suite exception are documented.

  • I pushed my PR to a recent dev commit (at most 10 behind; a maintainer may still ask for the exact tip before merge).

  • I resolved all correct Codex and CodeRabbit findings.

  • My PR is ready for review.

Summary by CodeRabbit

  • New Features
    • On macOS, reopening the running app from the Dock or Finder now restores the dashboard without restarting the proxy. The app continues running in the menu bar after the dashboard is closed.
  • Documentation
    • Updated the desktop app guides in multiple languages with details about this macOS behavior.

@coderabbitai

coderabbitai Bot commented Sep 24, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

Navigate logical layers of code changes, visualize relationships, and explore their blast radius.

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository: lidge-jun/opencodex/.coderabbit.yaml

Review profile: ASSERTIVE

Plan: Advanced

Run ID: 255ad719-e2d5-48cf-bd49-13d2f66fb94f

📥 Commits

Reviewing files that changed from the base of the PR and between 359616e and 920c052.

📒 Files selected for processing (11)
  • desktop/src-tauri/src/lib.rs
  • docs-site/src/content/docs/fr/guides/desktop-app.md
  • docs-site/src/content/docs/guides/desktop-app.md
  • docs-site/src/content/docs/ja/guides/desktop-app.md
  • docs-site/src/content/docs/ko/guides/desktop-app.md
  • docs-site/src/content/docs/ru/guides/desktop-app.md
  • docs-site/src/content/docs/tr/guides/desktop-app.md
  • docs-site/src/content/docs/zh-cn/guides/desktop-app.md
  • docs-site/src/content/docs/zh-tw/guides/desktop-app.md
  • structure/desktop-shell.md
  • tests/clients/desktop-exit-ownership.test.ts

Included review availability: Your plan provides up to 10 included reviews per hour; 9 remain after this review.


📝 Walkthrough

Walkthrough

The macOS RunEvent::Reopen handler now calls show_dashboard. The desktop-app guides describe restoring the dashboard from Dock or Finder while the app remains active in the menu bar. A test checks the handler and dashboard wiring.

Changes

macOS dashboard reopening

Layer / File(s) Summary
Reopen event and dashboard wiring
desktop/src-tauri/src/lib.rs, tests/clients/desktop-exit-ownership.test.ts
The macOS reopen handler calls show_dashboard. The test checks that show_dashboard hides the popup and opens the dashboard.
Desktop-app reopen documentation
docs-site/src/content/docs/guides/desktop-app.md, docs-site/src/content/docs/*/guides/desktop-app.md, structure/desktop-shell.md
The desktop-app guides describe the macOS menu-bar behavior and reopening the dashboard from Dock or Finder without restarting the proxy. The shell documentation describes the RunEvent::Reopen handling and distinguishes it from the single-instance callback.

Priority: ⬇️ Low

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Bug fix

Merge Risk: ⚪ Minimal · up to 920c0

Dock/Finder reopening uses the existing dashboard path, and closing the dashboard while the app remains active preserves its window for reuse. No concrete behavior regression is indicated.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 50.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 2 functions across 2 files. (9 skipped: 9… Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely describes the main change: restoring the dashboard when the macOS app icon is reopened.
Full details: Docstring Coverage

Explanation

Docstring coverage is 50.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 2 functions across 2 files. (9 skipped: 9 unsupported.)

  • Fix all pre-merge checks with AI
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create a new PR

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@github-actions github-actions Bot added the bug Something isn't working label Sep 24, 2026
@github-actions

Copy link
Copy Markdown
Contributor

✅ Deterministic PR hygiene checks passed.

@github-actions

github-actions Bot commented Sep 24, 2026 •

Copy link
Copy Markdown
Contributor

✅ READY

  • all PR quality gates passed; the review readiness checklist is complete.

Review readiness checklist

  • ✅ Required local validation passed; commands, results, and any full-suite exception are documented.
  • ✅ I pushed my PR to a recent dev commit (at most 10 behind; a maintainer may still ask for the exact tip before merge).
  • ✅ I resolved all correct Codex and CodeRabbit findings.
  • ✅ My PR is ready for review.

✅ 4/4 boxes ticked.

This pull request has been marked Ready for Review.
The review-ready label marks this PR as ready; review automation runs independently.
Maintainers notified: @lidge-jun @Ingwannu

@lidge-jun

Copy link
Copy Markdown
Owner

리뷰 · 우선순위 60 / 80

맥에서 대시보드 창을 닫으면 프로그램은 메뉴 막대에 남습니다. 독이나 파인더에서 아이콘을 다시 눌러도 창이 안 나왔습니다. 앱을 두 번 켜면 나중 것이 먼저 것에 알려 주고, 그 알림만 창을 다시 띄웠습니다. 맥이 이미 켜진 앱을 다시 열 때 보내는 신호는 처리하지 않았습니다.

이 풀리퀘스트는 그 신호(RunEvent::Reopen)가 오면 show_dashboard를 부릅니다. 맥에서만 동작합니다. 그 함수는 사용량 작은 창을 닫습니다. 대시보드 주소가 준비됐으면 그 주소로 옮기고, 아직이면 나중에 열라고 표시만 해 둡니다. 큰 창은 다시 보여 줍니다. 프록시를 새로 시작하지 않고, 새 창도 만들지 않습니다. 안내 문서는 여덟 언어에 한 문장씩 더했습니다. 구조 문서에도 이 길을 적어 두었습니다. 받는 브랜치는 dev입니다. 같은 고침으로 열린 다른 풀리퀘스트는 없습니다.

tests/clients/desktop-exit-ownership.test.ts - 테스트는 lib.rs의 글자만 봅니다. 다시 열기 신호가 show_dashboard로 이어지는 문장이 있는지만 확인합니다. 창을 닫았다가 독으로 여는 동작은 돌리지 않습니다. 작성자도 이것을 화면 테스트로 치지 않는다고 적었습니다.

풀리퀘스트 본문 - 아직 초안입니다. 리뷰 준비 체크 네 칸이 비어 있습니다. 전체 테스트는 끝나지 않았습니다. 이번 수정과 상관없는 공급자 테스트와 API 테스트가 실패했고, 그 실패가 깨끗한 dev에도 있는지는 비교 전입니다. 작성자는 리뷰 준비를 주장하지 않았습니다.

메인테이너의 판단이 필요한 지점

이 초안을 테스트 비교가 끝나기 전에 머지할지입니다. 고친 셸 코드는 다섯 줄이고, 이미 있는 창 열기 함수를 그대로 부릅니다. 맥 확인은 설치본을 갈아끼우지 않은 시험용 앱입니다. 식별자는 com.opencodex.reopentest이고, 창 개수가 1, 0, 1로 돌아왔다고 본문에 있습니다.

너의 추천

닫지 마세요. 겹치는 풀리퀘스트도 없습니다. 이 다섯 줄이 빠져 있던 다시 열기 신호를 메웁니다. 초안인 채로 머지하지 마세요. 전체 테스트와 dev 비교가 본문에 들어오고, 준비 체크가 끝난 뒤에 보세요. 글자만 보는 테스트는 이 수정에서는 받아도 됩니다. 작성자가 맥에서 창 개수로 따로 확인했습니다.

이 댓글은 grok-bot이 작성했습니다

@fflake33
fflake33 marked this pull request as ready for review September 24, 2026 05:32
@github-actions
github-actions Bot marked this pull request as draft September 24, 2026 05:33
@github-actions
github-actions Bot marked this pull request as ready for review September 24, 2026 05:39
@lidge-jun

Copy link
Copy Markdown
Owner

Carried into bundle #5742, which is now on dev (squash-merged as dd7cb69) with a Co-authored-by trailer for you, so this PR is closing as landed. Thank you for the fix. If something from this branch did not make it in, the bundle description lists what was changed during the carry.

@lidge-jun lidge-jun closed this Sep 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working review-ready

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants