|
@@ -13,7 +13,6 @@ import {
|
|
|
Code,
|
|
Code,
|
|
|
Tooltip,
|
|
Tooltip,
|
|
|
ProgressCircle,
|
|
ProgressCircle,
|
|
|
- Button,
|
|
|
|
|
} from "@opencode-ai/ui"
|
|
} from "@opencode-ai/ui"
|
|
|
import { FileIcon } from "@/ui"
|
|
import { FileIcon } from "@/ui"
|
|
|
import { MessageProgress } from "@/components/message-progress"
|
|
import { MessageProgress } from "@/components/message-progress"
|
|
@@ -52,8 +51,10 @@ import { Spinner } from "@/components/spinner"
|
|
|
import { useSession } from "@/context/session"
|
|
import { useSession } from "@/context/session"
|
|
|
import { StickyAccordionHeader } from "@/components/sticky-accordion-header"
|
|
import { StickyAccordionHeader } from "@/components/sticky-accordion-header"
|
|
|
import { SessionReview } from "@/components/session-review"
|
|
import { SessionReview } from "@/components/session-review"
|
|
|
|
|
+import { useLayout } from "@/context/layout"
|
|
|
|
|
|
|
|
export default function Page() {
|
|
export default function Page() {
|
|
|
|
|
+ const layout = useLayout()
|
|
|
const local = useLocal()
|
|
const local = useLocal()
|
|
|
const sync = useSync()
|
|
const sync = useSync()
|
|
|
const session = useSession()
|
|
const session = useSession()
|
|
@@ -176,10 +177,16 @@ export default function Page() {
|
|
|
setStore("activeDraggable", undefined)
|
|
setStore("activeDraggable", undefined)
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- const FileVisual = (props: { file: LocalFile }): JSX.Element => {
|
|
|
|
|
|
|
+ const FileVisual = (props: { file: LocalFile; active?: boolean }): JSX.Element => {
|
|
|
return (
|
|
return (
|
|
|
<div class="flex items-center gap-x-1.5">
|
|
<div class="flex items-center gap-x-1.5">
|
|
|
- <FileIcon node={props.file} class="grayscale-100 group-data-[selected]/tab:grayscale-0" />
|
|
|
|
|
|
|
+ <FileIcon
|
|
|
|
|
+ node={props.file}
|
|
|
|
|
+ classList={{
|
|
|
|
|
+ "grayscale-100 group-data-[selected]/tab:grayscale-0": !props.active,
|
|
|
|
|
+ "grayscale-0": props.active,
|
|
|
|
|
+ }}
|
|
|
|
|
+ />
|
|
|
<span
|
|
<span
|
|
|
classList={{
|
|
classList={{
|
|
|
"text-14-medium": true,
|
|
"text-14-medium": true,
|
|
@@ -300,11 +307,11 @@ export default function Page() {
|
|
|
</Tooltip>
|
|
</Tooltip>
|
|
|
</div>
|
|
</div>
|
|
|
</Tabs.Trigger>
|
|
</Tabs.Trigger>
|
|
|
- <Show when={local.layout.review.state() === "tab" && session.diffs().length}>
|
|
|
|
|
|
|
+ <Show when={layout.review.state() === "tab" && session.diffs().length}>
|
|
|
<Tabs.Trigger
|
|
<Tabs.Trigger
|
|
|
value="review"
|
|
value="review"
|
|
|
closeButton={
|
|
closeButton={
|
|
|
- <IconButton icon="collapse" size="normal" variant="ghost" onClick={local.layout.review.pane} />
|
|
|
|
|
|
|
+ <IconButton icon="collapse" size="normal" variant="ghost" onClick={layout.review.pane} />
|
|
|
}
|
|
}
|
|
|
>
|
|
>
|
|
|
<div class="flex items-center gap-3">
|
|
<div class="flex items-center gap-3">
|
|
@@ -343,8 +350,8 @@ export default function Page() {
|
|
|
<div
|
|
<div
|
|
|
classList={{
|
|
classList={{
|
|
|
"w-full flex-1 min-h-0": true,
|
|
"w-full flex-1 min-h-0": true,
|
|
|
- grid: local.layout.review.state() === "tab",
|
|
|
|
|
- flex: local.layout.review.state() === "pane",
|
|
|
|
|
|
|
+ grid: layout.review.state() === "tab",
|
|
|
|
|
+ flex: layout.review.state() === "pane",
|
|
|
}}
|
|
}}
|
|
|
>
|
|
>
|
|
|
<div class="relative shrink-0 px-6 py-3 flex flex-col gap-6 flex-1 min-h-0 w-full max-w-xl mx-auto">
|
|
<div class="relative shrink-0 px-6 py-3 flex flex-col gap-6 flex-1 min-h-0 w-full max-w-xl mx-auto">
|
|
@@ -353,7 +360,7 @@ export default function Page() {
|
|
|
<div
|
|
<div
|
|
|
classList={{
|
|
classList={{
|
|
|
"flex-1 min-h-0 pb-20": true,
|
|
"flex-1 min-h-0 pb-20": true,
|
|
|
- "flex items-start justify-start": local.layout.review.state() === "pane",
|
|
|
|
|
|
|
+ "flex items-start justify-start": layout.review.state() === "pane",
|
|
|
}}
|
|
}}
|
|
|
>
|
|
>
|
|
|
<Show when={session.messages.user().length > 1}>
|
|
<Show when={session.messages.user().length > 1}>
|
|
@@ -361,8 +368,8 @@ export default function Page() {
|
|
|
role="list"
|
|
role="list"
|
|
|
classList={{
|
|
classList={{
|
|
|
"mr-8 shrink-0 flex flex-col items-start": true,
|
|
"mr-8 shrink-0 flex flex-col items-start": true,
|
|
|
- "absolute right-full w-60 mt-3 @7xl:gap-2 @7xl:mt-1": local.layout.review.state() === "tab",
|
|
|
|
|
- "mt-3": local.layout.review.state() === "pane",
|
|
|
|
|
|
|
+ "absolute right-full w-60 mt-3 @7xl:gap-2 @7xl:mt-1": layout.review.state() === "tab",
|
|
|
|
|
+ "mt-3": layout.review.state() === "pane",
|
|
|
}}
|
|
}}
|
|
|
>
|
|
>
|
|
|
<For each={session.messages.user()}>
|
|
<For each={session.messages.user()}>
|
|
@@ -382,7 +389,7 @@ export default function Page() {
|
|
|
<li
|
|
<li
|
|
|
classList={{
|
|
classList={{
|
|
|
"group/li flex items-center self-stretch justify-end": true,
|
|
"group/li flex items-center self-stretch justify-end": true,
|
|
|
- "@7xl:justify-start": local.layout.review.state() === "tab",
|
|
|
|
|
|
|
+ "@7xl:justify-start": layout.review.state() === "tab",
|
|
|
}}
|
|
}}
|
|
|
>
|
|
>
|
|
|
<Tooltip
|
|
<Tooltip
|
|
@@ -401,7 +408,7 @@ export default function Page() {
|
|
|
classList={{
|
|
classList={{
|
|
|
"group/tick flex items-center justify-start h-2 w-8 -mr-3": true,
|
|
"group/tick flex items-center justify-start h-2 w-8 -mr-3": true,
|
|
|
"data-[active=true]:[&>div]:bg-icon-strong-base data-[active=true]:[&>div]:w-full": true,
|
|
"data-[active=true]:[&>div]:bg-icon-strong-base data-[active=true]:[&>div]:w-full": true,
|
|
|
- "@7xl:hidden": local.layout.review.state() === "tab",
|
|
|
|
|
|
|
+ "@7xl:hidden": layout.review.state() === "tab",
|
|
|
}}
|
|
}}
|
|
|
>
|
|
>
|
|
|
<div class="h-px w-5 bg-icon-base group-hover/tick:w-full group-hover/tick:bg-icon-strong-base" />
|
|
<div class="h-px w-5 bg-icon-base group-hover/tick:w-full group-hover/tick:bg-icon-strong-base" />
|
|
@@ -410,7 +417,7 @@ export default function Page() {
|
|
|
<button
|
|
<button
|
|
|
classList={{
|
|
classList={{
|
|
|
"hidden items-center self-stretch w-full gap-x-2 cursor-default": true,
|
|
"hidden items-center self-stretch w-full gap-x-2 cursor-default": true,
|
|
|
- "@7xl:flex": local.layout.review.state() === "tab",
|
|
|
|
|
|
|
+ "@7xl:flex": layout.review.state() === "tab",
|
|
|
}}
|
|
}}
|
|
|
onClick={handleClick}
|
|
onClick={handleClick}
|
|
|
>
|
|
>
|
|
@@ -654,7 +661,7 @@ export default function Page() {
|
|
|
/>
|
|
/>
|
|
|
</div>
|
|
</div>
|
|
|
</div>
|
|
</div>
|
|
|
- <Show when={local.layout.review.state() === "pane" && session.diffs().length}>
|
|
|
|
|
|
|
+ <Show when={layout.review.state() === "pane" && session.diffs().length}>
|
|
|
<div
|
|
<div
|
|
|
classList={{
|
|
classList={{
|
|
|
"relative grow px-6 py-3 flex-1 min-h-0 border-l border-border-weak-base": true,
|
|
"relative grow px-6 py-3 flex-1 min-h-0 border-l border-border-weak-base": true,
|
|
@@ -665,7 +672,7 @@ export default function Page() {
|
|
|
</Show>
|
|
</Show>
|
|
|
</div>
|
|
</div>
|
|
|
</Tabs.Content>
|
|
</Tabs.Content>
|
|
|
- <Show when={local.layout.review.state() === "tab" && session.diffs().length}>
|
|
|
|
|
|
|
+ <Show when={layout.review.state() === "tab" && session.diffs().length}>
|
|
|
<Tabs.Content value="review" class="select-text flex flex-col h-full overflow-hidden">
|
|
<Tabs.Content value="review" class="select-text flex flex-col h-full overflow-hidden">
|
|
|
<div
|
|
<div
|
|
|
classList={{
|
|
classList={{
|
|
@@ -718,8 +725,8 @@ export default function Page() {
|
|
|
},
|
|
},
|
|
|
)
|
|
)
|
|
|
return (
|
|
return (
|
|
|
- <div class="relative px-3 h-10 flex items-center bg-background-base border-x border-border-weak-base border-b border-b-transparent">
|
|
|
|
|
- <Show when={file()}>{(f) => <FileVisual file={f()} />}</Show>
|
|
|
|
|
|
|
+ <div class="relative px-6 h-12 flex items-center bg-background-stronger border-x border-border-weak-base border-b border-b-transparent">
|
|
|
|
|
+ <Show when={file()}>{(f) => <FileVisual active file={f()} />}</Show>
|
|
|
</div>
|
|
</div>
|
|
|
)
|
|
)
|
|
|
}}
|
|
}}
|
|
@@ -769,7 +776,13 @@ export default function Page() {
|
|
|
items={local.file.searchFiles}
|
|
items={local.file.searchFiles}
|
|
|
key={(x) => x}
|
|
key={(x) => x}
|
|
|
onOpenChange={(open) => setStore("fileSelectOpen", open)}
|
|
onOpenChange={(open) => setStore("fileSelectOpen", open)}
|
|
|
- onSelect={(x) => (x ? session.layout.openTab("file://" + x) : undefined)}
|
|
|
|
|
|
|
+ onSelect={(x) => {
|
|
|
|
|
+ if (x) {
|
|
|
|
|
+ local.file.open(x)
|
|
|
|
|
+ return session.layout.openTab("file://" + x)
|
|
|
|
|
+ }
|
|
|
|
|
+ return undefined
|
|
|
|
|
+ }}
|
|
|
>
|
|
>
|
|
|
{(i) => (
|
|
{(i) => (
|
|
|
<div
|
|
<div
|