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}
-
-{/if}
+
+
+
diff --git a/frontend/src/lib/components/common/table/ScriptRow.svelte b/frontend/src/lib/components/common/table/ScriptRow.svelte
index 14940131ad..d2f9e50530 100644
--- a/frontend/src/lib/components/common/table/ScriptRow.svelte
+++ b/frontend/src/lib/components/common/table/ScriptRow.svelte
@@ -50,7 +50,6 @@
import WacExportDrawer from '$lib/components/scripts/WacExportDrawer.svelte'
import { Drawer, DrawerContent } from '..'
import NoMainFuncBadge from '$lib/components/NoMainFuncBadge.svelte'
- import InheritedLabels from '$lib/components/InheritedLabels.svelte'
import RowLabels from './RowLabels.svelte'
import AskAiRowButton from './AskAiRowButton.svelte'
import Popover from '$lib/components/Popover.svelte'
@@ -209,8 +208,7 @@
>
{/if}
-
-
+ (KEY) ?? false
+}
+
+/** The divider an ordinary list row draws, or none in an unruled list. */
+export function rowRule(unruled: boolean): string {
+ return unruled ? 'rounded-md' : 'border-b'
+}
+
+/** Row actions in an unruled list: shown for the row hovered, tabbed into, keyboard-selected,
+ * or with one of its menus open. Opacity rather than visibility, so Tab still reaches them;
+ * focus counts only when visible, since 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. Needs `group/row`
+ * on the row. */
+export const HOVER_ACTIONS_CLASS =
+ 'opacity-0 transition-opacity duration-100 group-hover/row:opacity-100 group-has-[:focus-visible]/row:opacity-100 group-data-[row-keyboard-selected=true]/row:opacity-100 has-[[aria-expanded=true]]:opacity-100'
diff --git a/frontend/src/lib/components/copilot/chat/AIChatDisplay.svelte b/frontend/src/lib/components/copilot/chat/AIChatDisplay.svelte
index 7161b06370..9f1c1d610e 100644
--- a/frontend/src/lib/components/copilot/chat/AIChatDisplay.svelte
+++ b/frontend/src/lib/components/copilot/chat/AIChatDisplay.svelte
@@ -72,7 +72,7 @@
import ComposerSuggestions from './starter/ComposerSuggestions.svelte'
import type { DraftAttachments } from './messageDraft.svelte'
import type { ChatStarter } from './starter/starterPrompts.svelte'
- import { composerCollapses, isComposerOverlay } from './starter/composerCollapse'
+ import { isComposerOverlay } from './starter/composerCollapse'
import { smoothHeight } from './starter/smoothHeight'
const MAX_YOLO_TOOLTIP_TOOLS = 8
@@ -315,8 +315,7 @@
/** 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) {
- void aiChatInput?.addContextToSelection(element)
- await aiChatInput?.insertMention(element.title)
+ await mentionWorkspaceItem(element)
aiChatInput?.focusInput()
}
@@ -557,7 +556,7 @@
function mentionWorkspaceItem(element: ContextElement) {
void aiChatInput?.addContextToSelection(element)
- aiChatInput?.insertMention(element.title)
+ return aiChatInput?.insertMention(element.title)
}
function onFolderInputChange(e: Event) {
@@ -598,20 +597,22 @@
// 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.
const composerCollapsed = $derived(
- composerCollapses({
- onHome: starterLayout && starter?.where === 'home',
- usable: !disabled,
- fewItems: starter?.fewItems ?? false,
- opened: composerOpened,
- draftEmpty: aiChatInput?.isDraftEmpty() ?? true
- })
+ homeComposer &&
+ !disabled &&
+ !(starter?.where === 'home' && starter.fewItems) &&
+ !composerOpened &&
+ (aiChatInput?.isDraftEmpty() ?? true)
)
function closeComposer() {
if (aiChatInput?.isDraftEmpty() ?? true) composerOpened = false
}
function onComposerPointerDown(e: PointerEvent) {
- if (!composerOpened || composerEl?.contains(e.target as Node)) return
+ if (!homeComposer || !composerOpened || composerEl?.contains(e.target as Node)) return
if (!isComposerOverlay(e.target)) closeComposer()
}
@@ -980,12 +981,12 @@ the panel, or the Escape-to-stop focus check would wrongly reject them. -->
class="relative {columnClass} pb-2"
style:view-transition-name={viewTransitionNames ? 'composer' : undefined}
onfocusin={(e) => {
- if (e.target instanceof HTMLTextAreaElement) composerOpened = true
+ if (homeComposer && 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 (!composerOpened || starter?.where !== 'home') return
+ if (!homeComposer || !composerOpened) return
closeComposer()
if (aiChatInput?.isDraftEmpty() ?? true) (document.activeElement as HTMLElement)?.blur()
}}
@@ -1053,7 +1054,7 @@ the panel, or the Escape-to-stop focus check would wrongly reject them. -->
isFirstMessage={messages.length === 0}
hero={starterLayout}
collapsed={composerCollapsed}
- chatIcon={starterLayout && starter?.where === 'home'}
+ chatIcon={homeComposer}
{onSent}
>
{#snippet collapsedControls()}
@@ -1096,14 +1097,12 @@ the panel, or the Escape-to-stop focus check would wrongly reject them. -->
{availableContext}
{selectedContext}
onSelect={(element) => {
- void aiChatInput?.addContextToSelection(element)
- aiChatInput?.insertMention(element.title)
+ void mentionWorkspaceItem(element)
close()
aiChatInput?.focusInput()
}}
onSelectWorkspaceItem={(element) => {
- void aiChatInput?.addContextToSelection(element)
- aiChatInput?.insertMention(element.title)
+ void mentionWorkspaceItem(element)
close()
aiChatInput?.focusInput()
}}
@@ -1304,8 +1303,13 @@ the panel, or the Escape-to-stop focus check would wrongly reject them. -->
{/if}
{#if footerMessageShown}
-
+ row stays once the box opens downward. Shown on hover; the container starts at the
+ composer's edge so the pointer reaches the unpin button without leaving the hovered
+ zone. Below `sm` there is no side padding to hold it, so unpinning is in the band's
+ menu instead. -->
+ under the view controls as a whole, and on a phone the search takes a row of its
+ own above the kind filter and New. -->
+
@@ -1983,7 +1989,7 @@
{/if}
{#if !contentActive && !workspaceEmpty}
+ Not pulled out like the rows: its underline spans the controls' width. -->
tab, (v) => setTab(v as HomeTab)}>
{#each homeTabs as t (t.value)}
@@ -2016,7 +2022,7 @@
{/if}
+ lines up with the controls above and the fill runs into the page's gutter. -->
diff --git a/frontend/src/lib/components/home/TreeViewRoot.svelte b/frontend/src/lib/components/home/TreeViewRoot.svelte
index e37ef9ae50..793667ce5b 100644
--- a/frontend/src/lib/components/home/TreeViewRoot.svelte
+++ b/frontend/src/lib/components/home/TreeViewRoot.svelte
@@ -5,6 +5,7 @@
import { Button } from '$lib/components/common'
import { Users } from 'lucide-svelte'
import TreeOwnerRow from './TreeOwnerRow.svelte'
+ import { inUnruledList, rowRule } from '../common/table/unruledList'
import { getLocalSetting, pluralize, storeLocalSetting } from '$lib/utils'
interface Props {
@@ -41,7 +42,7 @@
onExpandOwner?: (owner: string, more?: boolean, opts?: { all?: boolean }) => void
onCollapseOwner?: (owner: string) => void
showEditButton?: boolean
- /** Off where the tree sits in a card of its host's, which already draws the frame. */
+ /** Off where the tree is part of its host's list rather than a box of its own (Home). */
framed?: boolean
// Tuck every user space but `selfUsername`'s into one collapsible "Other users" row
// under it. Only for browsing: a search or filter must not hide its matches behind
@@ -74,6 +75,8 @@
leaf
}: Props = $props()
+ const unruled = inUnruledList()
+
// How many root nodes render at once. A root node is a collapsed owner row that
// fetches nothing until expanded, so a large slice costs a row each and no request
// — and an owner sliced off the end is indistinguishable from one that doesn't
@@ -284,12 +287,7 @@
-
-