diff --git a/frontend/src/lib/assets/app.css b/frontend/src/lib/assets/app.css
index 4217c95831..beca747907 100644
--- a/frontend/src/lib/assets/app.css
+++ b/frontend/src/lib/assets/app.css
@@ -426,3 +426,28 @@ input[type='time']::-webkit-calendar-picker-indicator {
.svelte-flow__edges {
z-index: -10;
}
+
+/* The composer's glide, defined once: the Home ↔ AI Sessions view transition below and the
+ in-page move on a session's first message (composerGlide.svelte.ts) both read it. */
+:root {
+ --composer-glide-duration: 200ms;
+ --composer-glide-easing: cubic-bezier(0.2, 0, 0, 1);
+}
+
+/* Home ↔ AI Sessions (homeSessionsTransition.svelte.ts). The session heading and composer
+ glide from where they were to where they land; everything else, Home's list included, is
+ the page cross-fading, kept short. The pseudo-elements hang off :root itself, so no space
+ before `::view-transition-*`: with one, the selector looks for a descendant and never
+ matches. */
+:root[data-home-sessions-transition]::view-transition-group(session-heading),
+:root[data-home-sessions-transition]::view-transition-group(session-composer) {
+ animation-duration: var(--composer-glide-duration);
+ animation-timing-function: var(--composer-glide-easing);
+}
+:root[data-home-sessions-transition]::view-transition-old(root),
+:root[data-home-sessions-transition]::view-transition-new(root) {
+ animation-duration: 150ms;
+}
+:root[data-home-sessions-transition='fade'] * {
+ view-transition-name: none !important;
+}
diff --git a/frontend/src/lib/components/copilot/chat/AIChat.svelte b/frontend/src/lib/components/copilot/chat/AIChat.svelte
index 4b42ea7364..e7973c9967 100644
--- a/frontend/src/lib/components/copilot/chat/AIChat.svelte
+++ b/frontend/src/lib/components/copilot/chat/AIChat.svelte
@@ -18,7 +18,9 @@
forceDisabledMessage = '',
wideLayout = false,
emptyHint,
- starterPrompts = undefined,
+ starter = undefined,
+ viewTransitionNames = false,
+ onSent = undefined,
inputPreface,
initialInstructions = undefined,
onDraftChange = undefined
@@ -36,7 +38,9 @@
// in; the narrow global-chat panel leaves it off.
wideLayout?: boolean
emptyHint?: import('svelte').Snippet
- starterPrompts?: import('$lib/onboardingProfile').StarterPrompt[]
+ starter?: import('./starter/starterPrompts.svelte').ChatStarter
+ viewTransitionNames?: boolean
+ onSent?: () => void
inputPreface?: import('svelte').Snippet
// Seed / observe the composer's draft text (forwarded to AIChatDisplay).
initialInstructions?: string
@@ -200,7 +204,9 @@
{hideModeSelector}
{wideLayout}
{emptyHint}
- {starterPrompts}
+ {starter}
+ {viewTransitionNames}
+ {onSent}
{inputPreface}
{initialInstructions}
{onDraftChange}
diff --git a/frontend/src/lib/components/copilot/chat/AIChatDisplay.svelte b/frontend/src/lib/components/copilot/chat/AIChatDisplay.svelte
index 6b6767a5c2..f4ec745ae3 100644
--- a/frontend/src/lib/components/copilot/chat/AIChatDisplay.svelte
+++ b/frontend/src/lib/components/copilot/chat/AIChatDisplay.svelte
@@ -68,9 +68,10 @@
import { sendUserToast } from '$lib/toast'
import Alert from '$lib/components/common/alert/Alert.svelte'
import { copilotInfo } from '$lib/aiStore'
- import type { StarterPrompt } from '$lib/onboardingProfile'
- import BuildWithAIHeading from './starter/BuildWithAIHeading.svelte'
- import { RotatingPlaceholder } from './starter/starterPrompts.svelte'
+ import SessionGreeting from './starter/SessionGreeting.svelte'
+ import StarterPromptChips from './starter/StarterPromptChips.svelte'
+ import { RotatingPlaceholder, type ChatStarter } from './starter/starterPrompts.svelte'
+ import { glideOnLayoutChange } from './composerGlide.svelte'
const MAX_YOLO_TOOLTIP_TOOLS = 8
const chatHost = getChatViewHost()
@@ -109,7 +110,9 @@
hideModeSelector = false,
wideLayout = false,
emptyHint,
- starterPrompts = undefined,
+ starter = undefined,
+ viewTransitionNames = false,
+ onSent = undefined,
inputPreface,
footerSettings,
initialInstructions = undefined,
@@ -142,10 +145,17 @@
// off there.
wideLayout?: boolean
emptyHint?: Snippet
- /** Open an empty chat the way Home's composer looks: the "Build with AI" heading, a
- * taller box cycling through these prompts as its placeholder. Sessions
- * set it so the two read as the same entry point. Replaces `emptyHint`. */
- starterPrompts?: StarterPrompt[]
+ /** Open an empty chat as the block that starts a session: Home and an empty session
+ * both mount it, so the two are one entry point rather than look-alikes. Replaces
+ * `emptyHint`. */
+ starter?: ChatStarter
+ /** Names the block for the view transition between Home and AI Sessions. Only one
+ * chat on the page may carry the names: a duplicate makes the browser skip the
+ * transition. Named only while the chat is empty: the glide carries Home's draft to
+ * the same draft's page and back, and a session already under way just cross-fades. */
+ viewTransitionNames?: boolean
+ /** After the composer hands a new turn to the host. */
+ onSent?: () => void
inputPreface?: Snippet
/** The settings control at the footer's right edge, where the copilot puts its
* model picker. A host that configures its turn elsewhere replaces it here. */
@@ -293,13 +303,10 @@
}
$effect(() => {
- if (aiChatInput) {
- chatHost.setAiChatInput(aiChatInput)
- }
-
- return () => {
- chatHost.setAiChatInput(null)
- }
+ const input = aiChatInput
+ if (!input) return
+ chatHost.setAiChatInput(input)
+ return () => chatHost.releaseAiChatInput(input)
})
// Also shown for a run held by another tab, labeled with where it is: the
@@ -560,11 +567,21 @@
// A step name hangs its icon in the column's left padding (see AssistantMessage), so a
// transcript carrying one widens the padding, on both sides to keep the column centred.
const agentGutter = $derived(messages.some((m) => m.role === 'assistant' && m.stepName))
- const starterHero = $derived(!!starterPrompts && messages.length === 0 && !disabled)
+ // The block's layout holds while the chat is empty, usable or not; only the rotating
+ // placeholder, the taller box and the prompts need a composer that can send.
+ const starterLayout = $derived(!!starter && messages.length === 0)
+ const starterHero = $derived(starterLayout && !disabled)
+ // Home is a page, not a pane: nothing there to centre in.
+ const centreComposer = $derived(starterLayout && starter?.where === 'session')
const starterPlaceholder = new RotatingPlaceholder(
- () => (starterPrompts ?? []).map((p) => p.prompt),
+ () => (starter?.prompts ?? []).map((p) => p.prompt),
() => starterHero
)
+ let composerEl: HTMLDivElement | undefined = $state()
+ glideOnLayoutChange(
+ () => composerEl,
+ () => starterLayout
+ )
const columnClass = $derived(
wideLayout
@@ -673,9 +690,7 @@
@@ -1303,4 +1361,7 @@ the panel, or the Escape-to-stop focus check would wrongly reject them. -->
{/if}
+ {#if centreComposer}
+
+ {/if}
diff --git a/frontend/src/lib/components/copilot/chat/AIChatInput.svelte b/frontend/src/lib/components/copilot/chat/AIChatInput.svelte
index e341c8de55..cf5111698c 100644
--- a/frontend/src/lib/components/copilot/chat/AIChatInput.svelte
+++ b/frontend/src/lib/components/copilot/chat/AIChatInput.svelte
@@ -14,6 +14,11 @@
import { CHAT_INPUT_PADDING, getAiChatManager } from './aiChatManagerContext'
import { getChatViewHost } from './chatViewHost'
import { composerBoxClass, COMPOSER_FIELD_RESET } from './composerBox'
+
+ // The send button sits in the toolbar row, not over the field, so the text needs no
+ // room reserved on its right, and the row right below it stands in for most of its
+ // bottom padding.
+ const FIELD_PADDING_WITH_TOOLBAR = '!pr-3 !pb-1'
import { formatMention, hasMention, removeMentionFromText } from './mention'
import { twMerge } from 'tailwind-merge'
import { tick, untrack, type Snippet } from 'svelte'
@@ -93,9 +98,16 @@
// plain-text draft sent from here answers it instead of queueing behind a
// turn that only the answer can resume.
pendingQuestionToolCallId?: string
- /** Forwarded to ContextTextarea: the composer that opens a session. */
+ /** The composer that opens a session (Home, an empty session): `toolbar` is drawn in the
+ * box's bottom row with the send button at its end, and a usable box is taller. Otherwise
+ * the controls sit under the box and the send button floats over the field's corner, as a
+ * chat under way reads more clearly. */
hero?: boolean
fadingPlaceholder?: { text: string; visible: boolean }
+ /** After a new turn is handed to the host — not an edit, a queued message or an answer. */
+ onSent?: () => void
+ /** The composer's controls. */
+ toolbar?: Snippet
}
let {
@@ -120,10 +132,14 @@
onCancel,
onDraftChange = undefined,
pendingQuestionToolCallId = undefined,
+ onSent = undefined,
+ toolbar = undefined,
hero = false,
fadingPlaceholder = undefined
}: Props = $props()
+ const toolbarInBox = $derived(!!toolbar && hero)
+
// GLOBAL-mode suggestion pool. We pick one at mount-time so each new
// session lands on a different prompt; the choice stays stable for
// the lifetime of this input so the placeholder doesn't shuffle as
@@ -641,6 +657,13 @@
draft.text = removeMentionFromText(draft.text, title)
}
+ /** Replace the draft's text, keeping its attachments: a starter prompt fills the box, it
+ * never sends. */
+ export function setText(text: string) {
+ draft.text = text
+ focusInput()
+ }
+
export function focusInput() {
if (isContextEnabledMode) {
contextTextareaComponent?.focus()
@@ -982,6 +1005,7 @@
// textarea still rely on the draft reset alone (no `@`-mention state to
// coordinate).
contextTextareaComponent?.clearForSend()
+ onSent?.()
}
}
@@ -1212,7 +1236,18 @@
}
-{#snippet sendStopButton()}
+{#snippet toolbarRow()}
+ {#if toolbarInBox}
+
+
{@render bottomRightSnippet()}
diff --git a/frontend/src/lib/components/copilot/chat/AIChatManager.svelte.ts b/frontend/src/lib/components/copilot/chat/AIChatManager.svelte.ts
index 77c67eb5d5..05734d9ebc 100644
--- a/frontend/src/lib/components/copilot/chat/AIChatManager.svelte.ts
+++ b/frontend/src/lib/components/copilot/chat/AIChatManager.svelte.ts
@@ -332,7 +332,7 @@ function isWorkspacePath(path: string | undefined): path is string {
// Returns the safe ACCEPT_EDIT default when no user is known yet — the
// module-level singleton (constructed at import, before the email resolves)
// re-reads via onUserChange once it does.
-export function getPersistedAutonomyMode(): AIAutonomyMode {
+function getPersistedAutonomyMode(): AIAutonomyMode {
const key = scopedKey(AI_AUTONOMY_MODE_STORAGE_KEY)
if (!BROWSER || !key) {
return AIAutonomyMode.ACCEPT_EDIT
@@ -2260,6 +2260,10 @@ export class AIChatManager implements ChatViewHost {
this.aiChatInput = aiChatInput
}
+ releaseAiChatInput(aiChatInput: AIChatInput) {
+ if (this.aiChatInput === aiChatInput) this.aiChatInput = null
+ }
+
/** Queue the message typed while a turn is streaming. There is only ever
* one queued message; pressing Enter again appends the new text as another
* line so it all goes out as a single message, and its images accumulate
diff --git a/frontend/src/lib/components/copilot/chat/AutonomyModePicker.svelte b/frontend/src/lib/components/copilot/chat/AutonomyModePicker.svelte
index 4e9b03c1ae..f63db32d0e 100644
--- a/frontend/src/lib/components/copilot/chat/AutonomyModePicker.svelte
+++ b/frontend/src/lib/components/copilot/chat/AutonomyModePicker.svelte
@@ -39,7 +39,7 @@
void
/** Rendered inside the input box, above the textarea (e.g. context chips). */
leading?: Snippet
+ /** Rendered inside the input box, below the textarea (the composer's controls). */
+ trailing?: Snippet
/** The taller box that opens a session, matching Home's composer. */
hero?: boolean
/** Replaces `placeholder` with one drawn over the field, so it can fade between prompts. */
@@ -72,6 +74,7 @@
className = '',
onKeyDown = undefined,
leading,
+ trailing,
hero = false,
fadingPlaceholder
}: Props = $props()
@@ -828,7 +831,7 @@
bind:this={textarea}
onkeydown={handleKeyDown}
bind:value
- use:autosize={{ maxHeight: '40vh', minHeight: hero ? 96 : undefined }}
+ use:autosize={{ maxHeight: '40vh', minHeight: hero ? 56 : undefined }}
rows={1}
oninput={handleInput}
onpaste={handlePaste}
@@ -853,7 +856,7 @@
}, 200)
}}
placeholder={fadingPlaceholder ? '' : placeholder}
- aria-label={fadingPlaceholder ? 'Describe what you want to build' : undefined}
+ aria-label={fadingPlaceholder ? 'Describe what you want to do' : undefined}
class={twMerge(
'textarea-input resize-none caret-black dark:caret-white overflow-clip',
COMPOSER_FIELD_RESET,
@@ -864,6 +867,7 @@
{disabled}
>
+ {@render trailing?.()}
{#if showContextTooltip || showCommandTooltip}
diff --git a/frontend/src/lib/components/copilot/chat/chatViewHost.ts b/frontend/src/lib/components/copilot/chat/chatViewHost.ts
index bdacb57615..a307946cf2 100644
--- a/frontend/src/lib/components/copilot/chat/chatViewHost.ts
+++ b/frontend/src/lib/components/copilot/chat/chatViewHost.ts
@@ -73,6 +73,10 @@ export interface ChatViewHost {
sendRequest: (options?: ChatSendRequestOptions) => Promise
cancel: (reason?: string) => void
setAiChatInput: (aiChatInput: AIChatInput | null) => void
+ /** Unregisters `aiChatInput` if it is still the registered one. A host's chat can remount
+ * elsewhere (Home hands its session to /sessions), and the new composer may register before
+ * the old one's teardown runs. */
+ releaseAiChatInput: (aiChatInput: AIChatInput) => void
readonly queuedMessage: string
queuedContext: ContextElement[] | undefined
readonly queuedImages: AttachedImage[]
diff --git a/frontend/src/lib/components/copilot/chat/composerGlide.svelte.ts b/frontend/src/lib/components/copilot/chat/composerGlide.svelte.ts
new file mode 100644
index 0000000000..2fe1f4b8bc
--- /dev/null
+++ b/frontend/src/lib/components/copilot/chat/composerGlide.svelte.ts
@@ -0,0 +1,46 @@
+import { untrack } from 'svelte'
+import { useReducedMotion } from '$lib/svelte5Utils.svelte'
+
+/** The glide's timing, read from the tokens app.css defines once for this move and for
+ * the Home ↔ AI Sessions view transition, so the two read as the same motion. */
+function glideTiming(): { duration: number; easing: string } {
+ const style = getComputedStyle(document.documentElement)
+ const duration = parseFloat(style.getPropertyValue('--composer-glide-duration'))
+ const easing = style.getPropertyValue('--composer-glide-easing').trim()
+ return { duration: Number.isFinite(duration) ? duration : 200, easing: easing || 'ease-out' }
+}
+
+/**
+ * Slides `el` from where it sat to where it lands whenever `layout()` changes (an empty
+ * session's composer dropping to the bottom on its first message). Measured before the DOM
+ * updates, again after, and the difference animated away; an element that did not move does
+ * not animate. Under reduced motion it fades in where it landed.
+ */
+export function glideOnLayoutChange(el: () => HTMLElement | undefined, layout: () => unknown) {
+ const reducedMotion = useReducedMotion()
+ let from: DOMRect | undefined
+ $effect.pre(() => {
+ layout()
+ from = untrack(el)?.getBoundingClientRect()
+ })
+ $effect(() => {
+ layout()
+ const node = untrack(el)
+ const start = from
+ from = undefined
+ if (!node || !start) return
+ const { duration, easing } = glideTiming()
+ if (reducedMotion.val) {
+ node.animate([{ opacity: 0 }, { opacity: 1 }], { duration })
+ return
+ }
+ const end = node.getBoundingClientRect()
+ const dx = start.left - end.left
+ const dy = start.top - end.top
+ if (Math.abs(dx) < 1 && Math.abs(dy) < 1) return
+ node.animate([{ transform: `translate(${dx}px, ${dy}px)` }, { transform: 'none' }], {
+ duration,
+ easing
+ })
+ })
+}
diff --git a/frontend/src/lib/components/copilot/chat/starter/BuildWithAIHeading.svelte b/frontend/src/lib/components/copilot/chat/starter/BuildWithAIHeading.svelte
deleted file mode 100644
index 51432a0fc6..0000000000
--- a/frontend/src/lib/components/copilot/chat/starter/BuildWithAIHeading.svelte
+++ /dev/null
@@ -1,10 +0,0 @@
-
-
-
-
diff --git a/frontend/src/lib/components/copilot/chat/starter/greeting.test.ts b/frontend/src/lib/components/copilot/chat/starter/greeting.test.ts
new file mode 100644
index 0000000000..835896cfb8
--- /dev/null
+++ b/frontend/src/lib/components/copilot/chat/starter/greeting.test.ts
@@ -0,0 +1,41 @@
+import { beforeEach, describe, expect, it, vi } from 'vitest'
+
+const scoped = vi.hoisted(() => ({ key: 'welcomed::ada@example.com' as string | undefined }))
+vi.mock('$lib/userScopedStorage', () => ({ scopedKey: () => scoped.key }))
+
+import { takeFirstVisit } from './greeting'
+
+const DAY = 24 * 60 * 60 * 1000
+const daysAgo = (n: number) => new Date(Date.now() - n * DAY).toISOString()
+
+const store = new Map()
+vi.stubGlobal('localStorage', {
+ getItem: (k: string) => store.get(k) ?? null,
+ setItem: (k: string, v: string) => void store.set(k, v)
+})
+
+beforeEach(() => {
+ store.clear()
+ scoped.key = 'welcomed::ada@example.com'
+})
+
+describe('takeFirstVisit', () => {
+ it('welcomes a new member once per workspace, for the whole page load', () => {
+ expect(takeFirstVisit('acme', daysAgo(2))).toBe(true)
+ // Back on Home or the empty session in the same load: still the welcome.
+ expect(takeFirstVisit('acme', daysAgo(2))).toBe(true)
+ expect(JSON.parse(store.get('welcomed::ada@example.com')!)).toEqual(['acme'])
+ })
+
+ it('greets by time of day for an older member, or a workspace already welcomed', () => {
+ expect(takeFirstVisit('old-team', daysAgo(45))).toBe(false)
+ store.set('welcomed::ada@example.com', JSON.stringify(['seen-before']))
+ expect(takeFirstVisit('seen-before', daysAgo(1))).toBe(false)
+ })
+
+ it('records nothing before the user is known', () => {
+ scoped.key = undefined
+ expect(takeFirstVisit('fresh', daysAgo(1))).toBe(false)
+ expect(store.size).toBe(0)
+ })
+})
diff --git a/frontend/src/lib/components/copilot/chat/starter/greeting.ts b/frontend/src/lib/components/copilot/chat/starter/greeting.ts
new file mode 100644
index 0000000000..8e63dc3d5a
--- /dev/null
+++ b/frontend/src/lib/components/copilot/chat/starter/greeting.ts
@@ -0,0 +1,37 @@
+import { scopedKey } from '$lib/userScopedStorage'
+
+const WELCOMED_KEY = 'session-block-welcomed-workspaces'
+/** A membership older than this is not a first visit, whatever this browser remembers: without
+ * it, everyone already in a workspace would be welcomed to it once on their next visit. */
+const NEW_MEMBER_MS = 30 * 24 * 60 * 60 * 1000
+
+// Workspaces welcomed during this page load: the welcome holds for the whole visit (Home, the
+// empty session, back), and only a later load greets by time of day.
+const welcomedThisLoad = new Set()
+
+/** Whether this is the user's first visit to `workspace`: a recent member this browser has not
+ * welcomed there yet. Answering yes records the welcome. */
+export function takeFirstVisit(workspace: string, memberSince: string | undefined): boolean {
+ if (welcomedThisLoad.has(workspace)) return true
+ const key = scopedKey(WELCOMED_KEY)
+ if (!key) return false
+ let welcomed: string[] = []
+ try {
+ welcomed = JSON.parse(localStorage.getItem(key) ?? '[]')
+ } catch {}
+ if (welcomed.includes(workspace)) return false
+ const joined = memberSince ? Date.parse(memberSince) : NaN
+ if (!(Date.now() - joined < NEW_MEMBER_MS)) return false
+ welcomedThisLoad.add(workspace)
+ try {
+ localStorage.setItem(key, JSON.stringify([...welcomed, workspace]))
+ } catch {}
+ return true
+}
+
+export function timeOfDayGreeting(now = new Date()): string {
+ const hour = now.getHours()
+ if (hour >= 5 && hour < 12) return 'Good morning'
+ if (hour >= 12 && hour < 18) return 'Good afternoon'
+ return 'Good evening'
+}
diff --git a/frontend/src/lib/components/copilot/chat/starter/starterPrompts.svelte.ts b/frontend/src/lib/components/copilot/chat/starter/starterPrompts.svelte.ts
index a8c767b9a2..d7f96eced0 100644
--- a/frontend/src/lib/components/copilot/chat/starter/starterPrompts.svelte.ts
+++ b/frontend/src/lib/components/copilot/chat/starter/starterPrompts.svelte.ts
@@ -2,6 +2,8 @@ import { onboardingProfile, type StarterPrompt } from '$lib/onboardingProfile'
import { useReducedMotion } from '$lib/svelte5Utils.svelte'
import { userStore } from '$lib/stores'
import { fromStore } from 'svelte/store'
+import { resource } from 'runed'
+import { ScriptService } from '$lib/gen'
/** Example prompts: the short `label` is shown as a clickable tag under the composer,
* the `prompt` is what rotates through the placeholder / gets dropped into the input. */
@@ -48,12 +50,57 @@ export class StarterPrompts {
readonly list = $derived(
this.#invite ?? (this.#user.current?.operator ? operatorStarterPrompts : defaultStarterPrompts)
)
+ #hasItems: { readonly current: boolean | undefined }
- constructor() {
+ /** `workspace`: where the session acts, which decides whether the chips are offered. */
+ constructor(workspace: () => string | undefined) {
void onboardingProfile().then((p) => {
if (p?.starter_prompts?.length) this.#invite = p.starter_prompts
})
+ this.#hasItems = resource(workspace, async (ws) => (ws ? workspaceHasItems(ws) : undefined))
}
+
+ /** The example chips are for a workspace with nothing in it yet: next to someone's own
+ * scripts and flows, "Ban Discord users" is noise. Withheld until the workspace is known
+ * to be empty, so they never show and then vanish. The examples still rotate through the
+ * placeholder either way. */
+ get chipsOffered(): boolean {
+ return this.#hasItems.current === false
+ }
+}
+
+// Workspaces known to hold something, for the page load. An empty answer is not kept: the
+// next mount asks again, so the chips go once the user has created their first item.
+const workspacesWithItems = new Set()
+
+async function workspaceHasItems(workspace: string): Promise {
+ if (workspacesWithItems.has(workspace)) return true
+ try {
+ // What Home's list counts: library scripts and the user's own drafts included.
+ const res = await ScriptService.listRunnables({
+ workspace,
+ includeWithoutMain: true,
+ includeDraftOnly: true,
+ perPage: 1
+ })
+ const has = (res.items?.length ?? 0) > 0
+ if (has) workspacesWithItems.add(workspace)
+ return has
+ } catch (e) {
+ // Unknown reads as "has items": no chips is the quieter mistake.
+ console.error(`Could not check whether workspace ${workspace} has items:`, e)
+ return true
+ }
+}
+
+/** What turns an empty chat into the block that starts a session. */
+export type ChatStarter = {
+ /** The page the block is on: an empty session centres it in the pane, Home does not. */
+ where: 'home' | 'session'
+ /** Rotated through the placeholder. */
+ prompts: StarterPrompt[]
+ /** Also offered as chips under the box. */
+ chips: boolean
}
const CYCLE_MS = 7_000
diff --git a/frontend/src/lib/components/flows/conversations/flowChatViewHost.svelte.ts b/frontend/src/lib/components/flows/conversations/flowChatViewHost.svelte.ts
index d8dee9dcaa..1eda6fcb54 100644
--- a/frontend/src/lib/components/flows/conversations/flowChatViewHost.svelte.ts
+++ b/frontend/src/lib/components/flows/conversations/flowChatViewHost.svelte.ts
@@ -578,6 +578,9 @@ export class FlowChatViewHost implements ChatViewHost, DraftSender {
+ if (this.#aiChatInput === aiChatInput) this.#aiChatInput = null
+ }
/** Whether a composer showing this conversation holds something not sent — text, an
* attachment, a file still being read. Its panel stays mounted for as long as one does:
diff --git a/frontend/src/lib/components/home/HomeAIChat.svelte b/frontend/src/lib/components/home/HomeAIChat.svelte
index 49c833fd97..2c857843d6 100644
--- a/frontend/src/lib/components/home/HomeAIChat.svelte
+++ b/frontend/src/lib/components/home/HomeAIChat.svelte
@@ -1,56 +1,25 @@
- {#if $aiUserDisabled}
- Windmill AI is disabled in your account settings
- {:else if freeTierExhausted}
- You have used all of your free Windmill AI tokens
- {:else}
- No AI provider is configured
- {/if}
-
-
- {#if $aiUserDisabled}
-
-
- Open account settings
-
- {:else}
-
- {freeTierExhausted ? 'Add your own API key' : 'Configure AI'}
-
- {/if}
- Remove
-
diff --git a/frontend/src/lib/components/sessions/SessionWrapper.svelte b/frontend/src/lib/components/sessions/SessionWrapper.svelte
index ed8d6a1571..532a888733 100644
--- a/frontend/src/lib/components/sessions/SessionWrapper.svelte
+++ b/frontend/src/lib/components/sessions/SessionWrapper.svelte
@@ -73,7 +73,14 @@
// Reactive session reference (mutations to summary/target propagate via the $state proxy)
const session = $derived(sessionState.sessions.find((s) => s.id === sessionId))
- const starterPrompts = new StarterPrompts()
+ // Only a session that has never sent opens as the starter block. Read off the record, not
+ // the transcript: a cold session's history is still loading from storage when it mounts,
+ // and an empty transcript would show the greeting and then glide the composer away.
+ // The first send commits the workspace, so this flips only after the transcript has.
+ const opensSession = $derived(!session?.workspace_id)
+ const starterPrompts = new StarterPrompts(() =>
+ opensSession ? (actingWorkspaceId ?? $workspaceStore ?? undefined) : undefined
+ )
// Seed the composer with the unsent prompt a reload preserved on the session
// record (script-init: AIChatInput reads it once at mount).
@@ -309,6 +316,10 @@
{#if !session || !runtime}