fix(tui): keep fork pending view at the list inset (#55746)

This commit is contained in:
James Long
2026-10-15 13:37:37 -04:00
committed by GitHub
Unverified
parent 18d1dd453a
commit a58d1dd924
3 changed files with 19 additions and 5 deletions
@@ -5,7 +5,15 @@ import { createStore } from "solid-js/store"
import { FilePath } from "../ui/file-path"
import { useTheme } from "../context/theme"
import { useConfig } from "../config"
import { DIALOG_INSET, DialogBleed, DialogHeader, DialogLayout, useDialog, type DialogContext } from "../ui/dialog"
import {
DIALOG_INSET,
DialogBleed,
dialogWidth,
DialogHeader,
DialogLayout,
useDialog,
type DialogContext,
} from "../ui/dialog"
import { getScrollAcceleration } from "../util/scroll"
const options = ["no", "yes"] as const
@@ -40,7 +48,10 @@ export function DialogWorkspaceFileChanges(props: {
const fileNameWidth = createMemo(() =>
Math.max(
2,
Math.min(60, dimensions().width - 2) - DIALOG_INSET * 2 - 2 - Math.max(7, ...props.files.map(changeCountWidth)),
Math.min(dialogWidth("medium"), dimensions().width - 2) -
DIALOG_INSET * 2 -
2 -
Math.max(7, ...props.files.map(changeCountWidth)),
),
)
@@ -4,7 +4,7 @@ import { useRoute } from "../../context/route"
import { useClient } from "../../context/client"
import { Spinner } from "../../component/spinner"
import { DialogSelect, type DialogSelectOption } from "../../ui/dialog-select"
import { DialogHeader, DialogLayout, useDialog } from "../../ui/dialog"
import { DIALOG_LIST_INSET, DialogHeader, DialogLayout, useDialog } from "../../ui/dialog"
import { useToast } from "../../ui/toast"
import { errorMessage } from "../../util/error"
import { Locale } from "../../util/locale"
@@ -74,7 +74,7 @@ export function DialogFork(props: { sessionID: string; messageID?: string; onMov
<Show
when={!pending()}
fallback={
<DialogLayout header={<DialogHeader title="Fork session" />}>
<DialogLayout inset={DIALOG_LIST_INSET} header={<DialogHeader title="Fork session" />}>
<Spinner>Forking session…</Spinner>
</DialogLayout>
}
+4 -1
View File
@@ -124,10 +124,13 @@ export function DialogLayout(
header: JSX.Element
/** Usually a `DialogFooter` or a row of buttons. */
footer?: JSX.Element
/** Side padding in cells. Defaults to DIALOG_INSET. */
inset?: number
}>,
) {
const inset = () => props.inset ?? DIALOG_INSET
return (
<box id={props.id} paddingLeft={DIALOG_INSET} paddingRight={DIALOG_INSET} paddingBottom={1} gap={1}>
<box id={props.id} paddingLeft={inset()} paddingRight={inset()} paddingBottom={1} gap={1}>
{props.header}
<box>{props.children}</box>
{props.footer}