feat(web): open diff files in external editor #9670
Closedipanasenko(GitHub profile, opens in a new tab)wants to merge 14 commits into
main fromrefs/pull/9670/headopened View on GitHubgithub-actions[bot](GitHub profile, opens in a new tab) added labelsvouch:trusted
github-actions[bot](GitHub profile, opens in a new tab) added labelssize:L
- apps/web/src/components/DiffFileHeaderActionButton.tsx line 36OutdatedResolvedby ipanasenko(GitHub profile, opens in a new tab)@@ -0,0 +16,21 @@16+ disabled?: boolean;17+ onClick: () => void;18+ tooltip: string;19+}) {20+ return (21+ <Tooltip>22+ <TooltipTrigger23+ render={24+ <Button25+ ref={ref}26+ size="icon-micro"27+ variant="ghost"28+ className="text-muted-foreground [:hover,[data-pressed]]:bg-transparent"29+ aria-label={ariaLabel}30+ disabled={disabled}31+ onClick={onClick}32+ />33+ }34+ >35+ {children}36+ </TooltipTrigger>apps/web/src/components/DiffPanel.tsx line 523OutdatedResolvedby cursor[bot](GitHub profile, opens in a new tab)@@ -500,6 +506,18 @@500- })();501- },506+ openInEditor: launchDiffFileInEditor,507+ });508+ },509+ [activeCwd, activeRepositoryRoot, launchDiffFileInEditor, routeThreadRef],510+ );511+ const openDiffFileExternally = useCallback(512+ (filePath: string) => {513+ openDiffFileInEditor({514+ filePath,515+ activeCwd,516+ repositoryRoot: activeRepositoryRoot,517+ openInEditor: launchDiffFileInEditor,502518 });503519 },504- [activeCwd, activeRepositoryRoot, openInPreferredEditor, routeThreadRef],520+ [activeCwd, activeRepositoryRoot, launchDiffFileInEditor],505521 );522+ const canOpenDiffFileExternally =523+ activeCwd != null && activeThread != null && (serverConfig?.availableEditors.length ?? 0) > 0;
- apps/web/src/components/DiffFileHeaderActionButton.tsx line 28OutdatedResolvedby macroscopeapp[bot](GitHub profile, opens in a new tab)@@ -0,0 +8,21 @@8+ children,9+ disabled,10+ onClick,11+ tooltip,12+}: {13+ ref?: Ref<HTMLButtonElement>;14+ ariaLabel: string;15+ children: ReactNode;16+ disabled?: boolean;17+ onClick: () => void;18+ tooltip: string;19+}) {20+ return (21+ <Tooltip>22+ <TooltipTrigger23+ render={24+ <Button25+ ref={ref}26+ size="icon-micro"27+ variant="ghost"28+ className="text-muted-foreground [:hover,[data-pressed]]:bg-transparent disabled:pointer-events-auto disabled:cursor-not-allowed"
- apps/web/src/components/DiffFileHeaderActionButton.tsx line 28OutdatedResolvedby coderabbitai[bot](GitHub profile, opens in a new tab)@@ -0,0 +8,21 @@8+ children,9+ disabled,10+ onClick,11+ tooltip,12+}: {13+ ref?: Ref<HTMLButtonElement>;14+ ariaLabel: string;15+ children: ReactNode;16+ disabled?: boolean;17+ onClick: () => void;18+ tooltip: string;19+}) {20+ return (21+ <Tooltip>22+ <TooltipTrigger23+ render={24+ <Button25+ ref={ref}26+ size="icon-micro"27+ variant="ghost"28+ className="text-muted-foreground [:hover,[data-pressed]]:bg-transparent disabled:pointer-events-auto disabled:cursor-not-allowed"
Sign in to join this conversation.



cursor[bot](GitHub profile, opens in a new tab) reviewed
Cursor Bugbot has reviewed your changes using default effort and found 2 potential issues.