fix: macOS app foreground identity#1733
Conversation
📝 WalkthroughWalkthroughThis PR implements macOS app name identity for DeepChat by setting the Electron application name to "DeepChat" at startup and wiring platform-specific activation helpers throughout the main-process startup and window presentation lifecycle to establish correct Dock identity and ensure app activation before windows take focus. ChangesmacOS App Name Identity Implementation
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
Suggested reviewers
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
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. Comment |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
src/main/appMain.ts (1)
174-174: 💤 Low valueRedundant call to
ensureRegularAppOnMac.This call duplicates the earlier invocation in lines 28-36, which already ensures the function runs when the app becomes ready. Since
ensureRegularAppOnMacis idempotent, this redundancy is safe but unnecessary.♻️ Remove redundant call
app.whenReady().then(async () => { - ensureRegularAppOnMac() // Set app user model id for windows🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@src/main/appMain.ts` at line 174, Remove the redundant invocation of ensureRegularAppOnMac by deleting the extra call currently located near the app startup sequence; keep the original ensureRegularAppOnMac invocation that runs when the app becomes ready (the earlier call that ensures idempotent behavior) and remove the duplicate to avoid unnecessary repetition while preserving the existing initialization flow.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Nitpick comments:
In `@src/main/appMain.ts`:
- Line 174: Remove the redundant invocation of ensureRegularAppOnMac by deleting
the extra call currently located near the app startup sequence; keep the
original ensureRegularAppOnMac invocation that runs when the app becomes ready
(the earlier call that ensures idempotent behavior) and remove the duplicate to
avoid unnecessary repetition while preserving the existing initialization flow.
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: a79aa7c2-5e41-4465-83c1-0d19fbccad18
📒 Files selected for processing (8)
docs/issues/mac-app-name-identity/plan.mddocs/issues/mac-app-name-identity/spec.mddocs/issues/mac-app-name-identity/tasks.mdsrc/main/appMain.tssrc/main/lib/activateApp.tssrc/main/presenter/lifecyclePresenter/SplashWindowManager.tssrc/main/presenter/lifecyclePresenter/hooks/ready/eventListenerSetupHook.tssrc/main/presenter/windowPresenter/index.ts
Summary
Fix the macOS app identity path so DeepChat becomes the active foreground app instead of leaving the menu bar attached to the previously focused application.
What changed
Validation
pnpm run typecheck:nodepnpm run formatpnpm run i18npnpm run lintpnpm run typecheckSummary by CodeRabbit
New Features
Documentation