feat(desktop): add Google Antigravity IDE to Open In dropdown#1552
Conversation
Add Antigravity as an external app option so users can open workspaces and files directly in Google's Antigravity IDE.
📝 WalkthroughWalkthroughAdded "Antigravity" as a new external application entry across three configuration files: mapped as a display name in the APP_NAMES lookup table, added to the APP_OPTIONS UI array with icon and label, and registered in the EXTERNAL_APPS literal type definitions. Changes
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~3 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches
🧪 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 |
🚀 Preview Deployment🔗 Preview Links
Preview updates automatically with new commits |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
apps/desktop/src/renderer/components/OpenInButton/OpenInButton.tsx (1)
102-103: Consider replacing the positionalAPP_OPTIONS[1]fallback with an explicit ID lookup.
APP_OPTIONS[1]silently relies oncursorbeing at index 1. Any future reordering ofAPP_OPTIONS(e.g., adding another entry beforecursor) would change the fallback without a compile-time warning. This PR preserves the current index, but the pattern is fragile.🔧 Suggested fix
-export const getAppOption = (id: ExternalApp) => - ALL_APP_OPTIONS.find((app) => app.id === id) ?? APP_OPTIONS[1]; +export const getAppOption = (id: ExternalApp) => + ALL_APP_OPTIONS.find((app) => app.id === id) ?? + ALL_APP_OPTIONS.find((app) => app.id === "cursor")!;🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@apps/desktop/src/renderer/components/OpenInButton/OpenInButton.tsx` around lines 102 - 103, getAppOption uses a positional fallback APP_OPTIONS[1], which is fragile if APP_OPTIONS is reordered; change the fallback to an explicit ID lookup instead. Update getAppOption (and any uses of ALL_APP_OPTIONS/APP_OPTIONS) to return ALL_APP_OPTIONS.find(app => app.id === id) ?? ALL_APP_OPTIONS.find(app => app.id === 'cursor') (or the appropriate ExternalApp cursor ID constant), so the fallback is based on the explicit app id rather than an array index.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Nitpick comments:
In `@apps/desktop/src/renderer/components/OpenInButton/OpenInButton.tsx`:
- Around line 102-103: getAppOption uses a positional fallback APP_OPTIONS[1],
which is fragile if APP_OPTIONS is reordered; change the fallback to an explicit
ID lookup instead. Update getAppOption (and any uses of
ALL_APP_OPTIONS/APP_OPTIONS) to return ALL_APP_OPTIONS.find(app => app.id ===
id) ?? ALL_APP_OPTIONS.find(app => app.id === 'cursor') (or the appropriate
ExternalApp cursor ID constant), so the fallback is based on the explicit app id
rather than an array index.
Summary
Changes
packages/local-db/src/schema/zod.ts— Added"antigravity"to theEXTERNAL_APPStype unionapps/desktop/src/lib/trpc/routers/external/helpers.ts— Added macOS app name mapping (open -a Antigravity)apps/desktop/src/renderer/components/OpenInButton/OpenInButton.tsx— Added icon import and menu entry (between Cursor and Zed)apps/desktop/src/renderer/assets/app-icons/antigravity.svg— Clean vector icon using the official Antigravity arc shape with Google brand gradientTest Plan
bun run typecheck)Summary by CodeRabbit