Files
t3code/apps/web/src/diffFileActions.ts
Julius Marminge c2d44a312c Unify compact subheaders and diff file navigation
- 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
2026-06-15 15:58:03 -07:00

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);
}