Files
openchamber/packages/ui/src/lib/openInApps.ts
T
Dave OteroandBohdan Triapitsyn becd240168 Add Windows Electron desktop support (#1093)
* fix: make upstream sync actions target the selected remote

Ensure fetch and pull actually honor upstream selection so fork maintenance works from the Git sidebar, and surface upstream branch status alongside the primary origin-tracking indicators.

* feat: add Windows Electron desktop foundation

* fix(electron): stabilize Windows desktop packaging

* fix(electron): stabilize Windows desktop chrome

Use native Windows titlebar behavior with an Alt-accessible hidden menu, and harden Windows dev command launching so the desktop app follows platform conventions.

* fix(electron): stabilize Windows dev startup

* fix(electron): clarify desktop artifact names

* fix(electron): harden Windows desktop release and launch

* fix(electron): address Windows release review

* fix(electron): point updater and release links to org repo

* Fix Windows settings persistence fallback

* Fix Windows Electron dev startup

* Add Windows Electron window controls

* Fix Windows Electron install and opencode launch

* fix: resolve git status for repositories without upstream

Fixes repository detection stuck on Checking repository
Handles git status when no upstream is configured
Adds regression coverage for git status loading

* Add Windows app menu button

* fix: preserve file editor line endings

* ci: add desktop release smoke workflow

---------

Co-authored-by: Bohdan Triapitsyn <artmore@protonmail.com>
2026-05-26 18:13:59 +03:00

57 lines
2.4 KiB
TypeScript

export type OpenInApp = {
id: string;
label: string;
appName: string;
};
export const OPEN_IN_APPS: OpenInApp[] = [
{ id: 'finder', label: 'Finder', appName: 'Finder' },
{ id: 'terminal', label: 'Terminal', appName: 'Terminal' },
{ id: 'iterm2', label: 'iTerm2', appName: 'iTerm' },
{ id: 'ghostty', label: 'Ghostty', appName: 'Ghostty' },
{ id: 'vscode', label: 'VS Code', appName: 'Visual Studio Code' },
{ id: 'intellij', label: 'IntelliJ', appName: 'IntelliJ IDEA' },
{ id: 'visual-studio', label: 'Visual Studio', appName: 'Visual Studio' },
{ id: 'cursor', label: 'Cursor', appName: 'Cursor' },
{ id: 'android-studio', label: 'Android Studio', appName: 'Android Studio' },
{ id: 'pycharm', label: 'PyCharm', appName: 'PyCharm' },
{ id: 'xcode', label: 'Xcode', appName: 'Xcode' },
{ id: 'sublime-text', label: 'Sublime', appName: 'Sublime Text' },
{ id: 'webstorm', label: 'WebStorm', appName: 'WebStorm' },
{ id: 'rider', label: 'Rider', appName: 'Rider' },
{ id: 'zed', label: 'Zed', appName: 'Zed' },
{ id: 'phpstorm', label: 'PhpStorm', appName: 'PhpStorm' },
{ id: 'eclipse', label: 'Eclipse', appName: 'Eclipse' },
{ id: 'windsurf', label: 'Windsurf', appName: 'Windsurf' },
{ id: 'vscodium', label: 'VSCodium', appName: 'VSCodium' },
{ id: 'rustrover', label: 'RustRover', appName: 'RustRover' },
{ id: 'kiro', label: 'Kiro', appName: 'Kiro' },
{ id: 'antigravity', label: 'Antigravity', appName: 'Antigravity' },
{ id: 'trae', label: 'Trae', appName: 'Trae' },
];
export const DEFAULT_OPEN_IN_APP_ID = 'finder';
export const OPEN_IN_ALWAYS_AVAILABLE_APP_IDS = new Set(['finder', 'terminal']);
export const OPEN_DIRECTORY_APP_IDS = new Set(['finder', 'terminal', 'iterm2', 'ghostty']);
export const getPlatformOpenInApp = (app: OpenInApp): OpenInApp => {
if (typeof window !== 'undefined' && window.__OPENCHAMBER_PLATFORM__ === 'win32') {
if (app.id === 'finder') {
return { ...app, label: 'Explorer', appName: 'File Explorer' };
}
}
return app;
};
export const getOpenInAppById = (id: string | null | undefined): OpenInApp | null => {
if (!id) {
return null;
}
const app = OPEN_IN_APPS.find((candidate) => candidate.id === id) ?? null;
return app ? getPlatformOpenInApp(app) : null;
};
export const getDefaultOpenInApp = (): OpenInApp => {
return getOpenInAppById(DEFAULT_OPEN_IN_APP_ID) ?? getPlatformOpenInApp(OPEN_IN_APPS[0]);
};