diff --git a/frontend/src/lib/assets/app.css b/frontend/src/lib/assets/app.css index b833582069..e551dd1595 100644 --- a/frontend/src/lib/assets/app.css +++ b/frontend/src/lib/assets/app.css @@ -423,6 +423,25 @@ input[type='time']::-webkit-calendar-picker-indicator { outline: 2px solid rgb(var(--color-border-accent, 59 130 246)); } +/* Home's composer, pointed at by New session (AIChatDisplay's flashComposer): its box's outline + lights up in the accent color and fades, as a setting does when the settings search lands on + it. Scoped to the flash, so the box carries no outline otherwise. */ +[data-composer-flash] [data-composer-box] { + outline: 2px solid transparent; + outline-offset: 1px; + animation: wm-composer-flash 0.8s ease-in; +} +@keyframes wm-composer-flash { + from { + outline-color: rgb(var(--color-border-accent, 59 130 246)); + } +} +@media (prefers-reduced-motion: reduce) { + [data-composer-flash] [data-composer-box] { + animation: none; + } +} + .svelte-flow__edges { z-index: -10; } @@ -443,65 +462,3 @@ input[type='time']::-webkit-calendar-picker-indicator { :root[data-home-sessions-transition='fade'] * { view-transition-name: none !important; } - -/* Home's Workspace ⇄ AI Sessions switch (swapHomeSide in homeSessionsTransition.svelte.ts). - Home is the same page beside either list, so only the sidebar's list moves. The page shows - its new state at once, live, which lets the composer's own opening or folding play; named, - the composer would be held to the size it had when the switch began. The list's name exists - only while the switch runs: carried at all times, a send's move to the session page would - animate it too. */ -:root[data-home-side-transition] .wm-vt-sidebar-list { - view-transition-name: home-sidebar-list; -} -:root[data-home-side-transition] [data-session-composer] { - view-transition-name: none !important; -} -:root[data-home-side-transition]::view-transition-old(root) { - display: none; -} -:root[data-home-side-transition]::view-transition-new(root) { - animation: none; -} -/* The list comes in from the side of the button pressed: AI Sessions is the right one. */ -:root[data-home-side-transition]::view-transition-old(home-sidebar-list), -:root[data-home-side-transition]::view-transition-new(home-sidebar-list) { - animation-duration: 260ms; - animation-timing-function: cubic-bezier(0.2, 0.8, 0.2, 1); - animation-fill-mode: both; -} -:root[data-home-side-transition='sessions']::view-transition-old(home-sidebar-list) { - animation-name: wm-side-out-left; -} -:root[data-home-side-transition='sessions']::view-transition-new(home-sidebar-list) { - animation-name: wm-side-in-right; -} -:root[data-home-side-transition='workspace']::view-transition-old(home-sidebar-list) { - animation-name: wm-side-out-right; -} -:root[data-home-side-transition='workspace']::view-transition-new(home-sidebar-list) { - animation-name: wm-side-in-left; -} -@keyframes wm-side-out-left { - to { - opacity: 0; - transform: translateX(-28px); - } -} -@keyframes wm-side-in-right { - from { - opacity: 0; - transform: translateX(28px); - } -} -@keyframes wm-side-out-right { - to { - opacity: 0; - transform: translateX(28px); - } -} -@keyframes wm-side-in-left { - from { - opacity: 0; - transform: translateX(-28px); - } -} diff --git a/frontend/src/lib/components/SharingTabs.svelte b/frontend/src/lib/components/SharingTabs.svelte new file mode 100644 index 0000000000..9d8fb2f5e2 --- /dev/null +++ b/frontend/src/lib/components/SharingTabs.svelte @@ -0,0 +1,20 @@ + + +{#if bothShown} + goto(`/${e.detail}`)} wrapperClass="pt-4"> + + + +{/if} diff --git a/frontend/src/lib/components/copilot/chat/AIChat.svelte b/frontend/src/lib/components/copilot/chat/AIChat.svelte index 4852efa179..cb6bdc22e3 100644 --- a/frontend/src/lib/components/copilot/chat/AIChat.svelte +++ b/frontend/src/lib/components/copilot/chat/AIChat.svelte @@ -126,12 +126,12 @@ aiChatDisplay?.focusInput(selection) } - export async function attachContext(element: import('./context').ContextElement) { - await aiChatDisplay?.attachContext(element) + export function flashComposer() { + aiChatDisplay?.flashComposer() } - export function foldComposer() { - aiChatDisplay?.foldComposer() + export async function attachContext(element: import('./context').ContextElement) { + await aiChatDisplay?.attachContext(element) } const historyManager = aiChatManager.historyManager diff --git a/frontend/src/lib/components/copilot/chat/AIChatDisplay.svelte b/frontend/src/lib/components/copilot/chat/AIChatDisplay.svelte index fa123e15ff..749e3cde0b 100644 --- a/frontend/src/lib/components/copilot/chat/AIChatDisplay.svelte +++ b/frontend/src/lib/components/copilot/chat/AIChatDisplay.svelte @@ -78,7 +78,7 @@ 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 @@ -316,14 +316,6 @@ aiChatInput?.focusInput(selection) } - /** A starter composer back on one line, as a press outside it does: not while it holds a - * draft, which is never hidden. Takes the caret out, or the next keypress reopens it. */ - export function foldComposer() { - closeComposer() - if (!composerOpened && composerEl?.contains(document.activeElement)) - (document.activeElement as HTMLElement).blur() - } - /** Mention a workspace item in the draft, as "+" → Mention file does, and hand the user * the caret after it. Focusing is what opens Home's one-line composer. */ export async function attachContext(element: ContextElement) { @@ -634,7 +626,18 @@ } function onComposerPointerDown(e: PointerEvent) { if (!starterLayout || !composerOpened || composerEl?.contains(e.target as Node)) return - if (!isComposerOverlay(e.target)) closeComposer() + 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. @@ -1017,13 +1020,20 @@ the panel, or the Escape-to-stop focus check would wrongly reject them. --> +
{ + if (e.animationName === 'wm-composer-flash') flashing = false + }} onfocusin={(e) => { if (starterLayout && e.target instanceof HTMLTextAreaElement) composerOpened = true }} 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/composerCollapse.ts b/frontend/src/lib/components/copilot/chat/starter/composerCollapse.ts index 5c082154fc..5b88d13a37 100644 --- a/frontend/src/lib/components/copilot/chat/starter/composerCollapse.ts +++ b/frontend/src/lib/components/copilot/chat/starter/composerCollapse.ts @@ -12,3 +12,14 @@ export function isComposerOverlay(target: EventTarget | null): boolean { if (target instanceof Element && target.closest(OVERLAY)) return true return document.querySelector(OVERLAY) !== null } + +/** Whether a pointer-down outside the composer leaves it open: it is on a control that brings + * the user to it (`data-asks-for-composer`, New session), where folding it on the way in would + * collapse it and open it again under the user's eyes, or on what the user works in alongside + * it (`data-works-with-composer`, Home's lists), where a click adds an item to it. */ +export function asksForComposer(target: EventTarget | null): boolean { + return ( + target instanceof Element && + target.closest('[data-asks-for-composer], [data-works-with-composer]') !== null + ) +} diff --git a/frontend/src/lib/components/details/FlowDetail.svelte b/frontend/src/lib/components/details/FlowDetail.svelte index 862435fb57..1d68a50ed1 100644 --- a/frontend/src/lib/components/details/FlowDetail.svelte +++ b/frontend/src/lib/components/details/FlowDetail.svelte @@ -83,6 +83,7 @@ useOperatingWorkspaceHref } from '$lib/components/operatingWorkspace.svelte' import FlowChat from '$lib/components/flows/conversations/FlowChat.svelte' + import { page } from '$app/state' import { slide } from 'svelte/transition' import { twMerge } from 'tailwind-merge' import CiTestResults from '$lib/components/CiTestResults.svelte' @@ -857,6 +858,7 @@ flowModules={flow?.value?.modules} wideLayout frame="none" + openConversation={page.url.searchParams.get('conversation') ?? undefined} /> {:else} {@const hasSchema = diff --git a/frontend/src/lib/components/flows/content/AgentEditorHost.svelte b/frontend/src/lib/components/flows/content/AgentEditorHost.svelte index cdec419e5a..aea13e544d 100644 --- a/frontend/src/lib/components/flows/content/AgentEditorHost.svelte +++ b/frontend/src/lib/components/flows/content/AgentEditorHost.svelte @@ -71,6 +71,8 @@ view?: boolean /** Opens the agent's configuration, offered beside the model it runs with. */ onOpenConfig?: () => void + /** A chat conversation to show once the chat is up, as a link to it names one. */ + openConversation?: string /** A view's form mode: the run form, drawn by the page. Kept out of this component because * the flow editor reaches it, and the run form reads the navigation workspace. */ viewForm?: import('svelte').Snippet< @@ -95,6 +97,7 @@ isNew = false, view = false, onOpenConfig = undefined, + openConversation = undefined, viewForm = undefined }: Props = $props() @@ -726,6 +729,7 @@ inputSchema={AGENT_CHAT_SCHEMA} flowModules={chatModules} composerSettings={onOpenConfig ? configButton : undefined} + {openConversation} />
diff --git a/frontend/src/lib/components/flows/conversations/FlowChat.svelte b/frontend/src/lib/components/flows/conversations/FlowChat.svelte index 321caeb190..4de08fa67a 100644 --- a/frontend/src/lib/components/flows/conversations/FlowChat.svelte +++ b/frontend/src/lib/components/flows/conversations/FlowChat.svelte @@ -63,6 +63,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 } let { @@ -78,7 +80,8 @@ frame = 'top', conversationKind = 'deployed', subject = 'flow', - composerSettings = undefined + composerSettings = undefined, + openConversation = undefined }: Props = $props() const flowEditorContext = getContext('FlowEditorContext') @@ -164,6 +167,10 @@ } }) const unsubscribePool = createdPool.subscribe((s) => (poolState = s)) + // Untracked: following the link once is the whole job; a later change of the prop must + // not rebuild every chat of the flow. + const linked = untrack(() => openConversation) + if (linked) createdPool.select(linked) listChat = createdList pool = createdPool return () => { diff --git a/frontend/src/lib/components/flows/conversations/agentEditorChat.ts b/frontend/src/lib/components/flows/conversations/agentEditorChat.ts index 0f1bc86bda..b7b53851c9 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 d0fe016745..b1e3948c59 100644 --- a/frontend/src/lib/components/home/HomeAIChat.svelte +++ b/frontend/src/lib/components/home/HomeAIChat.svelte @@ -113,8 +113,6 @@ 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}:${homeDraft.requests}`} {#if favoriteManager.loadedFor === workspace && (entries.length > 0 || emptiedBySettings) && !hidden} -
+
{#if favoriteCount > 0} diff --git a/frontend/src/lib/components/home/ItemsList.svelte b/frontend/src/lib/components/home/ItemsList.svelte index 9832215405..e332927d8c 100644 --- a/frontend/src/lib/components/home/ItemsList.svelte +++ b/frontend/src/lib/components/home/ItemsList.svelte @@ -1549,7 +1549,10 @@ // button asynchronously after the menu closes. Without overriding it, pressing // an arrow key would re-open / re-highlight the workspace picker instead of // moving the flat list's selection. Run several times to win the focus race. + // Never over Home's composer: New session in another workspace switches it too, and asks + // for the caret there. const focusSearch = () => { + if (document.activeElement?.closest('[data-session-composer]')) return const el = document.getElementById('home-search-input') as HTMLInputElement | null el?.focus() } @@ -1932,10 +1935,19 @@ {/if} -
+ + +
(searchbarDropdownOpen = v)} />
diff --git a/frontend/src/lib/components/sessions/HomeSessionStarter.svelte b/frontend/src/lib/components/sessions/HomeSessionStarter.svelte index d5f6e88723..868dd613fb 100644 --- a/frontend/src/lib/components/sessions/HomeSessionStarter.svelte +++ b/frontend/src/lib/components/sessions/HomeSessionStarter.svelte @@ -17,6 +17,7 @@ sessionPageHref, sessionState, setSessionDraftPrompt, + takeHomeDraftFlash, takeHomeDraftFocus } from './sessionState.svelte' import { useWorkModeLock } from './workModeLock.svelte' @@ -67,6 +68,7 @@ function bindChat(chat: AIChat | undefined) { aiChat = chat if (chat && takeHomeDraftFocus()) setTimeout(() => chat.focusInput(), 0) + if (chat && takeHomeDraftFlash()) setTimeout(() => chat.flashComposer(), 0) } let chatWrapper: HTMLDivElement | undefined = $state(undefined) // A seeded draft holds the composer open, which is not the shape it rests in once the @@ -85,11 +87,12 @@ // The rows' "Ask AI" lands here. Before the chat has mounted (its config still // loading) there is nowhere to put the item, and the attach does nothing. return homeComposerContext.register({ + sessionId, attach: async (element) => { await aiChat?.attachContext(element) }, focus: () => aiChat?.focusInput(), - fold: () => aiChat?.foldComposer(), + flash: () => aiChat?.flashComposer(), runtime }) }) diff --git a/frontend/src/lib/components/sessions/SessionPicker.svelte b/frontend/src/lib/components/sessions/SessionPicker.svelte index be9ee5e016..b21d1fbd00 100644 --- a/frontend/src/lib/components/sessions/SessionPicker.svelte +++ b/frontend/src/lib/components/sessions/SessionPicker.svelte @@ -2,6 +2,7 @@ import ConfirmationModal from '$lib/components/common/confirmationModal/ConfirmationModal.svelte' import Checkbox from '$lib/components/common/checkbox/Checkbox.svelte' import { Button } from '$lib/components/common' + import SidebarSectionHeader from '$lib/components/sidebar/SidebarSectionHeader.svelte' import { Archive, ArchiveRestore, @@ -20,7 +21,6 @@ Trash2 } from 'lucide-svelte' import { twMerge } from 'tailwind-merge' - import type { Snippet } from 'svelte' import TextInput from '$lib/components/text_input/TextInput.svelte' import { goto } from '$lib/navigation' import { leaveForHome, openDraftOnHome, openNewSession } from './sessionSwitch.svelte' @@ -142,13 +142,6 @@ // Drop the section's own outer padding/border so it sits flush inside a // parent container (e.g. gathered with Favorites/Search in the sidebar). embedded?: boolean - // Render only the collapsed rail's session menu, opened by hovering this trigger - // (rendered with melt's `trigger` and the unread total). The trigger's own click is - // the host's: it never reaches the menu. - hoverTrigger?: Snippet<[{ trigger: any; unread: number }]> - // Shares the options row, left of its menu. With it the picker fills its parent and - // scrolls the list alone, so the row stays in place. - leading?: Snippet } let { @@ -158,9 +151,7 @@ browsedWorkspaceId = undefined, onBrowseWorkspace = undefined, onSelectSession = undefined, - embedded = false, - hoverTrigger = undefined, - leading = undefined + embedded = false }: Props = $props() const sectionCollapsed = useLocalStorageValue( @@ -671,33 +662,29 @@ unavailable (no provider configured or disabled in the user's settings) the section still shows — the per-session chat input is disabled with an explanatory message, mirroring the sidebar AI chat. --> -{:else if isCollapsed || hoverTrigger} -
+{:else if isCollapsed} +
{#snippet children({ createMenu })} - + {#snippet triggr({ trigger })} - {#if hoverTrigger} - {@render hoverTrigger({ trigger, unread: totalUnread })} - {:else} -
- - {#if totalUnread > 0} - - {/if} -
- {/if} +
+ + {#if totalUnread > 0} + + {/if} +
{/snippet} {#snippet children({ item, builders })}
@@ -774,7 +761,7 @@
@@ -820,10 +807,7 @@ {GROUP_BY_OPTIONS.find((o) => o.value === groupBy.val)?.hint ?? ''} {/snippet} -
- {#if leading} -
{@render leading()}
- {/if} + {#snippet listOptions(size: 'sm' | 'md')} {/snippet} -
- {/if} - {#if collapsible} - -
- -
+ {#snippet actions()} + + (triggersCollapsed.val = !triggersCollapsed.val)} + actions={showAddTriggerMenu ? triggerHeaderActions : undefined} + /> + {#snippet triggerHeaderActions()} + + {#snippet children({ createMenu })} + {@render addTriggerMenu(createMenu, true)} + {/snippet} + + {/snippet} {/if} {#if isCollapsed || !triggersCollapsed.val}
- + {#snippet children({ createMenu })} {#each triggerMenuLinks as menuLink (menuLink.href ?? menuLink.label)} {/each} - {#if showAddTriggerMenu} - - {#snippet triggr({ trigger })} - - - - {/snippet} - {#snippet children({ item })} - {#each extraTriggerLinks as subItem (subItem.href ?? subItem.label)} - -
- {#if subItem.icon} - - {/if} - {subItem.label} -
-
- {/each} - {/snippet} -
+ {#if showAddTriggerMenu && isCollapsed} + {@render addTriggerMenu(createMenu, false)} {/if} {/snippet}
diff --git a/frontend/src/lib/components/sidebar/SidebarSectionHeader.svelte b/frontend/src/lib/components/sidebar/SidebarSectionHeader.svelte new file mode 100644 index 0000000000..fcaad98646 --- /dev/null +++ b/frontend/src/lib/components/sidebar/SidebarSectionHeader.svelte @@ -0,0 +1,41 @@ + + + +
+ + {@render actions?.()} +
diff --git a/frontend/src/routes/(root)/(logged)/+layout.svelte b/frontend/src/routes/(root)/(logged)/+layout.svelte index 8fb84fc8e0..6066dd4345 100644 --- a/frontend/src/routes/(root)/(logged)/+layout.svelte +++ b/frontend/src/routes/(root)/(logged)/+layout.svelte @@ -24,6 +24,7 @@ import SettingsMenu from '$lib/components/sidebar/SettingsMenu.svelte' import SidebarUsage from '$lib/components/sidebar/SidebarUsage.svelte' import SidebarScrollArea from '$lib/components/sidebar/SidebarScrollArea.svelte' + import AiChatsSection from '$lib/components/sidebar/AiChatsSection.svelte' import AccountSetupBanner from '$lib/components/sidebar/AccountSetupBanner.svelte' import FinishAccountSetup from '$lib/components/sidebar/FinishAccountSetup.svelte' import { accountSetup } from '$lib/components/sidebar/accountSetup.svelte' @@ -66,7 +67,7 @@ import type SuperadminSettings from '$lib/components/SuperadminSettings.svelte' import WindmillIcon from '$lib/components/icons/WindmillIcon.svelte' import { page } from '$app/state' - import FavoriteMenu, { + import { favoriteManager, getFavoriteHref, getFavoriteLabel @@ -108,11 +109,10 @@ import InstanceUiSync from '$lib/components/InstanceUiSync.svelte' import { onDestroy, setContext, untrack } from 'svelte' import { cubicOut } from 'svelte/easing' - import { Menubar, Tooltip } from '$lib/components/meltComponents' + import { Tooltip } from '$lib/components/meltComponents' import { aiChatManager } from '$lib/components/copilot/chat/AIChatManager.svelte' import AiChatLayout from '$lib/components/copilot/chat/AiChatLayout.svelte' import SessionPicker from '$lib/components/sessions/SessionPicker.svelte' - import SessionModeSwitch from '$lib/components/sessions/SessionModeSwitch.svelte' import { isGlobalAiEnabled, sessionsAllowedFor } from '$lib/components/copilot/chat/global/gate' import { copilotInfo } from '$lib/aiStore' import { @@ -120,10 +120,7 @@ parsePreviewItemRoute, barePath } from '$lib/components/sessions/previewPaths' - import { - chosenSidebarList, - sessionsSwitchShown - } from '$lib/components/sessions/sidebarList.svelte' + import { sidebarSessionsShown } from '$lib/components/sessions/sidebarList.svelte' import { noteArrival } from '$lib/components/sessions/sessionSwitch.svelte' import { sessionState } from '$lib/components/sessions/sessionState.svelte' import { restoreSessionBackups } from '$lib/components/sessions/sessionMirror.svelte' @@ -300,8 +297,8 @@ let isDarkMode = useIsDarkMode() let darkMode = $derived(isDarkMode.val) - // An operator without the opt-in (`gate.ts`) is refused by /sessions, so their sidebar is not - // handed over to a session list the page behind it declines, and they keep the docked chat. + // An operator without the opt-in (`gate.ts`) is refused by /sessions, so their sidebar lists + // no sessions the page behind it declines, and they keep the docked chat. const sessionsAllowed = $derived(sessionsAllowedFor(!$roleCapabilities.code)) let onSessionsPage = $derived(page.url.pathname.startsWith('/sessions') && sessionsAllowed) // A session's page points the bottom settings entry at the open session's own @@ -316,16 +313,13 @@ const embedded = BROWSER && window.self !== window.top // AI sessions (beta) are on unless this browser opted out earlier (see - // `global/gate.ts`). The Workspace ⇄ AI Sessions switch follows the gate; + // `global/gate.ts`). The sidebar's session section follows the gate; // opted-out users get the legacy Ask-AI pane instead. // The /sessions page has its own gate for direct navigation. const globalAiEnabled = isGlobalAiEnabled() // A workspace that hid the assistant (`ai_config.copilot_disabled`) loses both entry - // points: the Workspace ⇄ AI Sessions switch and the legacy Ask-AI button. - const switchRowShown = $derived(sessionsSwitchShown()) - // Where the switch is hidden, so is the session list. - const sidebarList = $derived(chosenSidebarList.val) - const sidebarListsSessions = $derived(switchRowShown && sidebarList === 'sessions') + // points: the session section and the legacy Ask-AI button. + const sessionsShown = $derived(sidebarSessionsShown()) const askAiShown = $derived( (!globalAiEnabled || !sessionsAllowed) && !$copilotInfo.workspaceDisabled ) @@ -1125,9 +1119,8 @@ outside this layout, and their shortcut must reopen the URL that is their creden - + {#snippet quickLinks(collapsed: boolean)} {/snippet} - @@ -1193,9 +1186,7 @@ outside this layout, and their shortcut must reopen the URL that is their creden
{/snippet} - + {#snippet settingsMenu(collapsed: boolean)}
{/if} -
- -
- -
- {#if switchRowShown && !(sidebarListsSessions && !collapsed)} -
-
- -
-
+
+
+ +
+ + {#if !collapsed} + {/if} - - {#if sidebarListsSessions} - - {#if collapsed} -
- -
- {:else} -
- - {#snippet leading()} - - {/snippet} - -
- {/if} - {@render settingsMenu(collapsed)} - {:else} - +
+ - - -
+ + +
+
{@render quickLinks(collapsed)} - - {#snippet children({ createMenu })} - - {/snippet} - - openSearchModal()} - isCollapsed={collapsed} - icon={Search} - label="Search" - class="!text-xs" - shortcut={`${getModifierKey()}k`} - /> + {#if collapsed} + openSearchModal()} + isCollapsed={collapsed} + icon={Search} + label="Search" + class="!text-xs" + shortcut={`${getModifierKey()}k`} + /> + {/if} {#if askAiShown} + AI Sessions beta (otherwise the AI sessions section replaces it). --> aiChatManager.toggleOpen()} @@ -1325,8 +1299,6 @@ outside this layout, and their shortcut must reopen the URL that is their creden /> {/if}
- - +
- + {#if sessionsShown} +
+ +
+ {/if} + + +
+ +
+ + -
- {@render settingsMenu(collapsed)} -
-
- {/if} +
+ {@render settingsMenu(collapsed)} +
+
diff --git a/frontend/src/routes/(root)/(logged)/+page.svelte b/frontend/src/routes/(root)/(logged)/+page.svelte index d23f92de96..dd288f32ed 100644 --- a/frontend/src/routes/(root)/(logged)/+page.svelte +++ b/frontend/src/routes/(root)/(logged)/+page.svelte @@ -98,6 +98,8 @@ // the mount animation below never covers. Replay it by hand instead of keying the page on the // workspace: a remount would drop the list's own state and refetch what it is already loading. let pageEl: HTMLDivElement | undefined = $state(undefined) + // Height of the composer's column, which stays at the top while the composer is open. + let pinnedHeight = $state(0) // Back from AI Sessions the view transition (homeSessionsTransition.svelte.ts) carries the arrival, so // the page skips its own fade-in. Decided once at mount: gating the class on the attribute @@ -292,8 +294,11 @@
@@ -301,7 +306,14 @@ -
+ +