Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions apps/web/src/components/ChatView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3380,6 +3380,8 @@ export default function ChatView(props: ChatViewProps) {
{...(isServerThread && isGitRepo
? { onOpenChanges: openChangesFromThreadPanelStable }
: {})}
// Coder: changed files in the Git actions dialog open in the Files surface.
{...(isServerThread ? { onOpenFile: openFileSurfaceStable } : {})}
onRunProjectScript={runProjectScriptStable}
onAddProjectScript={saveProjectScriptStable}
onUpdateProjectScript={updateProjectScriptStable}
Expand Down
8 changes: 7 additions & 1 deletion apps/web/src/components/GitActionsControl.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -1721,7 +1721,13 @@ export default function GitActionsControl({
<button
type="button"
className="flex min-w-0 flex-1 items-center justify-between gap-3 text-left enabled:cursor-pointer"
onClick={() => onOpenFile?.(changedFileOpenPath(file.path))}
aria-label={`Open ${file.path} in Files`}
onClick={() => {
onOpenFile?.(changedFileOpenPath(file.path));
// Coder: the file opens in the right panel behind this dialog,
// so the dialog closes; its message stays for the next open.
setIsCommitDialogOpen(false);
}}
disabled={!onOpenFile}
>
<StartTruncatedPath
Expand Down
3 changes: 3 additions & 0 deletions apps/web/src/components/chat/ThreadDetailsPanel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,8 @@ interface ThreadDetailsPanelProps extends Pick<
onCheckoutPullRequestRequest?: (reference: string) => void;
onComposerFocusRequest: () => void;
onOpenChanges?: () => void;
/** Coder: opens a changed file from the Git actions dialog in the Files surface. */
onOpenFile?: (relativePath: string) => void;
onRunProjectScript: (script: ProjectScript) => void;
onAddProjectScript: (input: NewProjectScriptInput) => Promise<ProjectScriptActionResult>;
onUpdateProjectScript: (
Expand Down Expand Up @@ -161,6 +163,7 @@ export function ThreadDetailsPanel(props: ThreadDetailsPanelProps) {
activeThreadRef={activeThreadRef}
{...(props.draftId ? { draftId: props.draftId } : {})}
{...(props.onOpenChanges ? { onOpenChanges: props.onOpenChanges } : {})}
{...(props.onOpenFile ? { onOpenFile: props.onOpenFile } : {})}
/>
) : null}
</div>
Expand Down
4 changes: 3 additions & 1 deletion docs/internals/coder-only.md
Original file line number Diff line number Diff line change
Expand Up @@ -1051,7 +1051,9 @@ listed here is drift to remove rather than fork behavior to keep.
`resolveFileContextMenuAbsolutePath` but replaces its editor and reveal items with Open in Files
(when the caller passes a thread) and Copy path, which copies that full path; the Files tree,
the diff panel, and turn change cards use it. Changed files in the Git actions dialog open in the
Files surface instead of an editor: repository-relative status paths map to the thread's folder,
Files surface instead of an editor (`ChatView` passes `openFileSurfaceStable` through
`ThreadDetailsPanel`'s `onOpenFile`), and the dialog closes so the file is visible, keeping its
commit message for the next open: repository-relative status paths map to the thread's folder,
and a file outside a subfolder project opens by its absolute path.
`projectFilesQueryState.ts` has no `isFile`, which only the uncarried `OpenInPicker` reads.
`env.ts` reports `isElectron = false` for upstream's desktop branches.
Expand Down