mirror of
https://github.com/anomalyco/opencode.git
synced 2026-05-01 22:10:23 +00:00
feat(app): add view button to open files from review sidebar (#7095)
This commit is contained in:
parent
4142e1bcf6
commit
6092f8792e
4 changed files with 50 additions and 0 deletions
|
|
@ -58,6 +58,7 @@ interface SessionReviewTabProps {
|
|||
view: () => ReturnType<ReturnType<typeof useLayout>["view"]>
|
||||
diffStyle: DiffStyle
|
||||
onDiffStyleChange?: (style: DiffStyle) => void
|
||||
onViewFile?: (file: string) => void
|
||||
classes?: {
|
||||
root?: string
|
||||
header?: string
|
||||
|
|
@ -137,6 +138,7 @@ function SessionReviewTab(props: SessionReviewTabProps) {
|
|||
diffs={props.diffs()}
|
||||
diffStyle={props.diffStyle}
|
||||
onDiffStyleChange={props.onDiffStyleChange}
|
||||
onViewFile={props.onViewFile}
|
||||
/>
|
||||
)
|
||||
}
|
||||
|
|
@ -818,6 +820,11 @@ export default function Page() {
|
|||
diffs={diffs}
|
||||
view={view}
|
||||
diffStyle="unified"
|
||||
onViewFile={(path) => {
|
||||
const value = file.tab(path)
|
||||
tabs().open(value)
|
||||
file.load(path)
|
||||
}}
|
||||
classes={{
|
||||
root: "pb-[calc(var(--prompt-height,8rem)+32px)]",
|
||||
header: "px-4",
|
||||
|
|
@ -1028,6 +1035,11 @@ export default function Page() {
|
|||
view={view}
|
||||
diffStyle={layout.review.diffStyle()}
|
||||
onDiffStyleChange={layout.review.setDiffStyle}
|
||||
onViewFile={(path) => {
|
||||
const value = file.tab(path)
|
||||
tabs().open(value)
|
||||
file.load(path)
|
||||
}}
|
||||
/>
|
||||
</div>
|
||||
</Tabs.Content>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue