diff --git a/frontend/src/lib/components/GroupsPageLink.svelte b/frontend/src/lib/components/GroupsPageLink.svelte
new file mode 100644
index 0000000000..e7d338741b
--- /dev/null
+++ b/frontend/src/lib/components/GroupsPageLink.svelte
@@ -0,0 +1,13 @@
+
+
+
diff --git a/frontend/src/lib/components/NavBreadcrumb.svelte b/frontend/src/lib/components/NavBreadcrumb.svelte
index 2169149426..7c9ecab07c 100644
--- a/frontend/src/lib/components/NavBreadcrumb.svelte
+++ b/frontend/src/lib/components/NavBreadcrumb.svelte
@@ -284,35 +284,39 @@ not this component) — so the lead can run the whole line.
{/if}
{/snippet}
diff --git a/frontend/src/lib/components/copilot/chat/AIChat.svelte b/frontend/src/lib/components/copilot/chat/AIChat.svelte
index 9f284e5f98..6921f36676 100644
--- a/frontend/src/lib/components/copilot/chat/AIChat.svelte
+++ b/frontend/src/lib/components/copilot/chat/AIChat.svelte
@@ -22,7 +22,6 @@
starter = undefined,
onSent = undefined,
inputPreface,
- actingOn,
workModeLock = undefined,
initialInstructions = undefined,
onDraftChange = undefined,
@@ -46,8 +45,6 @@
starter?: import('./starter/starterPrompts.svelte').ChatStarter
onSent?: () => void
inputPreface?: import('svelte').Snippet
- /** Forwarded to AIChatDisplay: where the session acts, first among the controls. */
- actingOn?: import('svelte').Snippet
workModeLock?: import('./workMode').WorkModeLock
// Seed / observe the composer's draft (forwarded to AIChatDisplay).
initialInstructions?: string
@@ -90,7 +87,7 @@
: $aiUserDisabled
? 'Windmill AI is disabled in your account settings'
: isAdmin
- ? 'Enable Windmill AI in your [workspace settings](/workspace_settings?tab=ai) to use this chat'
+ ? 'Enable Windmill AI in your [workspace settings](/workspace_settings?tab=ai) to use this chat, or hide AI sessions there'
: 'Ask an admin to enable Windmill AI in this workspace to use this chat'
: aiChatManager.mode === AIMode.SCRIPT &&
aiChatManager.scriptEditorOptions?.lang &&
@@ -127,6 +124,10 @@
aiChatDisplay?.focusInput(selection)
}
+ export function flashComposer() {
+ aiChatDisplay?.flashComposer()
+ }
+
export async function attachContext(element: import('./context').ContextElement) {
await aiChatDisplay?.attachContext(element)
}
@@ -222,7 +223,6 @@
{starter}
{onSent}
{inputPreface}
- {actingOn}
{workModeLock}
{initialInstructions}
{onDraftChange}
diff --git a/frontend/src/lib/components/copilot/chat/AIChatDisplay.svelte b/frontend/src/lib/components/copilot/chat/AIChatDisplay.svelte
index 63a9989d9c..644364cb71 100644
--- a/frontend/src/lib/components/copilot/chat/AIChatDisplay.svelte
+++ b/frontend/src/lib/components/copilot/chat/AIChatDisplay.svelte
@@ -73,11 +73,10 @@
import { sendUserToast } from '$lib/toast'
import Alert from '$lib/components/common/alert/Alert.svelte'
import { copilotInfo } from '$lib/aiStore'
- import SessionGreeting from './starter/SessionGreeting.svelte'
import ComposerSuggestions from './starter/ComposerSuggestions.svelte'
import type { DraftAttachments } from './messageDraft.svelte'
import type { ChatStarter } from './starter/starterPrompts.svelte'
- import { isComposerOverlay } from './starter/composerCollapse'
+ import { asksForComposer, isComposerOverlay } from './starter/composerCollapse'
import { smoothHeight } from './starter/smoothHeight'
const MAX_YOLO_TOOLTIP_TOOLS = 8
@@ -120,7 +119,6 @@
starter = undefined,
onSent = undefined,
inputPreface,
- actingOn,
workModeLock = undefined,
footerSettings,
initialInstructions = undefined,
@@ -155,15 +153,12 @@
// off there.
wideLayout?: boolean
emptyHint?: Snippet
- /** 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`. */
+ /** Open an empty chat as the block that starts a session: Home's composer, collapsed
+ * to one line at rest. Replaces `emptyHint`. */
starter?: ChatStarter
/** After the composer hands a new turn to the host. */
onSent?: () => void
inputPreface?: Snippet
- /** Where the session acts: first among the controls after the attach button. */
- actingOn?: Snippet
/** Holds a session chat in Use, and says why in the picker. */
workModeLock?: WorkModeLock
/** The settings control at the footer's right edge, where the copilot puts its
@@ -592,8 +587,6 @@
const heldInUse = $derived(
chatHost.workModesAvailable && (!!workModeLock || chatHost.workMode === AIWorkMode.USE)
)
- // Home is a page, not a pane: nothing there to centre in.
- const centreComposer = $derived(starterLayout && starter?.where === 'session')
// Home's composer at rest is one line. Focusing the field opens it; a press outside it or
// Escape puts it back, but only with nothing in the draft: leaving it open then means
@@ -602,10 +595,8 @@
// menu it is opening.
let composerEl: HTMLDivElement | undefined = $state()
let composerOpened = $state(false)
- const homeComposer = $derived(starterLayout && starter?.where === 'home')
// Anything the user has started (text, an attachment) or is in the middle of (they opened it
- // and have not left) keeps it open, and so does a workspace small enough that the composer is
- // the page's main way in.
+ // and have not left) keeps it open, and so does a host that has it rest open.
// Until the input is bound, the draft it starts with is the one it is seeded with: reading
// it as empty collapses a remounted composer that holds text for a frame, and the box then
// animates open as if the user had opened it.
@@ -617,9 +608,9 @@
!initialAttachments?.blobs.length
)
const composerCollapsed = $derived(
- homeComposer &&
+ starterLayout &&
!disabled &&
- !(starter?.where === 'home' && starter.fewItems) &&
+ !starter?.restsOpen &&
!composerOpened &&
(aiChatInput ? aiChatInput.isDraftEmpty() : seededDraftEmpty)
)
@@ -627,13 +618,24 @@
if (aiChatInput?.isDraftEmpty() ?? true) composerOpened = false
}
function onComposerPointerDown(e: PointerEvent) {
- if (!homeComposer || !composerOpened || composerEl?.contains(e.target as Node)) return
- if (!isComposerOverlay(e.target)) closeComposer()
+ if (!starterLayout || !composerOpened || composerEl?.contains(e.target as Node)) return
+ if (!isComposerOverlay(e.target) && !asksForComposer(e.target)) closeComposer()
+ }
+
+ // While the box plays its accent outline (app.css, `data-composer-flash`).
+ let flashing = $state(false)
+
+ /** Points the eye at a composer the user was sent to without it moving: its box's outline
+ * lights up in the accent color and fades. */
+ export function flashComposer() {
+ // Off for a frame first, so a flash asked for while one plays starts over.
+ flashing = false
+ requestAnimationFrame(() => (flashing = true))
}
// Home's composer is one block of the page and takes the page's column as it is.
const columnClass = $derived(
- starter?.where === 'home'
+ starter
? 'w-full'
: wideLayout
? `w-full max-w-3xl mx-auto ${agentGutter ? 'px-8' : 'px-7'}`
@@ -693,7 +695,6 @@
const showFooterLeftControls = $derived(
!footerMessageShown &&
(canAttachFiles ||
- !!actingOn ||
attachmentsOffReason !== undefined ||
showContextPicker ||
showAutonomyModeSelector ||
@@ -744,7 +745,7 @@
{/if}
{#if messages.length === 0}
{#if starter}
-
- {#if centreComposer}
-
- {/if}
+
{:else if emptyHint}
{@render emptyHint()}
{:else}
@@ -988,19 +980,26 @@ the panel, or the Escape-to-stop focus check would wrongly reject them. -->
+
{
+ if (e.animationName === 'wm-composer-flash') flashing = false
+ }}
onfocusin={(e) => {
- if (homeComposer && e.target instanceof HTMLTextAreaElement) composerOpened = true
+ if (starterLayout && e.target instanceof HTMLTextAreaElement) composerOpened = true
}}
onkeydown={(e) => {
// A prevented Escape closed something inside first, such as the @-mention picker.
if (e.key !== 'Escape' || e.defaultPrevented) return
- if (!homeComposer || !composerOpened) return
+ if (!starterLayout || !composerOpened) return
closeComposer()
if (aiChatInput?.isDraftEmpty() ?? true) (document.activeElement as HTMLElement)?.blur()
}}
@@ -1072,7 +1071,7 @@ the panel, or the Escape-to-stop focus check would wrongly reject them. -->
isFirstMessage={messages.length === 0}
hero={starterLayout}
collapsed={composerCollapsed}
- chatIcon={homeComposer}
+ chatIcon={starterLayout}
{onSent}
>
{#snippet collapsedControls()}
@@ -1272,7 +1271,6 @@ the panel, or the Escape-to-stop focus check would wrongly reject them. -->
onchange={onFolderInputChange}
/>
{/if}
- {@render actingOn?.()}
{#if showAutonomyModeSelector}
{/if}
{#if footerMessageShown}
-
-
- {@render actingOn?.()}
-
-
-
+
+
{:else}
@@ -1412,7 +1405,6 @@ the panel, or the Escape-to-stop focus check would wrongly reject them. -->
aiChatInput?.setText(prompt)}
/>
@@ -1436,12 +1428,4 @@ the panel, or the Escape-to-stop focus check would wrongly reject them. -->
{/if}
-
-
diff --git a/frontend/src/lib/components/copilot/chat/ContextTextarea.svelte b/frontend/src/lib/components/copilot/chat/ContextTextarea.svelte
index 8895ad1ed0..3b60c864db 100644
--- a/frontend/src/lib/components/copilot/chat/ContextTextarea.svelte
+++ b/frontend/src/lib/components/copilot/chat/ContextTextarea.svelte
@@ -813,6 +813,7 @@
@@ -857,7 +858,7 @@
bind:this={textarea}
onkeydown={handleKeyDown}
bind:value
- use:autosize={hero && !oneLine ? { maxHeight: 160, minHeight: 56 } : { maxHeight: '40vh' }}
+ use:autosize={hero && !oneLine ? { maxHeight: 160, minHeight: 80 } : { maxHeight: '40vh' }}
rows={1}
oninput={handleInput}
onpaste={handlePaste}
diff --git a/frontend/src/lib/components/copilot/chat/composerBox.ts b/frontend/src/lib/components/copilot/chat/composerBox.ts
index 3326e58274..f20d7dda91 100644
--- a/frontend/src/lib/components/copilot/chat/composerBox.ts
+++ b/frontend/src/lib/components/copilot/chat/composerBox.ts
@@ -23,8 +23,11 @@ export function composerBoxClass(disabled: boolean = false): string {
}
/** Added to a usable box that opens a session (Home, an empty session). Focus shows as the
- * base box's border colour alone: the brand has no focus ring. */
-export const HERO_BOX_CLASS = 'rounded-[10px]'
+ * base box's border colour alone: the brand has no focus ring. On Home, an open composer
+ * floats over the lists scrolling under it, so it takes the brand's elevation for moving
+ * elements. */
+export const HERO_BOX_CLASS =
+ 'rounded-[10px] transition-[border-color,box-shadow] group-has-[[data-composer-open]]/home:shadow-md'
/** Applied to the field inside the box; without it the field draws a second border. */
export const COMPOSER_FIELD_RESET =
diff --git a/frontend/src/lib/components/copilot/chat/starter/ComposerSuggestions.svelte b/frontend/src/lib/components/copilot/chat/starter/ComposerSuggestions.svelte
index 6d7dc379a4..72cdec05f2 100644
--- a/frontend/src/lib/components/copilot/chat/starter/ComposerSuggestions.svelte
+++ b/frontend/src/lib/components/copilot/chat/starter/ComposerSuggestions.svelte
@@ -5,22 +5,17 @@
let {
suggestions,
- onPick,
- wrap = false
+ onPick
}: {
suggestions: ComposerSuggestion[]
onPick: (prompt: string) => void
- /** Wrap onto more lines instead of one row that scrolls sideways. */
- wrap?: boolean
} = $props()
-
+
diff --git a/frontend/src/lib/components/flows/conversations/FlowChat.svelte b/frontend/src/lib/components/flows/conversations/FlowChat.svelte
index fe7b86628d..fc8a472ec7 100644
--- a/frontend/src/lib/components/flows/conversations/FlowChat.svelte
+++ b/frontend/src/lib/components/flows/conversations/FlowChat.svelte
@@ -12,6 +12,7 @@
import FlowConversationsSidebar from './FlowConversationsSidebar.svelte'
import FlowChatInterface from './FlowChatInterface.svelte'
import { getContext, untrack } from 'svelte'
+ import { afterNavigate } from '$app/navigation'
import type { FlowEditorContext } from '../types'
import { ApiError, type FlowModule } from '$lib/gen'
import { FlowChatPool, type FlowChatPoolState } from './flowChatPool'
@@ -63,6 +64,8 @@
subject?: 'flow' | 'agent'
/** The host's own controls, after the model's in the composer's footer. */
composerSettings?: import('svelte').Snippet
+ /** A conversation to show once the chat is up, as a link to it names one. */
+ openConversation?: string
/** Pinned at the foot of the conversations sidebar. */
sidebarFooter?: import('svelte').Snippet<[{ expanded: boolean }]>
}
@@ -81,6 +84,7 @@
conversationKind = 'deployed',
subject = 'flow',
composerSettings = undefined,
+ openConversation = undefined,
sidebarFooter = undefined
}: Props = $props()
@@ -167,6 +171,10 @@
}
})
const unsubscribePool = createdPool.subscribe((s) => (poolState = s))
+ // Untracked: a later change of the prop must not rebuild every chat of the flow; the
+ // navigation below follows it instead.
+ const linked = untrack(() => openConversation)
+ if (linked) createdPool.select(linked)
listChat = createdList
pool = createdPool
return () => {
@@ -177,6 +185,16 @@
}
})
+ // A link to another chat of this flow changes only the query, so the page is not remounted
+ // and the pool stays: it is shown here. Compared with what the panel shows, not with the
+ // link last followed: picking a chat in the panel's own sidebar leaves the query as it was,
+ // and the reader can still link back to it.
+ afterNavigate(() => {
+ const linked = openConversation
+ if (!linked || !pool || linked === poolState?.selectedId) return
+ pool.select(linked)
+ })
+
// The panel on screen. Every other panel the pool holds stays mounted behind it.
const shownKey = $derived(poolState?.shownKey)
diff --git a/frontend/src/lib/components/flows/conversations/agentEditorChat.ts b/frontend/src/lib/components/flows/conversations/agentEditorChat.ts
index e4484c9855..899784fa82 100644
--- a/frontend/src/lib/components/flows/conversations/agentEditorChat.ts
+++ b/frontend/src/lib/components/flows/conversations/agentEditorChat.ts
@@ -13,6 +13,11 @@ export function agentChatPath(agentPath: string): string {
return `${agentPath}.chat`
}
+/** The agent a conversation's path files it under, or undefined for a flow's own chat. */
+export function agentOfChatPath(chatPath: string): string | undefined {
+ return chatPath.endsWith('.chat') ? chatPath.slice(0, -'.chat'.length) : undefined
+}
+
/** The id of the one step a saved agent's run is made of, as the server names it too: job-read
* scoping and the run's agent detection match on it, so it is only ever relabeled for display. */
export const AGENT_STEP_ID = '__wm_agent_root'
diff --git a/frontend/src/lib/components/home/CreateActionsMenu.svelte b/frontend/src/lib/components/home/CreateActionsMenu.svelte
index 9b8db55066..ed170919da 100644
--- a/frontend/src/lib/components/home/CreateActionsMenu.svelte
+++ b/frontend/src/lib/components/home/CreateActionsMenu.svelte
@@ -113,6 +113,11 @@
// kept static so tailwind doesn't purge the badge tones
const badgeAdvanced = 'bg-gray-100 text-gray-600 dark:bg-gray-700 dark:text-gray-300'
+ // While Home's composer is open (`data-composer-open`) the button looks like the default
+ // variant: that state lives in the DOM, not in a prop. The border is an inset ring so the
+ // button keeps its width.
+ const QUIET_AS_DEFAULT =
+ 'group-has-[[data-composer-open]]/home:bg-transparent group-has-[[data-composer-open]]/home:hover:bg-surface-hover group-has-[[data-composer-open]]/home:text-primary group-has-[[data-composer-open]]/home:ring-1 group-has-[[data-composer-open]]/home:ring-inset group-has-[[data-composer-open]]/home:ring-border-light'
const badgeLegacy = 'bg-amber-100 text-amber-700 dark:bg-amber-900/40 dark:text-amber-300'
const badgeAlpha = 'bg-emerald-100 text-emerald-700 dark:bg-emerald-900/40 dark:text-emerald-300'
const badgeRecommended = 'bg-blue-100 text-blue-700 dark:bg-blue-900/40 dark:text-blue-300'
@@ -535,6 +540,7 @@
aiDescription="Create a new script, flow or app"
unifiedSize="md"
variant="accent"
+ btnClasses={QUIET_AS_DEFAULT}
startIcon={{ icon: Plus }}
endIcon={{ icon: ChevronDown }}
bind:element={triggerEl}
diff --git a/frontend/src/lib/components/home/HomeAIChat.svelte b/frontend/src/lib/components/home/HomeAIChat.svelte
index 9660cca149..9d6f3949a7 100644
--- a/frontend/src/lib/components/home/HomeAIChat.svelte
+++ b/frontend/src/lib/components/home/HomeAIChat.svelte
@@ -16,10 +16,10 @@
import CloseButton from '../common/CloseButton.svelte'
import { logFeatureUsage } from '$lib/utils/featureUsage'
import { hubBaseUrlStore, roleCapabilities, workspaceStore } from '$lib/stores'
- import { sessionState } from '../sessions/sessionState.svelte'
+ import { homeDraft, sessionState } from '../sessions/sessionState.svelte'
import { currentWorkspaceRootId } from '../sessions/sessionScope.svelte'
import { HOME_SHOW_HUB } from '$lib/consts'
- import { getLocalSetting, storeLocalSetting } from '$lib/utils'
+ import { homeComposerPin, setHomeComposerRemoved } from './homeComposerPin.svelte'
import { useReducedMotion } from '$lib/svelte5Utils.svelte'
import { BROWSER } from 'esm-env'
import HomeConnectDrawer from './HomeConnectDrawer.svelte'
@@ -35,8 +35,6 @@
import { useWorkspaceAiHidden } from '../copilot/workspaceAiHidden.svelte'
import { homeQuickAccessSettings } from './homeQuickAccessSettings.svelte'
- const COLLAPSED_SETTING = 'home-ai-composer-collapsed'
-
/** Bar width from which the two side trips stand in the bar rather than folding into the menu.
* Home's trail is ~250px and the rest of its actions ~400, so this leaves room for both
* labelled buttons without the trail starting to truncate. Below it they fold back. */
@@ -46,14 +44,9 @@
let homeConnectDrawer: HomeConnectDrawer | undefined = $state(undefined)
- // Whether this reader wants the composer on the home page at all, so it lives per browser
- // rather than per workspace or account. It has nothing to do with the composer's one-line
- // state despite the key's name; renaming the key would reset every reader's choice.
- let removed = $state(BROWSER && getLocalSetting(COLLAPSED_SETTING) === 'true')
- function setRemoved(next: boolean) {
- removed = next
- storeLocalSetting(COLLAPSED_SETTING, next ? 'true' : undefined)
- }
+ // Whether this reader wants the composer on the home page at all. Starting a session puts
+ // it back (see pinHomeComposer).
+ const removed = $derived(homeComposerPin.removed)
// Removing puts the composer away rather than throwing it out, and the way back is one item in
// the band's menu — so the ellipsis flashes as it appears, in a corner nobody is watching while
@@ -71,7 +64,7 @@
function removeComposer() {
// The `close` key keeps these events in the series they have always been counted in.
logFeatureUsage('home', 'ai_hero_remove', { key: 'close' })
- setRemoved(true)
+ setHomeComposerRemoved(true)
if (reducedMotion.val) return
clearTimeout(pulseEndTimer)
pulsing = true
@@ -85,16 +78,17 @@
// are no extra wait.
if ($workspaceStore) prefetchComposerSignals($workspaceStore)
- // Whether Home's own workspace hides the assistant, read for that workspace: once the block
- // shows, the shared copilot config is the draft's, so a draft acting on a workspace that hides
- // AI would otherwise take the whole block, and the picker that could undo it, off Home.
+ // Whether Home's own workspace hides the assistant, read for that workspace rather than from
+ // the shared copilot config, which still describes the last session's workspace for a moment
+ // after leaving its page.
const homeAiHidden = useWorkspaceAiHidden(() => $workspaceStore ?? undefined)
- // The composer hands off to /sessions, which refuses roles that cannot code and users opted out
- // of the sessions beta — so hide it from them (the prompt would be silently dropped) while the
- // AI-independent CLI/MCP row below stays.
+ // The composer hands off to /sessions, which refuses roles that cannot code, users opted out
+ // of the sessions beta and a session's own preview frame — so hide it there (the prompt would
+ // be silently dropped) while the AI-independent CLI/MCP row below stays.
+ const inPreviewFrame = BROWSER && window.self !== window.top
let showComposer = $derived(
- prefersSessionHandoff(!$roleCapabilities.code) && !homeAiHidden.hidden
+ prefersSessionHandoff(!$roleCapabilities.code) && !inPreviewFrame && !homeAiHidden.hidden
)
let hero = $derived(showComposer && !removed)
@@ -116,9 +110,10 @@
+ fork shares its parent's, and remounting for it only flashes the block. Also keyed
+ on the asks for another draft (New session, a draft picked in the session list). -->
{#if HomeSessionStarter && sessionState.hydrated}
- {#key $currentWorkspaceRootId}
+ {#key `${$currentWorkspaceRootId}:${homeDraft.requests}`}