Skip to content

fix(desktop): add VS Code Insiders as an option in the external programs dropdown#537

Merged
Kitenite merged 3 commits intosuperset-sh:mainfrom
maddada:fix/launch-vscode-insiders-if-vscode-isnt-installed
Dec 31, 2025
Merged

fix(desktop): add VS Code Insiders as an option in the external programs dropdown#537
Kitenite merged 3 commits intosuperset-sh:mainfrom
maddada:fix/launch-vscode-insiders-if-vscode-isnt-installed

Conversation

@maddada
Copy link
Copy Markdown
Contributor

@maddada maddada commented Dec 29, 2025

Description

I'm using VS Code Insiders because it's getting more features at as faster pace currently (don't have VS Code installed) superset only opens in normal VS Code. So I added a fallback to open in insiders if the stable version isn't installed.

Edit: Added a new option to the dropdown instead of using fallback.

Type of Change

  • Bug fix
  • New feature
  • Documentation
  • Refactor
  • Other (please describe): Small UX issue fixed.

Testing

Tested this manually and it worked for all the areas where the "open with vs code" option is shown.

Summary by CodeRabbit

  • New Features

    • Added Visual Studio Code Insiders as an available app option
    • Created a dedicated VS Code submenu featuring Standard and Insiders variants with improved labels
  • Improvements

    • Enhanced display labels for applications throughout the "Open In" menu
    • Added keyboard shortcut indicators for the last-used application

✏️ Tip: You can customize this high-level summary in your review settings.

Added logic to try opening files in VS Code Insiders as a fallback when
VS Code is not installed on the system.
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Dec 29, 2025

📝 Walkthrough

Walkthrough

This PR extends the external app integration to support VS Code Insiders. It adds a new app mapping, reorganizes VS Code options into a dedicated option group with display labels, updates UI tooltips and dropdowns to leverage display labels, and registers vscode-insiders in the external apps list.

Changes

Cohort / File(s) Summary
App Configuration
apps/desktop/src/lib/trpc/routers/external/helpers.ts
Added "vscode-insiders": "Visual Studio Code - Insiders" entry to APP_NAMES mapping for macOS display name association.
OpenInButton Component & Exports
apps/desktop/src/renderer/components/OpenInButton/OpenInButton.tsx
apps/desktop/src/renderer/components/OpenInButton/index.ts
Introduced VSCODE_OPTIONS as a dedicated option group containing Standard and Insiders variants, each with displayLabel. Modified AppOption interface to add optional displayLabel property. Consolidated all app options under ALL_APP_OPTIONS aggregating APP_OPTIONS, VSCODE_OPTIONS, and JETBRAINS_OPTIONS. Exported VSCODE_OPTIONS for external use.
UI Component Updates
apps/desktop/src/renderer/screens/main/components/WorkspaceView/ContentView/ChangesContent/components/FileHeader/FileHeader.tsx
apps/desktop/src/renderer/screens/main/components/WorkspaceView/WorkspaceActionBar/components/WorkspaceActionBarRight/WorkspaceActionBarRight.tsx
Updated tooltip and label logic to prefer currentApp.displayLabel when available, falling back to label. Added new VS Code submenu under Open dropdown with Standard and Insiders items, rendering from VSCODE_OPTIONS. Imported vscodeIcon and VSCODE_OPTIONS.
External Apps Registry
packages/local-db/src/schema/zod.ts
Extended EXTERNAL_APPS constant array to include "vscode-insiders".

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

Poem

🐰 A hopping update brings VS Code to light,
Insiders variant joins the display quite right,
With displayLabels and submenus so sweet,
The Open-In feature is now more complete! ✨

Pre-merge checks and finishing touches

❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 33.33% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately describes the main change: adding VS Code Insiders as an option in the external programs dropdown.
Description check ✅ Passed The description explains the motivation and the implemented solution, though it lacks related issue links and could clarify the final implementation approach more clearly.
✨ Finishing touches
  • 📝 Generate docstrings

📜 Recent review details

Configuration used: defaults

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 42df43f and 5d22228.

⛔ Files ignored due to path filters (1)
  • apps/desktop/src/renderer/assets/app-icons/vscode-insiders.svg is excluded by !**/*.svg
📒 Files selected for processing (6)
  • apps/desktop/src/lib/trpc/routers/external/helpers.ts
  • apps/desktop/src/renderer/components/OpenInButton/OpenInButton.tsx
  • apps/desktop/src/renderer/components/OpenInButton/index.ts
  • apps/desktop/src/renderer/screens/main/components/WorkspaceView/ContentView/ChangesContent/components/FileHeader/FileHeader.tsx
  • apps/desktop/src/renderer/screens/main/components/WorkspaceView/WorkspaceActionBar/components/WorkspaceActionBarRight/WorkspaceActionBarRight.tsx
  • packages/local-db/src/schema/zod.ts
🧰 Additional context used
📓 Path-based instructions (5)
apps/desktop/**/*.{ts,tsx}

📄 CodeRabbit inference engine (apps/desktop/AGENTS.md)

apps/desktop/**/*.{ts,tsx}: For Electron interprocess communication, ALWAYS use tRPC as defined in src/lib/trpc
Use alias as defined in tsconfig.json when possible
Prefer zustand for state management if it makes sense. Do not use effect unless absolutely necessary.
For tRPC subscriptions with trpc-electron, ALWAYS use the observable pattern from @trpc/server/observable instead of async generators, as the library explicitly checks isObservable(result) and throws an error otherwise

Files:

  • apps/desktop/src/renderer/screens/main/components/WorkspaceView/ContentView/ChangesContent/components/FileHeader/FileHeader.tsx
  • apps/desktop/src/renderer/components/OpenInButton/index.ts
  • apps/desktop/src/renderer/screens/main/components/WorkspaceView/WorkspaceActionBar/components/WorkspaceActionBarRight/WorkspaceActionBarRight.tsx
  • apps/desktop/src/lib/trpc/routers/external/helpers.ts
  • apps/desktop/src/renderer/components/OpenInButton/OpenInButton.tsx
**/*.{ts,tsx}

📄 CodeRabbit inference engine (AGENTS.md)

Use type safety and avoid any types unless absolutely necessary in TypeScript files

Files:

  • apps/desktop/src/renderer/screens/main/components/WorkspaceView/ContentView/ChangesContent/components/FileHeader/FileHeader.tsx
  • apps/desktop/src/renderer/components/OpenInButton/index.ts
  • apps/desktop/src/renderer/screens/main/components/WorkspaceView/WorkspaceActionBar/components/WorkspaceActionBarRight/WorkspaceActionBarRight.tsx
  • packages/local-db/src/schema/zod.ts
  • apps/desktop/src/lib/trpc/routers/external/helpers.ts
  • apps/desktop/src/renderer/components/OpenInButton/OpenInButton.tsx
apps/**/src/**/**/[A-Z]*.tsx

📄 CodeRabbit inference engine (AGENTS.md)

Structure component folders with one component per file using format ComponentName/ComponentName.tsx with index.ts barrel export

Files:

  • apps/desktop/src/renderer/screens/main/components/WorkspaceView/ContentView/ChangesContent/components/FileHeader/FileHeader.tsx
  • apps/desktop/src/renderer/screens/main/components/WorkspaceView/WorkspaceActionBar/components/WorkspaceActionBarRight/WorkspaceActionBarRight.tsx
  • apps/desktop/src/renderer/components/OpenInButton/OpenInButton.tsx
apps/desktop/src/**/*.{ts,tsx}

📄 CodeRabbit inference engine (AGENTS.md)

Move Node.js functionality needed in Electron renderer to src/main/lib/ and communicate via IPC

Files:

  • apps/desktop/src/renderer/screens/main/components/WorkspaceView/ContentView/ChangesContent/components/FileHeader/FileHeader.tsx
  • apps/desktop/src/renderer/components/OpenInButton/index.ts
  • apps/desktop/src/renderer/screens/main/components/WorkspaceView/WorkspaceActionBar/components/WorkspaceActionBarRight/WorkspaceActionBarRight.tsx
  • apps/desktop/src/lib/trpc/routers/external/helpers.ts
  • apps/desktop/src/renderer/components/OpenInButton/OpenInButton.tsx
apps/desktop/src/{shared/ipc-channels.ts,main/**/*ipcs.ts,renderer/**/*.tsx}

📄 CodeRabbit inference engine (AGENTS.md)

Define all Electron IPC channel types in apps/desktop/src/shared/ipc-channels.ts before implementing handlers

Files:

  • apps/desktop/src/renderer/screens/main/components/WorkspaceView/ContentView/ChangesContent/components/FileHeader/FileHeader.tsx
  • apps/desktop/src/renderer/screens/main/components/WorkspaceView/WorkspaceActionBar/components/WorkspaceActionBarRight/WorkspaceActionBarRight.tsx
  • apps/desktop/src/renderer/components/OpenInButton/OpenInButton.tsx
🧠 Learnings (2)
📚 Learning: 2025-12-28T01:56:39.031Z
Learnt from: CR
Repo: superset-sh/superset PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-28T01:56:39.031Z
Learning: Applies to apps/desktop/src/{shared/ipc-channels.ts,main/**/*ipcs.ts,renderer/**/*.tsx} : Define all Electron IPC channel types in `apps/desktop/src/shared/ipc-channels.ts` before implementing handlers

Applied to files:

  • apps/desktop/src/renderer/components/OpenInButton/index.ts
  • apps/desktop/src/lib/trpc/routers/external/helpers.ts
📚 Learning: 2025-12-21T04:39:28.543Z
Learnt from: CR
Repo: superset-sh/superset PR: 0
File: apps/desktop/AGENTS.md:0-0
Timestamp: 2025-12-21T04:39:28.543Z
Learning: Applies to apps/desktop/**/*.{ts,tsx} : Use alias as defined in `tsconfig.json` when possible

Applied to files:

  • apps/desktop/src/renderer/components/OpenInButton/index.ts
  • apps/desktop/src/lib/trpc/routers/external/helpers.ts
🧬 Code graph analysis (1)
apps/desktop/src/renderer/screens/main/components/WorkspaceView/WorkspaceActionBar/components/WorkspaceActionBarRight/WorkspaceActionBarRight.tsx (2)
apps/desktop/src/renderer/components/OpenInButton/OpenInButton.tsx (1)
  • VSCODE_OPTIONS (59-72)
apps/desktop/src/renderer/components/OpenInButton/index.ts (1)
  • VSCODE_OPTIONS (7-7)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: Build
🔇 Additional comments (12)
apps/desktop/src/renderer/screens/main/components/WorkspaceView/ContentView/ChangesContent/components/FileHeader/FileHeader.tsx (1)

89-89: LGTM!

The tooltip text correctly uses nullish coalescing to prefer displayLabel when available, falling back to label. This is consistent with the same pattern used in WorkspaceActionBarRight.tsx and OpenInButton.tsx.

apps/desktop/src/lib/trpc/routers/external/helpers.ts (1)

9-9: LGTM!

The macOS application name mapping for VS Code Insiders is correct. "Visual Studio Code - Insiders" matches the official application bundle name on macOS.

apps/desktop/src/renderer/components/OpenInButton/index.ts (1)

1-8: LGTM!

The barrel export correctly exposes VSCODE_OPTIONS for external consumption, maintaining consistent module boundaries.

packages/local-db/src/schema/zod.ts (1)

73-96: LGTM!

The addition of "vscode-insiders" to EXTERNAL_APPS is correctly placed after "vscode" and will be properly included in the ExternalApp union type via the as const assertion.

apps/desktop/src/renderer/screens/main/components/WorkspaceView/WorkspaceActionBar/components/WorkspaceActionBarRight/WorkspaceActionBarRight.tsx (3)

17-23: LGTM!

Imports correctly use the alias path (renderer/components/OpenInButton) as defined in tsconfig.json, and the new imports are well-organized.


110-110: LGTM!

Consistent use of the displayLabel ?? label pattern for tooltip text.


150-177: LGTM!

The VS Code submenu implementation is consistent with the existing JetBrains submenu pattern (lines 178-202). The shortcut indicator correctly displays for the last-used app within the submenu.

apps/desktop/src/renderer/components/OpenInButton/OpenInButton.tsx (5)

42-47: LGTM!

The AppOption interface extension with optional displayLabel is a clean approach that allows VS Code variants to show different labels in the submenu (Standard/Insiders) versus tooltips (VS Code/VS Code Insiders).


59-72: LGTM!

The VS Code options are well-structured with:

  • label used for submenu display (concise: "Standard", "Insiders")
  • displayLabel used for tooltips and standalone contexts (full: "VS Code", "VS Code Insiders")

89-93: LGTM!

ALL_APP_OPTIONS correctly aggregates all option groups, ensuring getAppOption can resolve any valid ExternalApp ID including the new VS Code variants.


198-228: LGTM!

The VS Code submenu implementation is consistent with the JetBrains submenu pattern (lines 229-259), maintaining UI consistency across the application.


36-36: The vscode-insiders.svg icon asset file exists at apps/desktop/src/renderer/assets/app-icons/vscode-insiders.svg and is correctly imported.


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 and usage tips.

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🧹 Nitpick comments (1)
apps/desktop/src/lib/trpc/routers/external/index.ts (1)

28-39: Consider adding logging when falling back to VS Code Insiders.

For better observability and user awareness, consider logging when the fallback to VS Code Insiders occurs. This helps users understand why Insiders is being used instead of the standard VS Code, and aids in debugging.

🔎 Suggested logging addition
 		// For VS Code, try to fallback to VS Code Insiders if VS Code is not installed
 		if (app === "vscode") {
 			try {
 				await spawnAsync(cmd.command, cmd.args);
 				return;
 			} catch {
 				// VS Code not installed, try VS Code Insiders
+				console.log('VS Code not found, falling back to VS Code Insiders');
 				const insidersCmd = getVscodeInsidersCommand(filePath);
 				await spawnAsync(insidersCmd.command, insidersCmd.args);
 				return;
 			}
 		}
📜 Review details

Configuration used: defaults

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 85064bf and 42df43f.

📒 Files selected for processing (2)
  • apps/desktop/src/lib/trpc/routers/external/helpers.ts
  • apps/desktop/src/lib/trpc/routers/external/index.ts
🧰 Additional context used
📓 Path-based instructions (3)
apps/desktop/**/*.{ts,tsx}

📄 CodeRabbit inference engine (apps/desktop/AGENTS.md)

apps/desktop/**/*.{ts,tsx}: For Electron interprocess communication, ALWAYS use tRPC as defined in src/lib/trpc
Use alias as defined in tsconfig.json when possible
Prefer zustand for state management if it makes sense. Do not use effect unless absolutely necessary.
For tRPC subscriptions with trpc-electron, ALWAYS use the observable pattern from @trpc/server/observable instead of async generators, as the library explicitly checks isObservable(result) and throws an error otherwise

Files:

  • apps/desktop/src/lib/trpc/routers/external/helpers.ts
  • apps/desktop/src/lib/trpc/routers/external/index.ts
**/*.{ts,tsx}

📄 CodeRabbit inference engine (AGENTS.md)

Use type safety and avoid any types unless absolutely necessary in TypeScript files

Files:

  • apps/desktop/src/lib/trpc/routers/external/helpers.ts
  • apps/desktop/src/lib/trpc/routers/external/index.ts
apps/desktop/src/**/*.{ts,tsx}

📄 CodeRabbit inference engine (AGENTS.md)

Move Node.js functionality needed in Electron renderer to src/main/lib/ and communicate via IPC

Files:

  • apps/desktop/src/lib/trpc/routers/external/helpers.ts
  • apps/desktop/src/lib/trpc/routers/external/index.ts
🧠 Learnings (1)
📚 Learning: 2025-12-21T04:39:28.543Z
Learnt from: CR
Repo: superset-sh/superset PR: 0
File: apps/desktop/AGENTS.md:0-0
Timestamp: 2025-12-21T04:39:28.543Z
Learning: Applies to apps/desktop/**/*.{ts,tsx} : For Electron interprocess communication, ALWAYS use tRPC as defined in `src/lib/trpc`

Applied to files:

  • apps/desktop/src/lib/trpc/routers/external/index.ts
🧬 Code graph analysis (1)
apps/desktop/src/lib/trpc/routers/external/index.ts (1)
apps/desktop/src/lib/trpc/routers/external/helpers.ts (2)
  • spawnAsync (81-108)
  • getVscodeInsidersCommand (49-53)
🔇 Additional comments (2)
apps/desktop/src/lib/trpc/routers/external/helpers.ts (2)

5-6: LGTM! Well-documented constant.

The constant is clearly documented and follows the existing naming conventions.


45-53: LGTM! Helper function follows existing patterns.

The helper function is well-structured and consistent with the existing getAppCommand pattern. The implementation correctly uses macOS's open -a command.

Comment thread apps/desktop/src/lib/trpc/routers/external/index.ts Outdated
@Kitenite
Copy link
Copy Markdown
Collaborator

@maddada would it make sense to add a new option for vscode insider instead? fallback with try catch might hide issues with vscode itself

@maddada maddada changed the title fix(desktop): fallback to VS Code Insiders when VS Code is not installed fix(desktop): add VS Code Insiders as an option in the external programs dropdown Dec 31, 2025
@maddada
Copy link
Copy Markdown
Contributor Author

maddada commented Dec 31, 2025

@Kitenite modified it to be like this:
2025-12-31_Electron_06-35-21

Shows as "Open in VS Code Insiders" in tooltips.

Copy link
Copy Markdown
Collaborator

@Kitenite Kitenite left a comment

Choose a reason for hiding this comment

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

This works, thanks for making the adjustments @maddada ! Will come out next release :)

@Kitenite Kitenite merged commit 5dd614b into superset-sh:main Dec 31, 2025
11 of 13 checks passed
@Kitenite
Copy link
Copy Markdown
Collaborator

This works, thanks for making the adjustments @maddada ! Will come out next release :)

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.

2 participants