- Add shared compact subheader styling for preview, file, and diff panels - Open diff files in the thread file viewer when available - Fix macOS cursor auto-hide and Option-modified shortcut matching
26 lines
720 B
TypeScript
26 lines
720 B
TypeScript
import type { ScopedThreadRef } from "@t3tools/contracts";
|
|
|
|
import { useRightPanelStore } from "./rightPanelStore";
|
|
import { resolvePathLinkTarget } from "./terminal-links";
|
|
|
|
interface OpenDiffFilePrimaryActionInput {
|
|
readonly threadRef: ScopedThreadRef | null;
|
|
readonly filePath: string;
|
|
readonly activeCwd: string | undefined;
|
|
readonly openInEditor: (targetPath: string) => void;
|
|
}
|
|
|
|
export function openDiffFilePrimaryAction({
|
|
threadRef,
|
|
filePath,
|
|
activeCwd,
|
|
openInEditor,
|
|
}: OpenDiffFilePrimaryActionInput): void {
|
|
if (threadRef) {
|
|
useRightPanelStore.getState().openFile(threadRef, filePath);
|
|
return;
|
|
}
|
|
|
|
openInEditor(activeCwd ? resolvePathLinkTarget(filePath, activeCwd) : filePath);
|
|
}
|