Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ function ActiveSubtasksListContent({ taskEntryKey }: ActiveSubtasksListProps) {

return (
<div className="overflow-hidden border-b border-background">
<TodoListPrimitive>
<TodoListPrimitive className="mx-auto w-full max-w-4xl">
<TodoListSection onOpenChange={setIsOpen} open={isOpen}>
<TodoListSectionTrigger>
<TodoListSectionLabel
Expand Down
74 changes: 38 additions & 36 deletions apps/web/src/app/(sandbox)/task/[taskId]/DraftPromptBanner.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,53 +7,55 @@ import { Button, CornerDownLeftIcon, InfoTooltip } from '@/components/system';
interface DraftPromptBannerProps {
draftPrompt: string;
onClick?: () => void;
embedded?: boolean;
}

export function DraftPromptBanner({
draftPrompt,
onClick,
embedded = false,
}: DraftPromptBannerProps) {
const interactive = !!onClick;

return (
<div className="border-t">
<div className="2xl:max-w-5xl mx-auto w-full px-4 pb-5 pt-4">
<div
className={`flex gap-3 items-start ${interactive ? 'cursor-pointer hover:opacity-50' : ''}`}
role={interactive ? 'button' : undefined}
tabIndex={interactive ? 0 : undefined}
onClick={onClick}
onKeyDown={
interactive
? (e) => {
if (e.key === 'Enter' || e.key === ' ') {
onClick();
}
const banner = (
<div className="mx-auto w-full max-w-4xl px-4 pb-5 pt-4">
<div
className={`flex gap-3 items-start ${interactive ? 'cursor-pointer hover:opacity-50' : ''}`}
role={interactive ? 'button' : undefined}
tabIndex={interactive ? 0 : undefined}
onClick={onClick}
onKeyDown={
interactive
? (e) => {
if (e.key === 'Enter' || e.key === ' ') {
onClick();
}
: undefined
}
>
<div className="resize-none font-mono rounded-xl text-sm text-muted-foreground opacity-70 pointer-events-none">
{draftPrompt}
</div>
{interactive && (
<InfoTooltip
iconClassName="mt-1 size-3.5 shrink-0"
content={`${PRODUCT_NAME} is asleep. Wake it up to keep chatting`}
/>
)}
<Button
size="icon"
variant="default"
className="ml-auto"
disabled
aria-label="Submit"
tabIndex={-1}
>
<CornerDownLeftIcon className="size-4" />
</Button>
}
: undefined
}
>
<div className="resize-none font-mono rounded-xl text-sm text-muted-foreground opacity-70 pointer-events-none">
{draftPrompt}
</div>
{interactive && (
<InfoTooltip
iconClassName="mt-1 size-3.5 shrink-0"
content={`${PRODUCT_NAME} is asleep. Wake it up to keep chatting`}
/>
)}
<Button
size="icon"
variant="default"
className="ml-auto"
disabled
aria-label="Submit"
tabIndex={-1}
>
<CornerDownLeftIcon className="size-4" />
</Button>
</div>
</div>
);

return embedded ? banner : <div className="border-t">{banner}</div>;
}
32 changes: 21 additions & 11 deletions apps/web/src/app/(sandbox)/task/[taskId]/HistoricalContent.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ export function HistoricalContent({ session, footer }: HistoricalContentProps) {
<PreviewPaneProvider>
<ClosePreviewOnSleepEffect asleep={isAsleep} />
<div className="flex h-full min-h-0 min-w-0 flex-1">
<FramedSurface surfaceClassName="flex flex-col bg-transparent">
<FramedSurface surfaceClassName="flex flex-col bg-transparent @container">
<PreviewPaneLayout session={session}>
<ArtifactLinkProvider session={session}>
<PreviewCommand
Expand All @@ -94,16 +94,18 @@ export function HistoricalContent({ session, footer }: HistoricalContentProps) {
footer={messagesFooter}
/>
{shouldShowWakeTaskInput && taskRun ? (
<WakeTaskInput
taskRun={taskRun}
initialPrompt={draftPrompt ?? ''}
/>
) : (
isResuming &&
draftPrompt && (
<DraftPromptBanner draftPrompt={draftPrompt} />
)
)}
<HistoricalInputTray>
<WakeTaskInput
taskRun={taskRun}
initialPrompt={draftPrompt ?? ''}
embedded
/>
</HistoricalInputTray>
) : isResuming && draftPrompt ? (
<HistoricalInputTray>
<DraftPromptBanner draftPrompt={draftPrompt} embedded />
</HistoricalInputTray>
) : null}
</div>
</ArtifactLinkProvider>
</PreviewPaneLayout>
Expand All @@ -115,6 +117,14 @@ export function HistoricalContent({ session, footer }: HistoricalContentProps) {
);
}

function HistoricalInputTray({ children }: { children: ReactNode }) {
return (
<div className="mx-auto w-full overflow-clip rounded-t-md bg-card @[56rem]:rounded-t-lg transition-colors border-2 border-background rounded-b-3xl">
{children}
</div>
);
}

function ClosePreviewOnSleepEffect({ asleep }: { asleep: boolean }) {
useClosePreviewOnSleep(asleep);
return null;
Expand Down
24 changes: 10 additions & 14 deletions apps/web/src/app/(sandbox)/task/[taskId]/LiveContent.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -259,20 +259,16 @@ function LiveContentInner({
}
/>
<div className="mx-auto w-full overflow-clip rounded-t-md bg-card @[56rem]:rounded-t-lg transition-colors border-2 border-background rounded-b-3xl">
<div className="max-w-4xl mx-auto">
<PendingUserInputRequestStateProvider
taskId={session.taskId}
>
<TaskInputStack
session={session}
promptInputRef={promptInputRef}
onFileSearchOpen={handleFileSearchOpen}
onCommandSearchOpen={handleCommandSearchOpen}
onBootStatusChange={onBootStatusChange}
scrollToBottom={scrollToBottom}
/>
</PendingUserInputRequestStateProvider>
</div>
<PendingUserInputRequestStateProvider taskId={session.taskId}>
<TaskInputStack
session={session}
promptInputRef={promptInputRef}
onFileSearchOpen={handleFileSearchOpen}
onCommandSearchOpen={handleCommandSearchOpen}
onBootStatusChange={onBootStatusChange}
scrollToBottom={scrollToBottom}
/>
</PendingUserInputRequestStateProvider>
</div>
</div>
</ArtifactLinkProvider>
Expand Down
Loading
Loading