File tree Expand file tree Collapse file tree
apps/web/src/components/pr-review Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -16,13 +16,13 @@ import { cn } from "~/lib/utils";
1616import { ensureNativeApi } from "~/nativeApi" ;
1717import { Button } from "~/components/ui/button" ;
1818import { joinPath , projectLabel } from "~/components/review/reviewUtils" ;
19+ import { useCodeViewerStore } from "~/codeViewerStore" ;
1920import type { Project } from "~/types" ;
2021import { PrFileCommentComposer } from "./PrFileCommentComposer" ;
2122import { PrFileTabStrip , type FileViewMode } from "./PrFileTabStrip" ;
2223import {
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"
You can’t perform that action at this time.
0 commit comments