Skip to content

Commit 4940470

Browse files
quickbeardclaude
andcommitted
feat(app): put the Work explanation under the dialog title
It explains the whole dialog, not the name field it happened to sit above, so it belongs with the title rather than as the first line of the body. Uses the component's own DialogTitleGroup instead of placing a paragraph by hand: that is what the description slot is for, it carries the intended typography, and it renders a Kobalte Description, so the dialog gains aria-describedby and screen readers announce the reason with the title. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
1 parent b4b6671 commit 4940470

1 file changed

Lines changed: 21 additions & 5 deletions

File tree

‎packages/app/src/sandbox/dialog-add.tsx‎

Lines changed: 21 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,14 @@
11
import { useDialog } from "@opencode-ai/ui/context/dialog"
22
import { showToast } from "@opencode-ai/ui/toast"
33
import { ButtonV2 } from "@opencode-ai/ui/v2/button-v2"
4-
import { Dialog, DialogBody, DialogFooter, DialogHeader, DialogTitle } from "@opencode-ai/ui/v2/dialog-v2"
4+
import {
5+
Dialog,
6+
DialogBody,
7+
DialogFooter,
8+
DialogHeader,
9+
DialogTitle,
10+
DialogTitleGroup,
11+
} from "@opencode-ai/ui/v2/dialog-v2"
512
import { DividerV2 } from "@opencode-ai/ui/v2/divider-v2"
613
import { LoaderV2 } from "@opencode-ai/ui/v2/loader-v2"
714
import { TextInputV2 } from "@opencode-ai/ui/v2/text-input-v2"
@@ -199,13 +206,22 @@ export function DialogAddSandbox(props: {
199206
return (
200207
<Dialog fit>
201208
<DialogHeader hideClose={true}>
202-
<DialogTitle>{language.t("sandbox.server.add")}</DialogTitle>
209+
{/* As a description under the title rather than a line in the body:
210+
it explains the whole dialog, not the field it happens to sit
211+
above, and DialogTitleGroup ties it to the dialog for screen
212+
readers. */}
213+
<Show
214+
when={props.requiredForWork}
215+
fallback={<DialogTitle>{language.t("sandbox.server.add")}</DialogTitle>}
216+
>
217+
<DialogTitleGroup
218+
title={language.t("sandbox.server.add")}
219+
description={language.t("sandbox.add.workIntro")}
220+
/>
221+
</Show>
203222
</DialogHeader>
204223
<DividerV2 />
205224
<DialogBody class="flex flex-col gap-3 px-4 pt-3 pb-1">
206-
<Show when={props.requiredForWork}>
207-
<p class="text-12 text-v2-text-text-muted">{language.t("sandbox.add.workIntro")}</p>
208-
</Show>
209225
<Show
210226
when={availability()?.supported !== false}
211227
fallback={<p class="text-14 text-v2-text-text-muted">{unsupportedMessage()}</p>}

0 commit comments

Comments
 (0)