mirror of
https://gitea.toothfairyai.com/ToothFairyAI/tf_code.git
synced 2026-04-25 10:04:40 +00:00
fix(app): show review on the empty session route (#18251)
This commit is contained in:
@@ -420,7 +420,7 @@ export default function Page() {
|
|||||||
const diffs = createMemo(() => (params.id ? (sync.data.session_diff[params.id] ?? []) : []))
|
const diffs = createMemo(() => (params.id ? (sync.data.session_diff[params.id] ?? []) : []))
|
||||||
const sessionCount = createMemo(() => Math.max(info()?.summary?.files ?? 0, diffs().length))
|
const sessionCount = createMemo(() => Math.max(info()?.summary?.files ?? 0, diffs().length))
|
||||||
const hasSessionReview = createMemo(() => sessionCount() > 0)
|
const hasSessionReview = createMemo(() => sessionCount() > 0)
|
||||||
const canReview = createMemo(() => !!params.id)
|
const canReview = createMemo(() => !!params.dir)
|
||||||
const reviewTab = createMemo(() => isDesktop())
|
const reviewTab = createMemo(() => isDesktop())
|
||||||
const tabState = createSessionTabs({
|
const tabState = createSessionTabs({
|
||||||
tabs,
|
tabs,
|
||||||
@@ -1165,6 +1165,18 @@ export default function Page() {
|
|||||||
</div>
|
</div>
|
||||||
)
|
)
|
||||||
|
|
||||||
|
const mobileReview = () =>
|
||||||
|
reviewContent({
|
||||||
|
diffStyle: "unified",
|
||||||
|
classes: {
|
||||||
|
root: "pb-8",
|
||||||
|
header: "px-4",
|
||||||
|
container: "px-4",
|
||||||
|
},
|
||||||
|
loadingClass: "px-4 py-4 text-text-weak",
|
||||||
|
emptyClass: "h-full pb-64 -mt-4 flex flex-col items-center justify-center text-center gap-6",
|
||||||
|
})
|
||||||
|
|
||||||
createEffect(
|
createEffect(
|
||||||
on(
|
on(
|
||||||
activeFileTab,
|
activeFileTab,
|
||||||
@@ -1798,7 +1810,7 @@ export default function Page() {
|
|||||||
<div class="relative bg-background-base size-full overflow-hidden flex flex-col">
|
<div class="relative bg-background-base size-full overflow-hidden flex flex-col">
|
||||||
<SessionHeader />
|
<SessionHeader />
|
||||||
<div class="flex-1 min-h-0 flex flex-col md:flex-row">
|
<div class="flex-1 min-h-0 flex flex-col md:flex-row">
|
||||||
<Show when={!isDesktop() && !!params.id}>
|
<Show when={!isDesktop() && canReview()}>
|
||||||
<Tabs value={store.mobileTab} class="h-auto">
|
<Tabs value={store.mobileTab} class="h-auto">
|
||||||
<Tabs.List>
|
<Tabs.List>
|
||||||
<Tabs.Trigger
|
<Tabs.Trigger
|
||||||
@@ -1840,16 +1852,7 @@ export default function Page() {
|
|||||||
<Show when={lastUserMessage()}>
|
<Show when={lastUserMessage()}>
|
||||||
<MessageTimeline
|
<MessageTimeline
|
||||||
mobileChanges={mobileChanges()}
|
mobileChanges={mobileChanges()}
|
||||||
mobileFallback={reviewContent({
|
mobileFallback={mobileReview()}
|
||||||
diffStyle: "unified",
|
|
||||||
classes: {
|
|
||||||
root: "pb-8",
|
|
||||||
header: "px-4",
|
|
||||||
container: "px-4",
|
|
||||||
},
|
|
||||||
loadingClass: "px-4 py-4 text-text-weak",
|
|
||||||
emptyClass: "h-full pb-64 -mt-4 flex flex-col items-center justify-center text-center gap-6",
|
|
||||||
})}
|
|
||||||
actions={actions}
|
actions={actions}
|
||||||
scroll={ui.scroll}
|
scroll={ui.scroll}
|
||||||
onResumeScroll={resumeScroll}
|
onResumeScroll={resumeScroll}
|
||||||
@@ -1881,7 +1884,9 @@ export default function Page() {
|
|||||||
</Show>
|
</Show>
|
||||||
</Match>
|
</Match>
|
||||||
<Match when={true}>
|
<Match when={true}>
|
||||||
<NewSessionView worktree={newSessionWorktree()} />
|
<Show when={mobileChanges()} fallback={<NewSessionView worktree={newSessionWorktree()} />}>
|
||||||
|
<div class="relative h-full overflow-hidden">{mobileReview()}</div>
|
||||||
|
</Show>
|
||||||
</Match>
|
</Match>
|
||||||
</Switch>
|
</Switch>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
Reference in New Issue
Block a user