fix(app): close review pane

This commit is contained in:
adamelmore
2026-01-28 10:26:55 -06:00
parent af3c97f192
commit f607353be6
6 changed files with 41 additions and 83 deletions

View File

@@ -44,7 +44,7 @@ export function DialogSelectFile(props: { mode?: DialogSelectFileMode; onOpenFil
"session.previous",
"session.next",
"terminal.toggle",
"fileTree.toggle",
"review.toggle",
]
const limit = 5
@@ -162,6 +162,7 @@ export function DialogSelectFile(props: { mode?: DialogSelectFileMode; onOpenFil
const value = file.tab(path)
tabs().open(value)
file.load(path)
layout.fileTree.open()
layout.fileTree.setTab("all")
props.onOpenFile?.(path)
}

View File

@@ -189,12 +189,13 @@ export const PromptInput: Component<PromptInputProps> = (props) => {
const wantsReview = item.commentOrigin === "review" || (item.commentOrigin !== "file" && commentInReview(item.path))
if (wantsReview) {
layout.fileTree.open()
layout.fileTree.setTab("changes")
if (!layout.fileTree.opened()) tabs().open("review")
requestAnimationFrame(() => comments.setFocus(focus))
return
}
layout.fileTree.open()
layout.fileTree.setTab("all")
const tab = files.tab(item.path)
tabs().open(tab)

View File

@@ -57,6 +57,7 @@ export function SessionContextUsage(props: SessionContextUsageProps) {
const openContext = () => {
if (!params.id) return
layout.fileTree.open()
layout.fileTree.setTab("all")
tabs().open("context")
tabs().setActive("context")

View File

@@ -280,17 +280,14 @@ export function SessionHeader() {
</TooltipKeybind>
</div>
<div class="hidden md:block shrink-0">
<TooltipKeybind
title={language.t("command.fileTree.toggle")}
keybind={command.keybind("fileTree.toggle")}
>
<TooltipKeybind title={language.t("command.review.toggle")} keybind={command.keybind("review.toggle")}>
<Button
variant="ghost"
class="group/file-tree-toggle size-6 p-0"
onClick={() => layout.fileTree.toggle()}
aria-label={language.t("command.fileTree.toggle")}
aria-label={language.t("command.review.toggle")}
aria-expanded={layout.fileTree.opened()}
aria-controls="file-tree-panel"
aria-controls="review-panel"
>
<div class="relative flex items-center justify-center size-4 [&>*]:absolute [&>*]:inset-0">
<Icon