From 1dbeb1315c83552492156bc43e48067e3f10d4ab Mon Sep 17 00:00:00 2001 From: Guilhem Lemouel Date: Mon, 19 Oct 2026 07:45:54 -0700 Subject: [PATCH] refactor: drop home tech debt, fix phone layout and keyboard access, remove the home preview page Co-Authored-By: Claude Opus 5.5 (1M context) --- frontend/src/lib/assets/app.css | 22 -- .../src/lib/components/InheritedLabels.svelte | 23 +- .../components/common/badge/LabelList.svelte | 33 +++ .../components/common/table/AgentRow.svelte | 4 +- .../lib/components/common/table/AppRow.svelte | 4 +- .../common/table/AskAiRowButton.svelte | 3 +- .../components/common/table/FlowRow.svelte | 4 +- .../common/table/PipelineRow.svelte | 1 + .../components/common/table/RawAppRow.svelte | 1 + .../lib/components/common/table/Row.svelte | 21 +- .../components/common/table/RowLabels.svelte | 34 ++- .../components/common/table/ScriptRow.svelte | 4 +- .../components/common/table/unruledList.ts | 26 +++ .../copilot/chat/AIChatDisplay.svelte | 46 ++-- .../copilot/chat/AIChatInput.svelte | 10 +- .../copilot/chat/AIChatManager.svelte.ts | 2 +- .../copilot/chat/ContextTextarea.svelte | 4 +- .../components/copilot/chat/chatViewHost.ts | 2 +- .../chat/starter/composerCollapse.test.ts | 18 -- .../copilot/chat/starter/composerCollapse.ts | 13 -- .../copilot/chat/starter/smoothHeight.ts | 11 +- .../chat/starter/starterPrompts.svelte.ts | 12 +- .../src/lib/components/copilot/loadCopilot.ts | 3 +- .../copilot/workspaceAiHidden.svelte.ts | 44 ++++ .../conversations/flowChatViewHost.svelte.ts | 2 +- .../src/lib/components/home/HomeAIChat.svelte | 52 ++--- .../src/lib/components/home/ItemsList.svelte | 41 ++-- .../lib/components/home/TreeOwnerRow.svelte | 10 +- .../src/lib/components/home/TreeView.svelte | 13 +- .../lib/components/home/TreeViewRoot.svelte | 17 +- .../sessions/HomeSessionStarter.svelte | 2 +- .../components/sessions/SessionWrapper.svelte | 6 +- .../sessions/homeComposerContext.svelte.ts | 5 +- frontend/src/lib/consts.ts | 3 + frontend/src/lib/devPreview.ts | 49 ---- .../src/routes/(root)/(logged)/+page.svelte | 3 +- .../(root)/(logged)/sessions/+page.svelte | 51 +---- .../kitchen_sink/home_preview/+page.svelte | 209 ------------------ 38 files changed, 274 insertions(+), 534 deletions(-) create mode 100644 frontend/src/lib/components/common/badge/LabelList.svelte create mode 100644 frontend/src/lib/components/common/table/unruledList.ts delete mode 100644 frontend/src/lib/components/copilot/chat/starter/composerCollapse.test.ts create mode 100644 frontend/src/lib/components/copilot/workspaceAiHidden.svelte.ts delete mode 100644 frontend/src/lib/devPreview.ts delete mode 100644 frontend/src/routes/(styled)/kitchen_sink/home_preview/+page.svelte diff --git a/frontend/src/lib/assets/app.css b/frontend/src/lib/assets/app.css index 9e4d4ea753..037ca0ee4e 100644 --- a/frontend/src/lib/assets/app.css +++ b/frontend/src/lib/assets/app.css @@ -427,28 +427,6 @@ input[type='time']::-webkit-calendar-picker-indicator { z-index: -10; } -/* Row actions shown only for the row being used: hovered, tabbed into, keyboard-selected, or - with one of its menus open. Opacity rather than visibility, so Tab still reaches them. Focus - only when visible: a menu hands focus back to its trigger on close, and a mouse user would - otherwise keep that row's actions up after leaving it. */ -/* A list whose rows are not ruled off from each other (Home's items). Rows mark themselves - with `data-list-row`; their own `border-b` stays for every other list. */ -[data-unruled] [data-list-row] { - border-bottom-width: 0 !important; - border-radius: 0.375rem !important; -} - -[data-hover-actions] [data-list-row] [data-row-actions] { - opacity: 0; - transition: opacity 100ms; -} -[data-hover-actions] [data-list-row]:hover [data-row-actions], -[data-hover-actions] [data-list-row]:has(:focus-visible) [data-row-actions], -[data-hover-actions] [data-list-row][data-row-keyboard-selected] [data-row-actions], -[data-hover-actions] [data-row-actions]:has([aria-expanded='true']) { - opacity: 1; -} - /* The composer's glide, defined once: the Home ↔ AI Sessions view transition below and the in-page move on a session's first message (the spacer under AIChatDisplay's composer) both read it. */ diff --git a/frontend/src/lib/components/InheritedLabels.svelte b/frontend/src/lib/components/InheritedLabels.svelte index 2e17648702..f15aaf5567 100644 --- a/frontend/src/lib/components/InheritedLabels.svelte +++ b/frontend/src/lib/components/InheritedLabels.svelte @@ -1,5 +1,5 @@ -{#if labels?.length} -
- {#each labels.slice(0, max) as label (label)} - - {label} - - {/each} - {#if labels.length > max} - 'Label inherited from folder: ' + l) - .join('\n')}>+{labels.length - max} - {/if} -
-{/if} + diff --git a/frontend/src/lib/components/common/badge/LabelList.svelte b/frontend/src/lib/components/common/badge/LabelList.svelte new file mode 100644 index 0000000000..8fb15f8186 --- /dev/null +++ b/frontend/src/lib/components/common/badge/LabelList.svelte @@ -0,0 +1,33 @@ + + +{#if labels?.length} +
+ {#each labels.slice(0, max) as label (label)} + {label} + {/each} + {#if labels.length > max} + `${titlePrefix}: ${l}`) + .join('\n')}>+{labels.length - max} + {/if} +
+{/if} diff --git a/frontend/src/lib/components/common/table/AgentRow.svelte b/frontend/src/lib/components/common/table/AgentRow.svelte index be51541c94..d44d0bfe06 100644 --- a/frontend/src/lib/components/common/table/AgentRow.svelte +++ b/frontend/src/lib/components/common/table/AgentRow.svelte @@ -4,7 +4,7 @@ import DraftBadge from '$lib/components/DraftBadge.svelte' import type ShareModal from '$lib/components/ShareModal.svelte' import type DeployWorkspaceDrawer from '$lib/components/DeployWorkspaceDrawer.svelte' - import InheritedLabels from '$lib/components/InheritedLabels.svelte' + import RowLabels from './RowLabels.svelte' import type { ListableResource } from '$lib/gen' import { userStore, workspaceStore } from '$lib/stores' import { createEventDispatcher } from 'svelte' @@ -84,7 +84,7 @@ > {#snippet badges()} - + Raw {/if} - - + diff --git a/frontend/src/lib/components/common/table/FlowRow.svelte b/frontend/src/lib/components/common/table/FlowRow.svelte index 8a5f8fdaa2..2b0fec570c 100644 --- a/frontend/src/lib/components/common/table/FlowRow.svelte +++ b/frontend/src/lib/components/common/table/FlowRow.svelte @@ -36,7 +36,6 @@ } from 'lucide-svelte' import FlowHistory from '$lib/components/flows/FlowHistory.svelte' import ChatFlowBadge from '$lib/components/flows/ChatFlowBadge.svelte' - import InheritedLabels from '$lib/components/InheritedLabels.svelte' import RowLabels from './RowLabels.svelte' import AskAiRowButton from './AskAiRowButton.svelte' import { getDeployUiSettings } from '$lib/components/home/deploy_ui' @@ -161,8 +160,7 @@ archived {/if} - - + { let { path } = app diff --git a/frontend/src/lib/components/common/table/Row.svelte b/frontend/src/lib/components/common/table/Row.svelte index ba0f4c630c..2d27f89851 100644 --- a/frontend/src/lib/components/common/table/Row.svelte +++ b/frontend/src/lib/components/common/table/Row.svelte @@ -9,6 +9,9 @@ import Tooltip from '../../meltComponents/Tooltip.svelte' import Checkbox from '../checkbox/Checkbox.svelte' import type { RowSelection } from './rowSelection' + import { HOVER_ACTIONS_CLASS, inUnruledList } from './unruledList' + + const unruled = inUnruledList() interface Props { marked: string | undefined @@ -177,12 +180,14 @@ with its sibling folder at the same depth. -->
0 ? '!rounded-none' : '', + 'group/row w-full inline-flex items-center gap-4 px-4 py-3', + unruled + ? 'rounded-md' + : 'first-of-type:!border-t-0 first-of-type:rounded-t-md last-of-type:rounded-b-md [*:not(:last-child)]:border-b border-b last:border-b-0', + depth > 0 && !unruled ? '!rounded-none' : '', disabled ? 'opacity-25' : 'hover:bg-surface-hover', clickToSelect || inSelectionMode ? 'cursor-pointer select-none' : '', selected || rowSelection?.selected @@ -261,7 +266,10 @@
{/if} -
+
{@render actions?.()}
@@ -290,14 +298,15 @@ {/if} {#if canFavorite && (kind == 'app' || kind == 'raw_app' || kind == 'script' || kind == 'flow' || kind == 'agent')} + row's hover or keyboard focus only, so a list of titles doesn't read as a column of + outlines. Opacity, not visibility: a hidden button drops out of the Tab order. -->