Skip to content

Commit 8f27708

Browse files
authored
Open PR review files in code viewer (#91)
- Route PR workspace file opens through the in-app code viewer - Remove the direct editor-path opener from the review button
1 parent dcc6776 commit 8f27708

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

apps/web/src/components/pr-review/PrWorkspace.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,13 @@ import { cn } from "~/lib/utils";
1616
import { ensureNativeApi } from "~/nativeApi";
1717
import { Button } from "~/components/ui/button";
1818
import { joinPath, projectLabel } from "~/components/review/reviewUtils";
19+
import { useCodeViewerStore } from "~/codeViewerStore";
1920
import type { Project } from "~/types";
2021
import { PrFileCommentComposer } from "./PrFileCommentComposer";
2122
import { PrFileTabStrip, type FileViewMode } from "./PrFileTabStrip";
2223
import {
2324
PR_REVIEW_DIFF_UNSAFE_CSS,
2425
buildFileDiffRenderKey,
25-
openPathInEditor,
2626
parseRenderablePatch,
2727
resolveFileDiffPath,
2828
shortCommentPreview,
@@ -52,6 +52,7 @@ export function PrWorkspace({
5252
onCreateThread: (input: { path: string; line: number; body: string }) => Promise<void>;
5353
}) {
5454
const { resolvedTheme } = useTheme();
55+
const openFileInCodeViewer = useCodeViewerStore((state) => state.openFile);
5556
const [fileViewMode, setFileViewMode] = useLocalStorage(
5657
"okcode:pr-review:file-view-mode",
5758
"single",
@@ -227,7 +228,7 @@ export function PrWorkspace({
227228
) : null}
228229
<Button
229230
onClick={() => {
230-
void openPathInEditor(joinPath(project.cwd, filePath));
231+
openFileInCodeViewer(project.cwd, filePath);
231232
}}
232233
size="xs"
233234
variant="outline"

0 commit comments

Comments
 (0)