Skip to content

armgit / macro

Public Imported from GitHub
0

Macro is a unified workspace for teams: email, chat, docs, tasks, agents, calls, and CRM — @-linked together with shared AI memory.

style(app-views): animate open/close of app view sidebar, make styles and width consistent (#6555)

Seamus2e8733eb88ed
diff --git a/apps/web/src/components/app/Layout.tsx b/apps/web/src/components/app/Layout.tsx
index f05076ec65..18aec4dfeb 100644
--- a/apps/web/src/components/app/Layout.tsx
+++ b/apps/web/src/components/app/Layout.tsx
@@ -517,13 +517,7 @@ function LayoutInner(props: RouteSectionProps) {
/>
}
>
- <SidebarRail
- sidebarState={sidebarState()}
- onOpenChange={(open) =>
- // The rail has no slim mode, so `cmd+.` hides it outright.
- setSidebarState(open ? 'expanded' : 'hidden')
- }
- />
+ <SidebarRail />
</Show>
</Show>
<Show when={sidebarCollapsed()}>
diff --git a/apps/web/src/components/app/PreviewPanel.tsx b/apps/web/src/components/app/PreviewPanel.tsx
index 23ded26e42..1a517389fe 100644
--- a/apps/web/src/components/app/PreviewPanel.tsx
+++ b/apps/web/src/components/app/PreviewPanel.tsx
@@ -33,7 +33,7 @@ import {
} from 'solid-js';
import { Dynamic } from 'solid-js/web';
import { match, P } from 'ts-pattern';
-import { ViewSidebarToggle } from '../view-shell/ViewShell';
+import { ViewNavigationControls } from '../view-shell/ViewShell';
import {
createPriorityCollapseController,
PriorityCollapseOverflowSensor,
@@ -291,7 +291,7 @@ function PreviewPanelContent(
ref={headerCollapseController.setRow}
class="relative flex h-12 w-full shrink-0 items-center justify-between border-b border-edge-muted px-2 not-touch:pl-[13px]"
>
- <ViewSidebarToggle action="expand" />
+ <ViewNavigationControls />
<Show when={props.headerLeading}>
<div class="flex shrink-0 items-center">{props.headerLeading}</div>
</Show>
diff --git a/apps/web/src/components/app/sidebar-next/sidebar-rail.tsx b/apps/web/src/components/app/sidebar-next/sidebar-rail.tsx
index 6cd5a2c005..3e4ba2ee85 100644
--- a/apps/web/src/components/app/sidebar-next/sidebar-rail.tsx
+++ b/apps/web/src/components/app/sidebar-next/sidebar-rail.tsx
@@ -1,10 +1,6 @@
import { useAnalytics } from '@app/lib/analytics/analytics-context';
import { globalSplitManager } from '@app/signal/splitLayout';
-import {
- navigateToSidebarView,
- registerSidebarHotkeys,
- type SidebarState,
-} from '@components/app/app-sidebar/sidebar';
+import { navigateToSidebarView } from '@components/app/app-sidebar/sidebar';
import { useSplitLayout } from '@components/app/split-layout/layout';
import { hotkeyScopeNeutralAttribute } from '@core/dom-selectors';
import { useActiveCallsQuery } from '@queries/call/call';
@@ -17,23 +13,18 @@ import { useSidebarUnread } from './queries/use-sidebar-unread';
import { SearchRailButton } from './search-bar-button';
import { useNavItemGates } from './use-nav-item-gates';
-export type SidebarRailProps = {
- sidebarState?: SidebarState;
- onOpenChange: (open: boolean) => void;
-};
-
/**
* The rebuilt app sidebar, behind `enable-new-app-views`: a single always-narrow
* column of 36px icon buttons, labels in tooltips.
*
- * Always narrow by design — there is no slim mode and no hover-peek overlay, so
- * `cmd+.` hides the rail outright rather than collapsing it. The `g`-prefixed
+ * Always narrow by design — there is no slim mode or hover-peek overlay.
+ * `cmd+.` toggles navigation in the active workspace. The `g`-prefixed
* nav shortcuts are unaffected: `GoToHotkeys` is mounted from `Layout` and does
* not depend on which sidebar renders. There is no room for the leader-key
* hints the old sidebar paints on its rows, so each button's tooltip carries
* its shortcut instead.
*/
-export const SidebarRail = (props: SidebarRailProps) => {
+export const SidebarRail = () => {
const gates = useNavItemGates();
const analytics = useAnalytics();
const layout = useSplitLayout();
@@ -43,15 +34,6 @@ export const SidebarRail = (props: SidebarRailProps) => {
const hasActiveCall = () =>
!activeCallsQuery.isPending && (activeCallsQuery.data?.length ?? 0) > 0;
- const isExpanded = () => (props.sidebarState ?? 'expanded') === 'expanded';
-
- // `cmd+.` lives on the rendered sidebar, so the rail has to register it too
- // or the shortcut goes dead whenever this replaces `AppSidebar`.
- registerSidebarHotkeys({
- isSlim: () => !isExpanded(),
- onOpenChange: props.onOpenChange,
- });
-
const _openHome = (event: MouseEvent) => {
if (event.button !== 0) return;
event.preventDefault();
diff --git a/apps/web/src/components/app/split-layout/components/SplitHeader.tsx b/apps/web/src/components/app/split-layout/components/SplitHeader.tsx
index e8d04ebd50..fb0f5a24f7 100644
--- a/apps/web/src/components/app/split-layout/components/SplitHeader.tsx
+++ b/apps/web/src/components/app/split-layout/components/SplitHeader.tsx
@@ -209,13 +209,13 @@ function SplitCloseButton() {
<Show when={shouldShowSplitCloseButton(layout.manager, context.handle)}>
<Button
square
- size="sm"
+ size="icon-sm"
class="rounded-lg"
label={label()}
hotkey={TOKENS.split.close}
onClick={context.handle.close}
>
- <CloseIcon />
+ <CloseIcon class="size-4" />
</Button>
</Show>
);
diff --git a/apps/web/src/components/app/split-panel/SplitPanel.tsx b/apps/web/src/components/app/split-panel/SplitPanel.tsx
index ec3d0bd3c3..c127cda6a6 100644
--- a/apps/web/src/components/app/split-panel/SplitPanel.tsx
+++ b/apps/web/src/components/app/split-panel/SplitPanel.tsx
@@ -239,7 +239,8 @@ function ForwardButton(props: SplitControlButtonProps) {
}
function CloseButton(props: SplitControlButtonProps) {
- const controller = useSplitPanelController();
+ // Shared workspace headers also render outside a split (for example previews).
+ const controller = useContext(SplitPanelControllerContext);
const [local, rest] = splitProps(props, [
'aria-label',
'children',
@@ -255,21 +256,22 @@ function CloseButton(props: SplitControlButtonProps) {
const label = () => local.label ?? 'Close';
return (
- <Show when={controller.canClose()}>
+ <Show when={controller?.canClose()}>
<Button
{...rest}
type={local.type ?? 'button'}
variant={local.variant}
- size={local.size ?? 'sm'}
+ size={local.size ?? 'icon-sm'}
square={local.square ?? true}
class={cn('rounded-lg transition-none', local.class)}
aria-label={local['aria-label']}
label={label()}
hotkey={local.hotkey ?? TOKENS.split.close}
disabled={Boolean(local.disabled)}
- {...pressHandlers(() => controller.close())}
+ data-split-panel-close=""
+ {...pressHandlers(() => controller?.close())}
>
- {local.children ?? <CloseIcon />}
+ {local.children ?? <CloseIcon class="size-4" />}
</Button>
</Show>
);
diff --git a/apps/web/src/components/view-shell/CollapseTransition.tsx b/apps/web/src/components/view-shell/CollapseTransition.tsx
new file mode 100644
index 0000000000..f8b2ad9465
--- /dev/null
+++ b/apps/web/src/components/view-shell/CollapseTransition.tsx
@@ -0,0 +1,147 @@
+import { createResizeObserver } from '@solid-primitives/resize-observer';
+import { children, type JSX, onCleanup, onMount, Show } from 'solid-js';
+import { Transition } from 'solid-transition-group';
+
+const COLLAPSE_DURATION = 140;
+
+/** Animate a disclosure body, or its containing section when flex owns its size. */
+export function CollapseTransition(props: {
+ open: boolean;
+ container?: () => HTMLElement | undefined;
+ axis?: 'height' | 'width';
+ collapsedSize?: number;
+ children: JSX.Element;
+}) {
+ const content = children(() => (
+ <Show when={props.open}>{props.children}</Show>
+ ));
+ const contentElement = () => {
+ const element = content();
+ return element instanceof HTMLElement ? element : undefined;
+ };
+ const container = () => props.container?.() ?? contentElement();
+ const axis = () => props.axis ?? 'height';
+ const dimensionProperties = () =>
+ axis() === 'height'
+ ? ({
+ min: 'minHeight',
+ max: 'maxHeight',
+ start: 'paddingTop',
+ end: 'paddingBottom',
+ } as const)
+ : ({
+ min: 'minWidth',
+ max: 'maxWidth',
+ start: 'paddingLeft',
+ end: 'paddingRight',
+ } as const);
+ const sizeOf = (element: HTMLElement) =>
+ element.getBoundingClientRect()[axis()];
+ let measuredSize: number | undefined;
+ let running:
+ | { target: HTMLElement; content: HTMLElement; finish: () => void }
+ | undefined;
+
+ createResizeObserver(container, (_rect, element) => {
+ if (!running) measuredSize = sizeOf(element);
+ });
+ onMount(() => {
+ const element = container();
+ if (element) measuredSize = sizeOf(element);
+ });
+ onCleanup(() => running?.finish());
+
+ function animate(element: Element, opening: boolean, done: () => void) {
+ if (!(element instanceof HTMLElement)) return done();
+
+ const target = props.container?.() ?? element;
+ const collapsedSize = props.collapsedSize ?? 0;
+ const fromOpacity = running
+ ? getComputedStyle(running.content).opacity
+ : opening
+ ? '0'
+ : '1';
+ const from = running
+ ? sizeOf(running.target)
+ : opening
+ ? collapsedSize
+ : (measuredSize ?? sizeOf(target));
+ running?.finish();
+ const to = opening ? sizeOf(target) : collapsedSize;
+ const style = getComputedStyle(target);
+ const {
+ min,
+ max,
+ start: paddingStart,
+ end: paddingEnd,
+ } = dimensionProperties();
+ const startPadding = style[paddingStart];
+ const endPadding = style[paddingEnd];
+
+ element.inert = !opening;
+ if (
+ typeof target.animate !== 'function' ||
+ window.matchMedia('(prefers-reduced-motion: reduce)').matches
+ ) {
+ done();
+ return;
+ }
+
+ // Freeze flex allocation only while size is animated; restore natural sizing
+ // afterward so async rows, scrolling, and viewport resizes remain unrestricted.
+ const sizing = {
+ flexGrow: '0',
+ flexShrink: '0',
+ flexBasis: 'auto',
+ [min]: '0',
+ [max]: 'none',
+ boxSizing: 'border-box',
+ overflow: 'clip',
+ };
+ const options: KeyframeAnimationOptions = {
+ duration: COLLAPSE_DURATION,
+ easing: 'ease-out',
+ fill: 'both',
+ };
+ const size = target.animate(
+ [
+ {
+ ...sizing,
+ [axis()]: `${from}px`,
+ [paddingStart]: opening ? '0' : startPadding,
+ [paddingEnd]: opening ? '0' : endPadding,
+ },
+ {
+ ...sizing,
+ [axis()]: `${to}px`,
+ [paddingStart]: opening ? startPadding : '0',
+ [paddingEnd]: opening ? endPadding : '0',
+ },
+ ],
+ options
+ );
+ const opacity = element.animate(
+ [{ opacity: fromOpacity }, { opacity: opening ? 1 : 0 }],
+ options
+ );
+ const finish = () => {
+ if (running?.finish !== finish) return;
+ running = undefined;
+ measuredSize = to;
+ done();
+ size.cancel();
+ opacity.cancel();
+ };
+ running = { target, content: element, finish };
+ size.onfinish = finish;
+ }
+
+ return (
+ <Transition
+ onEnter={(element, done) => animate(element, true, done)}
+ onExit={(element, done) => animate(element, false, done)}
+ >
+ {content()}
+ </Transition>
+ );
+}
diff --git a/apps/web/src/components/view-shell/CollapsibleSection.tsx b/apps/web/src/components/view-shell/CollapsibleSection.tsx
index 1d30ec5744..3eb0ceb171 100644
--- a/apps/web/src/components/view-shell/CollapsibleSection.tsx
+++ b/apps/web/src/components/view-shell/CollapsibleSection.tsx
@@ -1,18 +1,49 @@
-import { Collapsible } from '@kobalte/core/collapsible';
+import { Collapsible, useCollapsibleContext } from '@kobalte/core/collapsible';
import CaretDownIcon from '@phosphor/caret-down.svg';
import { cn } from '@ui';
-import { type ComponentProps, type JSX, Show, splitProps } from 'solid-js';
+import {
+ type ComponentProps,
+ type JSX,
+ Show,
+ Suspense,
+ splitProps,
+} from 'solid-js';
+import { CollapseTransition } from './CollapseTransition';
+import { ViewSidebar } from './ViewSidebar';
export type CollapsibleSectionRootProps = Omit<
ComponentProps<typeof Collapsible>,
- 'defaultOpen' | 'onOpenChange' | 'open'
+ 'defaultOpen' | 'forceMount' | 'onOpenChange' | 'open'
> & {
open: boolean;
onOpenChange: (open: boolean) => void;
};
function Root(props: CollapsibleSectionRootProps) {
- return <Collapsible {...props} />;
+ const [local, rest] = splitProps(props, ['class']);
+ return (
+ <Collapsible
+ {...rest}
+ // Content owns presence so exit motion finishes before it unmounts.
+ forceMount
+ class={cn('group/sidebar-section min-w-0 shrink-0', local.class)}
+ />
+ );
+}
+
+function Header(props: JSX.HTMLAttributes<HTMLDivElement>) {
+ const [local, rest] = splitProps(props, ['children', 'class']);
+ return (
+ <div
+ {...rest}
+ class={cn(
+ 'flex h-(--sidebar-row-height) min-w-0 shrink-0 items-center gap-1 pr-(--sidebar-action-inset)',
+ local.class
+ )}
+ >
+ {local.children}
+ </div>
+ );
}
function Trigger(props: ComponentProps<typeof Collapsible.Trigger>) {
@@ -21,7 +52,7 @@ function Trigger(props: ComponentProps<typeof Collapsible.Trigger>) {
<Collapsible.Trigger
{...rest}
class={cn(
- 'group flex h-9 w-full min-w-0 items-center gap-1 rounded-xl px-3 py-2 text-left text-sm font-medium text-ink-extra-muted outline-none hover:text-ink-muted',
+ 'flex h-(--sidebar-row-height) w-full min-w-0 items-center gap-1 rounded-lg px-(--sidebar-item-inset) py-1 text-left text-xs leading-5 font-medium text-ink-muted outline-none transition-colors group-hover/sidebar-section:text-ink focus-visible:outline-2 focus-visible:outline-accent',
local.class
)}
>
@@ -37,14 +68,11 @@ function Indicator(props: JSX.HTMLAttributes<HTMLSpanElement>) {
{...rest}
aria-hidden="true"
class={cn(
- 'flex size-4 shrink-0 items-center justify-center text-ink-extra-muted opacity-0 transition-[opacity,transform] group-hover:opacity-100 group-focus-visible:opacity-100 group-data-closed:opacity-100 group-data-expanded:rotate-90',
+ 'flex size-4 shrink-0 items-center justify-center text-ink-extra-muted opacity-0 -rotate-90 transition-[opacity,rotate] duration-200 motion-reduce:transition-none group-hover/sidebar-section:opacity-100 group-data-closed/sidebar-section:opacity-100 group-data-expanded/sidebar-section:rotate-0',
local.class
)}
>
- <Show
- when={local.children}
- fallback={<CaretDownIcon class="size-2.5 -rotate-90" />}
- >
+ <Show when={local.children} fallback={<CaretDownIcon class="size-2.5" />}>
{local.children}
</Show>
</span>
@@ -53,18 +81,24 @@ function Indicator(props: JSX.HTMLAttributes<HTMLSpanElement>) {
function Content(props: ComponentProps<typeof Collapsible.Content>) {
const [local, rest] = splitProps(props, ['children', 'class']);
+ const context = useCollapsibleContext();
return (
- <Collapsible.Content
- {...rest}
- class={cn('min-w-0 data-closed:hidden', local.class)}
- >
- {local.children}
- </Collapsible.Content>
+ <CollapseTransition open={context.isOpen()}>
+ <Collapsible.Content
+ {...rest}
+ class={cn('min-w-0 pt-(--sidebar-section-content-gap)', local.class)}
+ >
+ {/* Content queries must not detach the section header or its neighbors. */}
+ <Suspense>{local.children}</Suspense>
+ </Collapsible.Content>
+ </CollapseTransition>
);
}
export const CollapsibleSection = Object.assign(Root, {
Root,
+ Header,
+ Action: ViewSidebar.Control,
Trigger,
Indicator,
Content,
diff --git a/apps/web/src/components/view-shell/README.md b/apps/web/src/components/view-shell/README.md
new file mode 100644
index 0000000000..d94259b6b1
--- /dev/null
+++ b/apps/web/src/components/view-shell/README.md
@@ -0,0 +1,30 @@
+# Workspace sidebar spacing
+
+The `--sidebar-*` tokens in `src/index.css` own sidebar geometry. Compose the
+slots below instead of adding per-workspace padding or button size overrides.
+
+| Measurement | Desktop default |
+| --- | --- |
+| Outer gutter / row inset | 8px / 8px |
+| Icon slot / glyph | 20px / 16px |
+| Control target | 24px (36px on touch) |
+| Row height / gap | 32px / 2px (44px row on touch) |
+| Icon-to-label gap | 6px |
+| Section gap / header-to-content gap | 24px / 4px |
+| Title bar height | 48px |
+
+Both rails sit `gutter + row inset + icon slot / 2 = 26px` from the sidebar edge.
+The control inset is derived from that center and the control's size. Never
+align trailing controls by their outer edges or offset an individual icon.
+
+- `ViewSidebar.Primary` gives create actions and toolbars the same 8px top inset.
+- `ViewSidebar.CloseButton` shows split close only in docked navigation, never
+ inside a narrow navigation overlay. Keep split-close controls out of overlays.
+- `ViewSidebar.Toolbar` aligns its final `Control` with the right rail.
+- `ViewSidebar.Content` owns outer gutters, 16px top/bottom padding, and section gaps.
+- `Item` and `Action` own row spacing; use `Icon` for leading glyphs and
+ `Trailing` for non-interactive trailing glyphs such as a create-menu chevron.
+- `CollapsibleSection.Header` and `Action` align section controls on the same rail.
+- `TreeItem` and `Branch` own disclosure positioning and the nested rail.
+- Use `--sidebar-action-inset` for a trailing control beside a separate selectable
+ row, as in Email's inbox list. Do not repeat numeric offsets in the workspace.
diff --git a/apps/web/src/components/view-shell/SidebarCreateButton.tsx b/apps/web/src/components/view-shell/SidebarCreateButton.tsx
index 6fe2b6f2cb..9942473625 100644
--- a/apps/web/src/components/view-shell/SidebarCreateButton.tsx
+++ b/apps/web/src/components/view-shell/SidebarCreateButton.tsx
@@ -1,4 +1,3 @@
-import { SplitPanel } from '@components/app/split-panel';
import { isTouchDevice } from '@core/mobile/isTouchDevice';
import PlusIcon from '@phosphor/plus.svg';
import { pressHandlers } from '@ui';
@@ -17,16 +16,16 @@ export function SidebarCreateHeader(props: {
<Show when={!isTouchDevice()}>
<ViewSidebar.Header>
<div class="flex min-w-0 items-center gap-1">
- <SplitPanel.CloseButton class="shrink-0" />
+ <ViewSidebar.CloseButton class="shrink-0" />
<ViewSidebar.Title>{props.title}</ViewSidebar.Title>
{props.titleActions}
</div>
{props.actions}
</ViewSidebar.Header>
</Show>
- <div class="min-w-0 px-1.5 pt-4 touch:pt-[calc(var(--safe-top,0px)+1rem)]">
+ <ViewSidebar.Primary>
<SidebarCreateButton label={props.label} onCreate={props.onCreate} />
- </div>
+ </ViewSidebar.Primary>
</header>
);
}
@@ -36,21 +35,16 @@ export function SidebarCreateButton(props: {
onCreate: () => void;
}) {
return (
- <button
- type="button"
- class="flex h-9 w-full shrink-0 items-center gap-2 rounded-xl bg-hover px-2.5 text-left text-sm font-medium text-ink-muted hover:bg-active hover:text-ink focus-visible:outline-2 focus-visible:outline-accent touch:h-11"
+ <ViewSidebar.Action
{...pressHandlers((event) => {
event.preventDefault();
props.onCreate();
})}
>
- <span
- aria-hidden="true"
- class="flex size-5 shrink-0 items-center justify-center"
- >
+ <ViewSidebar.Icon>
<PlusIcon class="size-4" />
- </span>
+ </ViewSidebar.Icon>
<span class="truncate">{props.label}</span>
- </button>
+ </ViewSidebar.Action>
);
}
diff --git a/apps/web/src/components/view-shell/ViewShell.test.tsx b/apps/web/src/components/view-shell/ViewShell.test.tsx
index e25a232714..ff3e16142a 100644
--- a/apps/web/src/components/view-shell/ViewShell.test.tsx
+++ b/apps/web/src/components/view-shell/ViewShell.test.tsx
@@ -12,7 +12,10 @@ import { ViewSidebar } from './ViewSidebar';
const measurement = vi.hoisted(() => ({ width: (): number => 1200 }));
+vi.mock('@core/hotkey/hotkeys', () => ({ registerHotkey: vi.fn() }));
+
vi.mock('@solid-primitives/resize-observer', () => ({
+ createResizeObserver: () => {},
createElementSize: () => ({
get width() {
return measurement.width();
diff --git a/apps/web/src/components/view-shell/ViewShell.tsx b/apps/web/src/components/view-shell/ViewShell.tsx
index 1baeb4343e..c4639775b3 100644
--- a/apps/web/src/components/view-shell/ViewShell.tsx
+++ b/apps/web/src/components/view-shell/ViewShell.tsx
@@ -4,7 +4,11 @@ import {
type BreakpointThresholds,
createSizeBreakpoints,
} from '@app/util/create-size-breakpoints';
+import { SplitPanelContext } from '@components/app/split-layout/context';
+import { SplitPanel } from '@components/app/split-panel';
import { Resize } from '@core/component/Resize';
+import { registerHotkey } from '@core/hotkey/hotkeys';
+import { TOKENS } from '@core/hotkey/tokens';
import ListIcon from '@phosphor/list.svg';
import SidebarIcon from '@phosphor/sidebar-simple.svg';
import { createElementSize } from '@solid-primitives/resize-observer';
@@ -12,6 +16,7 @@ import { Button, cn } from '@ui';
import {
type Accessor,
batch,
+ type ComponentProps,
createContext,
createSignal,
createUniqueId,
@@ -22,6 +27,8 @@ import {
splitProps,
useContext,
} from 'solid-js';
+import { CollapseTransition } from './CollapseTransition';
+import { createSidebarMotion } from './create-sidebar-motion';
import {
type AsideLayout,
type AsideMode,
@@ -50,6 +57,7 @@ export type ViewShellLayout = {
isOverlay: Accessor<boolean>;
collapse: () => void;
expand: () => void;
+ toggle: () => void;
};
main: {
layout: Accessor<MainLayout>;
@@ -64,7 +72,10 @@ export type ViewShellLayout = {
};
};
-type ViewShellInternal = ViewShellLayout & { id: string };
+type ViewShellInternal = ViewShellLayout & {
+ id: string;
+ atLayoutBreakpoint: Accessor<boolean>;
+};
const RESIZE_GUTTER = 1;
@@ -153,6 +164,7 @@ function Root(props: ViewShellRootProps) {
const [narrowAsideOpen, setNarrowAsideOpen] = createSignal(false);
const id = createUniqueId();
const [root, setRoot] = createSignal<HTMLDivElement>();
+ const animateSidebar = createSidebarMotion(root);
const size = createElementSize(root);
const thresholds = (): BreakpointThresholds =>
@@ -240,6 +252,7 @@ function Root(props: ViewShellRootProps) {
id,
width,
breakpoints,
+ atLayoutBreakpoint,
aside: {
layout: asideLayout,
mode: asideMode,
@@ -248,12 +261,24 @@ function Root(props: ViewShellRootProps) {
local.asidePreferenceKey !== undefined && local.aside !== false,
isOverlay: asideOverlay,
collapse: () => {
- setAsideCollapsed(true);
- setNarrowAsideOpen(false);
+ animateSidebar(() =>
+ batch(() => {
+ setAsideCollapsed(true);
+ setNarrowAsideOpen(false);
+ })
+ );
},
expand: () => {
- setAsideCollapsed(false);
- setNarrowAsideOpen(true);
+ animateSidebar(() =>
+ batch(() => {
+ setAsideCollapsed(false);
+ setNarrowAsideOpen(true);
+ })
+ );
+ },
+ toggle: () => {
+ if (value.aside.isCollapsed()) value.aside.expand();
+ else value.aside.collapse();
},
},
main: {
@@ -275,6 +300,22 @@ function Root(props: ViewShellRootProps) {
},
};
+ const panel = useContext(SplitPanelContext);
+ if (panel) {
+ registerHotkey({
+ hotkey: 'cmd+.',
+ hotkeyToken: TOKENS.workspace.toggleNavigation,
+ scopeId: panel.splitHotkeyScope,
+ description: 'Toggle workspace navigation',
+ condition: () => panel.isPanelActive() && value.aside.canCollapse(),
+ runWithInputFocused: true,
+ keyDownHandler: () => {
+ value.aside.toggle();
+ return true;
+ },
+ });
+ }
+
return (
<ViewShellContext.Provider value={value}>
<div
@@ -376,9 +417,15 @@ function Aside(props: ViewShellAsideProps) {
return Math.min(width, Math.max(layout.min, availableForAside));
};
+ let overlayAside: HTMLDivElement | undefined;
+ const overlayWidth = () =>
+ Math.min(preferredWidth(), ws.width() ?? preferredWidth());
+
+ // Layout owns the host: closing an overlay must not mount a second sidebar
+ // while its exit animation is still retaining the first one.
return (
<Show
- when={ws.aside.isOverlay()}
+ when={ws.atLayoutBreakpoint()}
fallback={
<Resize.Panel
id={`${ws.id}-aside`}
@@ -394,39 +441,63 @@ function Aside(props: ViewShellAsideProps) {
{...rest}
class={cn('size-full min-h-0 min-w-0', local.class)}
data-view-shell-aside=""
+ inert={ws.aside.isCollapsed()}
+ aria-hidden={ws.aside.isCollapsed()}
>
{local.children}
</div>
</Resize.Panel>
}
>
- <div
- class="absolute inset-0 z-20"
- onKeyDown={(event) => {
- if (event.key === 'Escape') {
- event.stopPropagation();
- ws.aside.collapse();
- }
- }}
+ <CollapseTransition
+ open={ws.aside.isOverlay()}
+ axis="width"
+ container={() => overlayAside}
>
- <button
- type="button"
- aria-label="Close navigation backdrop"
- class="absolute inset-0 bg-modal-overlay"
- onClick={ws.aside.collapse}
- />
<div
- {...rest}
- class={cn(
- 'relative h-full max-w-full bg-panel shadow-menu',
- local.class
- )}
- style={{ width: `${preferredWidth()}px` }}
- data-view-shell-aside=""
+ class="absolute inset-0 z-20"
+ onKeyDown={(event) => {
+ if (event.key === 'Escape') {
+ event.stopPropagation();
+ ws.aside.collapse();
+ }
+ }}
>
- {local.children}
+ <button
+ type="button"
+ aria-label="Close navigation backdrop"
+ class="absolute inset-0 bg-modal-overlay"
+ onClick={ws.aside.collapse}
+ />
+ <div
+ {...rest}
+ class={cn(
+ 'relative h-full max-w-full bg-panel shadow-menu',
+ local.class
+ )}
+ ref={overlayAside}
+ style={{ width: `${overlayWidth()}px` }}
+ data-view-shell-aside=""
+ >
+ {/* Keep text at its resting width while the outer frame reveals it. */}
+ <div class="h-full" style={{ width: `${overlayWidth()}px` }}>
+ {local.children}
+ </div>
+ </div>
</div>
- </div>
+ </CollapseTransition>
+ </Show>
+ );
+}
+
+/** A navigation overlay must not offer an action that closes its owning split. */
+export function ViewSidebarCloseButton(
+ props: ComponentProps<typeof SplitPanel.CloseButton>
+) {
+ const ws = useContext(ViewShellContext);
+ return (
+ <Show when={!ws?.atLayoutBreakpoint()}>
+ <SplitPanel.CloseButton {...props} />
</Show>
);
}
@@ -437,7 +508,7 @@ export function ViewSidebarToggle(props: { action: 'collapse' | 'expand' }) {
const visible = () =>
ws?.aside.canCollapse() &&
(props.action === 'expand'
- ? ws.aside.isCollapsed()
+ ? ws.aside.isCollapsed() || ws.aside.isOverlay()
: !ws.aside.isCollapsed());
return (
<Show when={visible()}>
@@ -446,11 +517,15 @@ export function ViewSidebarToggle(props: { action: 'collapse' | 'expand' }) {
size="icon-sm"
class={cn(
'shrink-0 touch:hidden',
- props.action === 'collapse' && 'ml-auto'
+ props.action === 'collapse' && 'ml-auto',
+ props.action === 'collapse' &&
+ ws?.aside.isOverlay() &&
+ 'motion-safe:animate-[dialog-overlay-open_60ms_ease-out_80ms_both]'
)}
label={
props.action === 'expand' ? 'Show navigation' : 'Hide navigation'
}
+ hotkey={TOKENS.workspace.toggleNavigation}
aria-expanded={props.action !== 'expand'}
data-view-sidebar-toggle={props.action}
onClick={(event) => {
@@ -478,6 +553,22 @@ export function ViewSidebarToggle(props: { action: 'collapse' | 'expand' }) {
);
}
+/** Shared leading controls, kept in place beneath navigation overlays. */
+export function ViewNavigationControls() {
+ const ws = useContext(ViewShellContext);
+ return (
+ <Show when={ws?.aside.isCollapsed() || ws?.aside.isOverlay()}>
+ <SplitPanel.ControlGroup
+ inert={ws?.aside.isOverlay()}
+ aria-hidden={ws?.aside.isOverlay()}
+ >
+ <SplitPanel.CloseButton />
+ <ViewSidebarToggle action="expand" />
+ </SplitPanel.ControlGroup>
+ </Show>
+ );
+}
+
function Main(props: JSX.HTMLAttributes<HTMLElement>) {
const [local, rest] = splitProps(props, ['children', 'class']);
const ws = useViewShellInternal();
@@ -515,12 +606,12 @@ function TopBar(props: JSX.HTMLAttributes<HTMLDivElement>) {
<div
{...rest}
class={cn(
- 'flex h-12 min-w-0 shrink-0 items-center gap-1 border-b border-edge-muted px-4 py-3 touch:hidden',
+ 'flex h-12 min-w-0 shrink-0 items-center gap-1 border-b border-edge-muted px-2 py-3 not-touch:pl-[13px] touch:hidden',
local.class
)}
data-view-shell-top-bar=""
>
- <ViewSidebarToggle action="expand" />
+ <ViewNavigationControls />
{local.children}
</div>
);
diff --git a/apps/web/src/components/view-shell/ViewSidebar.tsx b/apps/web/src/components/view-shell/ViewSidebar.tsx
index ac2f34a641..e261260315 100644
--- a/apps/web/src/components/view-shell/ViewSidebar.tsx
+++ b/apps/web/src/components/view-shell/ViewSidebar.tsx
@@ -1,14 +1,20 @@
-import { cn, NavRow, type NavRowProps } from '@ui';
+import CaretDownIcon from '@phosphor/caret-down.svg';
+import { Button, type ButtonProps, cn } from '@ui';
import type { JSX } from 'solid-js';
-import { splitProps } from 'solid-js';
-import { ViewSidebarToggle } from './ViewShell';
+import { Show, splitProps } from 'solid-js';
+import { Dynamic } from 'solid-js/web';
+import { CollapseTransition } from './CollapseTransition';
+import { ViewSidebarCloseButton, ViewSidebarToggle } from './ViewShell';
function Root(props: JSX.HTMLAttributes<HTMLElement>) {
const [local, rest] = splitProps(props, ['children', 'class']);
return (
<aside
{...rest}
- class={cn('flex size-full min-h-0 min-w-0 flex-col', local.class)}
+ class={cn(
+ 'flex size-full min-h-0 min-w-0 flex-col bg-panel',
+ local.class
+ )}
data-view-sidebar=""
>
{local.children}
@@ -22,7 +28,7 @@ function Header(props: JSX.HTMLAttributes<HTMLDivElement>) {
<div
{...rest}
class={cn(
- 'flex h-12 min-w-0 shrink-0 items-center justify-between gap-3 border-b border-edge-muted px-4 py-3',
+ 'flex h-12 min-w-0 shrink-0 items-center justify-between gap-3 border-b border-edge-muted py-3 pl-(--sidebar-content-inset) pr-(--sidebar-header-action-inset) [&_[data-split-panel-close]]:ml-(--sidebar-control-overhang)',
local.class
)}
data-view-sidebar-header=""
@@ -37,14 +43,59 @@ function Title(props: JSX.HTMLAttributes<HTMLHeadingElement>) {
const [local, rest] = splitProps(props, ['children', 'class']);
return (
<h1
+ {...rest}
+ class={cn('min-w-0 truncate text-sm font-semibold text-ink', local.class)}
+ >
+ {local.children}
+ </h1>
+ );
+}
+
+/** The shared inset between the title bar and a create action or toolbar. */
+function Primary(props: JSX.HTMLAttributes<HTMLDivElement>) {
+ const [local, rest] = splitProps(props, ['children', 'class']);
+ return (
+ <div
{...rest}
class={cn(
- 'min-w-0 truncate text-sm font-semibold tracking-[-0.03em] text-ink',
+ 'min-w-0 px-(--sidebar-gutter) pt-(--sidebar-gutter) touch:pt-[calc(var(--safe-top,0px)+var(--sidebar-gutter))]',
local.class
)}
>
{local.children}
- </h1>
+ </div>
+ );
+}
+
+/** A row of controls whose last button sits on the right icon rail. */
+function Toolbar(props: JSX.HTMLAttributes<HTMLDivElement>) {
+ const [local, rest] = splitProps(props, ['children', 'class']);
+ return (
+ <div
+ {...rest}
+ class={cn(
+ 'flex h-(--sidebar-row-height) min-w-0 items-center justify-between gap-2 pl-(--sidebar-item-inset) pr-(--sidebar-action-inset)',
+ local.class
+ )}
+ >
+ {local.children}
+ </div>
+ );
+}
+
+function Control(props: ButtonProps) {
+ const [local, rest] = splitProps(props, ['class']);
+ return (
+ <Button
+ variant="ghost"
+ size="icon-sm"
+ {...rest}
+ class={cn(
+ 'size-(--sidebar-control-size) shrink-0 rounded-lg',
+ local.class
+ )}
+ data-view-sidebar-control=""
+ />
);
}
@@ -54,7 +105,7 @@ function Content(props: JSX.HTMLAttributes<HTMLDivElement>) {
<div
{...rest}
class={cn(
- 'min-h-0 min-w-0 flex-1 overflow-auto px-1.5 pb-5',
+ 'flex min-h-0 min-w-0 flex-1 flex-col gap-(--sidebar-section-gap) overflow-auto px-(--sidebar-gutter) py-(--sidebar-content-inset)',
local.class
)}
data-view-sidebar-content=""
@@ -67,14 +118,26 @@ function Content(props: JSX.HTMLAttributes<HTMLDivElement>) {
function Nav(props: JSX.HTMLAttributes<HTMLElement>) {
const [local, rest] = splitProps(props, ['children', 'class']);
return (
- <nav {...rest} class={cn('flex min-w-0 flex-col gap-1', local.class)}>
+ <nav
+ {...rest}
+ class={cn(
+ 'flex min-w-0 shrink-0 flex-col gap-(--sidebar-row-gap)',
+ local.class
+ )}
+ >
{local.children}
</nav>
);
}
-function Item(props: NavRowProps) {
+function Item(
+ props: JSX.ButtonHTMLAttributes<HTMLButtonElement> & {
+ active?: boolean;
+ as?: 'div';
+ }
+) {
const [local, rest] = splitProps(props, [
+ 'as',
'active',
'aria-current',
'class',
@@ -86,14 +149,17 @@ function Item(props: NavRowProps) {
return undefined;
};
return (
- <NavRow
+ <Dynamic
+ component={local.as ?? 'button'}
{...rest}
type={local.type ?? 'button'}
- active={local.active}
aria-current={ariaCurrent()}
class={cn(
- 'h-8 gap-2 rounded-xl border-0 px-2.5 py-0 text-sm font-normal transition-none touch:h-11',
- !local.active && 'text-ink-muted',
+ 'flex h-(--sidebar-row-height) w-full min-w-0 shrink-0 items-center justify-start gap-(--sidebar-label-gap) rounded-lg border-0 px-(--sidebar-item-inset) py-0 text-left text-sm leading-5 font-normal transition-none touch:h-11',
+ 'outline-none focus-visible:outline-2 focus-visible:outline-accent disabled:opacity-50',
+ local.active
+ ? 'bg-active text-ink'
+ : 'text-ink-muted not-disabled:hover:bg-hover not-disabled:hover:text-ink',
local.class
)}
/>
@@ -106,8 +172,9 @@ function Icon(props: JSX.HTMLAttributes<HTMLSpanElement>) {
<span
{...rest}
aria-hidden="true"
+ data-view-sidebar-icon=""
class={cn(
- 'flex size-5 shrink-0 items-center justify-center',
+ 'flex size-(--sidebar-icon-slot) shrink-0 items-center justify-center [&>svg]:size-(--sidebar-icon-size)',
local.class
)}
>
@@ -116,12 +183,131 @@ function Icon(props: JSX.HTMLAttributes<HTMLSpanElement>) {
);
}
+/** Non-interactive trailing glyphs use the same rail as trailing buttons. */
+function Trailing(props: JSX.HTMLAttributes<HTMLSpanElement>) {
+ const [local, rest] = splitProps(props, ['children', 'class']);
+ return (
+ <span
+ {...rest}
+ aria-hidden="true"
+ class={cn(
+ 'ml-auto flex size-(--sidebar-icon-slot) shrink-0 items-center justify-center',
+ local.class
+ )}
+ data-view-sidebar-trailing=""
+ >
+ {local.children}
+ </span>
+ );
+}
+
+/** A tree destination with a separate disclosure action in the trailing lane. */
+function TreeItem(props: {
+ active?: boolean;
+ expanded?: boolean;
+ label: string;
+ onToggle: () => void;
+ onClick: () => void;
+ children: JSX.Element;
+}) {
+ return (
+ <div class="relative min-w-0">
+ <Item
+ active={props.active}
+ title={props.label}
+ onClick={props.onClick}
+ class="pr-9"
+ >
+ {props.children}
+ </Item>
+ <Show when={props.expanded !== undefined}>
+ <span class="absolute right-(--sidebar-action-inset) top-1/2 flex -translate-y-1/2">
+ <Control
+ label={`${props.expanded ? 'Collapse' : 'Expand'} ${props.label}`}
+ aria-expanded={props.expanded}
+ onClick={props.onToggle}
+ >
+ <CaretDownIcon
+ class={cn(
+ 'size-3 transition-transform -rotate-90',
+ props.expanded && 'rotate-0'
+ )}
+ />
+ </Control>
+ </span>
+ </Show>
+ </div>
+ );
+}
+
+/** Indent children one icon slot, with the rail centered under the parent icon. */
+function Branch(
+ props: JSX.HTMLAttributes<HTMLDivElement> & { open?: boolean }
+) {
+ const [local, rest] = splitProps(props, ['children', 'class', 'open']);
+ return (
+ <CollapseTransition open={local.open ?? true}>
+ <div
+ {...rest}
+ class={cn(
+ 'relative min-w-0 pl-(--sidebar-icon-slot) before:pointer-events-none before:absolute before:inset-y-0 before:left-(--sidebar-local-rail) before:w-px before:-translate-x-1/2 before:bg-edge-muted',
+ local.class
+ )}
+ data-view-sidebar-branch=""
+ >
+ {local.children}
+ </div>
+ </CollapseTransition>
+ );
+}
+
+/** Shared create surface, also usable as a menu trigger. */
+function Action(props: JSX.ButtonHTMLAttributes<HTMLButtonElement>) {
+ const [local, rest] = splitProps(props, ['children', 'class']);
+ return (
+ <button
+ type="button"
+ {...rest}
+ class={cn(
+ 'flex h-(--sidebar-row-height) w-full min-w-0 shrink-0 items-center gap-(--sidebar-label-gap) rounded-lg bg-hover px-(--sidebar-item-inset) text-left text-sm leading-5 font-medium text-ink hover:bg-active focus-visible:outline-2 focus-visible:outline-accent touch:h-11',
+ local.class
+ )}
+ >
+ {local.children}
+ </button>
+ );
+}
+
+function Footer(props: JSX.HTMLAttributes<HTMLDivElement>) {
+ const [local, rest] = splitProps(props, ['children', 'class']);
+ return (
+ <div
+ {...rest}
+ class={cn(
+ 'shrink-0 border-t border-edge-muted px-(--sidebar-gutter) py-3',
+ local.class
+ )}
+ >
+ {local.children}
+ </div>
+ );
+}
+
export const ViewSidebar = Object.assign(Root, {
Root,
Header,
+ CloseButton: ViewSidebarCloseButton,
Title,
+ Primary,
+ Toolbar,
+ Control,
Content,
Nav,
Item,
Icon,
+ Trailing,
+ TreeItem,
+ Branch,
+ Action,
+ Footer,
});
diff --git a/apps/web/src/components/view-shell/create-sidebar-motion.ts b/apps/web/src/components/view-shell/create-sidebar-motion.ts
new file mode 100644
index 0000000000..686f53c220
--- /dev/null
+++ b/apps/web/src/components/view-shell/create-sidebar-motion.ts
@@ -0,0 +1,97 @@
+import { type Accessor, onCleanup } from 'solid-js';
+
+const SIDEBAR_MOTION_DURATION = 140;
+
+/** Animate the solver's settled layout without changing its resize preferences. */
+export function createSidebarMotion(root: Accessor<HTMLElement | undefined>) {
+ const running = new Set<() => void>();
+ let revision = 0;
+ const cancel = () => {
+ for (const finish of running) finish();
+ };
+ onCleanup(() => {
+ revision++;
+ cancel();
+ });
+
+ return (update: () => void) => {
+ const shell = root();
+ const currentRevision = ++revision;
+ const panels = shell?.querySelectorAll<HTMLElement>(
+ ':scope > [data-resize-zone] > [data-resize-panel]'
+ );
+ const before = new Map(
+ Array.from(panels ?? [], (panel) => {
+ const style = getComputedStyle(panel);
+ return [
+ panel,
+ {
+ width: panel.getBoundingClientRect().width,
+ left: style.left,
+ opacity: style.display === 'none' ? '0' : style.opacity,
+ },
+ ] as const;
+ })
+ );
+ cancel();
+ update();
+ if (
+ !shell ||
+ typeof shell.animate !== 'function' ||
+ window.matchMedia('(prefers-reduced-motion: reduce)').matches
+ ) {
+ return;
+ }
+
+ // Solid settles the solver's registrations before measuring the destination.
+ queueMicrotask(() => {
+ if (revision !== currentRevision || !shell.isConnected) return;
+ for (const [panel, from] of before) {
+ if (!panel.isConnected) continue;
+ const aside = panel.querySelector<HTMLElement>(
+ '[data-view-shell-aside]'
+ );
+ const hidden = getComputedStyle(panel).display === 'none';
+ const width = hidden ? 0 : Number.parseFloat(panel.style.width);
+ const left = panel.style.left;
+ if (from.width === width && from.left === left) continue;
+
+ const previousOverflow = panel.style.overflow;
+ const previousDisplay = panel.style.display;
+ const previousAsideWidth = aside?.style.width;
+ if (aside) {
+ // Keep labels and icons at their resting width while their frame closes.
+ aside.style.width = `${Math.max(from.width, width)}px`;
+ panel.style.overflow = 'clip';
+ panel.style.display = 'block';
+ }
+ const animation = panel.animate(
+ [
+ {
+ width: `${from.width}px`,
+ left: from.left,
+ opacity: aside ? from.opacity : 1,
+ },
+ { width: `${width}px`, left, opacity: aside && hidden ? 0 : 1 },
+ ],
+ {
+ duration: SIDEBAR_MOTION_DURATION,
+ easing: 'ease-out',
+ fill: 'both',
+ }
+ );
+ const finish = () => {
+ if (!running.delete(finish)) return;
+ animation.cancel();
+ if (aside) {
+ aside.style.width = previousAsideWidth ?? '';
+ panel.style.overflow = previousOverflow;
+ panel.style.display = previousDisplay;
+ }
+ };
+ running.add(finish);
+ animation.onfinish = finish;
+ }
+ });
+ };
+}
diff --git a/apps/web/src/components/view-shell/view-shell-layout.ts b/apps/web/src/components/view-shell/view-shell-layout.ts
index b3638e6fa3..b54b7b0044 100644
--- a/apps/web/src/components/view-shell/view-shell-layout.ts
+++ b/apps/web/src/components/view-shell/view-shell-layout.ts
@@ -16,6 +16,7 @@ export type AsideLayout = {
preserveDuringResize?: boolean;
};
+/** Shared starting size for every workspace navigation sidebar. */
export const DEFAULT_ASIDE_LAYOUT: AsideLayout = {
width: 256,
min: 224,
diff --git a/apps/web/src/features/agents-view/agents-view.css b/apps/web/src/features/agents-view/agents-view.css
index 6fbc5de91f..493d782b37 100644
--- a/apps/web/src/features/agents-view/agents-view.css
+++ b/apps/web/src/features/agents-view/agents-view.css
@@ -114,13 +114,6 @@
}
/* ---------- ViewSidebar ---------- */
- :where(.agents-view, .agents-view-portal) .aside {
- display: flex;
- flex-direction: column;
- min-height: 0;
- border-right: var(--hair) solid var(--edge-muted);
- }
-
:where(.agents-view, .agents-view-portal) .ctl {
display: inline-flex;
gap: 2px;
@@ -154,128 +147,10 @@
color: var(--ink-placeholder);
}
- :where(.agents-view, .agents-view-portal) .aside .content {
- display: flex;
- flex-direction: column;
- gap: 24px;
- padding: 16px 6px 20px;
- min-height: 0;
- flex: 1;
- overflow: hidden;
- }
-
- :where(.agents-view, .agents-view-portal) .sec-head {
- height: 28px;
- display: flex;
- align-items: center;
- justify-content: space-between;
- padding: 0 4px 0 12px;
- font-size: 12px;
- font-weight: 500;
- color: var(--ink-subtle);
- }
-
- :where(.agents-view, .agents-view-portal) .sec-head h2 {
- margin: 0;
- font: inherit;
- }
-
- :where(.agents-view, .agents-view-portal) .recent {
- display: flex;
- flex-direction: column;
- gap: 4px;
- min-height: 0;
- flex: 1;
- }
-
- :where(.agents-view, .agents-view-portal) .recent .list {
- overflow: auto;
- min-height: 0;
- flex: 1;
- display: flex;
- flex-direction: column;
- gap: 2px;
- scrollbar-width: thin;
- scrollbar-color: var(--surface-4) transparent;
- -webkit-mask-image: linear-gradient(#000 calc(100% - 24px), transparent);
- mask-image: linear-gradient(#000 calc(100% - 24px), transparent);
- }
-
- :where(.agents-view, .agents-view-portal) .search {
- height: 36px;
- display: flex;
- align-items: center;
- gap: 8px;
- padding: 0 10px;
- border-radius: 12px;
- background: var(--surface-0);
- border: var(--hair) solid var(--edge-muted);
- color: var(--ink-placeholder);
- flex-shrink: 0;
- }
-
- :where(.agents-view, .agents-view-portal) .search input {
- flex: 1;
- min-width: 0;
- background: transparent;
- border: 0;
- outline: none;
- color: var(--ink);
- font: 14px var(--font-sans);
- }
-
- :where(.agents-view, .agents-view-portal) .search input::placeholder {
- color: var(--ink-placeholder);
- }
-
- /* recent chat rows: left = PR state or status, title truncates, right = lines changed */
- :where(.agents-view, .agents-view-portal) .row {
- min-height: 32px;
- display: grid;
- grid-template-columns: 20px minmax(0, 1fr) auto;
- column-gap: 8px;
- align-items: center;
- padding: 6px 10px;
- border-radius: 12px;
- font-size: 14px;
- color: var(--ink-muted);
- width: 100%;
- text-align: left;
- flex-shrink: 0;
- }
-
- :where(.agents-view, .agents-view-portal) .row:hover {
- background: var(--hover);
- color: var(--ink);
- }
-
- :where(.agents-view, .agents-view-portal) .row.active {
- background: var(--active);
- color: var(--ink);
- }
-
- :where(.agents-view, .agents-view-portal) .row .lead {
- width: 20px;
- height: 16px;
- display: grid;
- place-items: center;
- position: relative;
- }
-
:where(.agents-view, .agents-view-portal) .open {
color: var(--green);
}
- /* Needs attention nests inside Active in Code mode */
- :where(.agents-view, .agents-view-portal) .row .lead .spin {
- width: 11px;
- height: 11px;
- border-radius: 50%;
- border: 1.5px solid var(--surface-4);
- border-top-color: var(--ink-subtle);
- animation: spin 0.9s linear infinite;
- }
-
/* Work mode: a stepped, square "cog" rather than a smooth ring */
:where(.agents-view, .agents-view-portal)[data-mode="work"] .spin {
border-radius: 2px;
@@ -285,17 +160,6 @@
animation: spin 1.2s steps(8) infinite;
}
- :where(.agents-view, .agents-view-portal) .row .when {
- color: var(--ink-placeholder);
- font-size: 12px;
- font-variant-numeric: tabular-nums;
- white-space: nowrap;
- }
-
- :where(.agents-view, .agents-view-portal) .row .sub {
- display: none;
- }
-
@keyframes pulse {
0%,
100% {
@@ -307,51 +171,6 @@
}
}
- :where(.agents-view, .agents-view-portal) .row[data-kind="code"] {
- padding: 6px 12px;
- row-gap: 1px;
- }
-
- :where(.agents-view, .agents-view-portal) .row[data-kind="code"] .lead {
- grid-row: 1 / 3;
- align-self: start;
- margin-top: 3px;
- }
-
- :where(.agents-view, .agents-view-portal) .row[data-kind="code"] .sub {
- display: flex;
- gap: 6px;
- align-items: center;
- grid-column: 2 / 4;
- color: var(--ink-placeholder);
- font-size: 12px;
- white-space: nowrap;
- overflow: hidden;
- }
-
- :where(.agents-view, .agents-view-portal) .row[data-kind="code"] .sub .when {
- font-size: 11px;
- }
-
- :where(.agents-view, .agents-view-portal) .row[data-kind="code"] .sub .h {
- color: var(--ink-disabled);
- }
-
- :where(.agents-view, .agents-view-portal) .group-h {
- padding: 10px 12px 4px;
- font-size: 11px;
- font-weight: 500;
- color: var(--ink-placeholder);
- display: flex;
- align-items: center;
- gap: 6px;
- }
-
- :where(.agents-view, .agents-view-portal) .group-h .n {
- color: var(--ink-disabled);
- font-variant-numeric: tabular-nums;
- }
-
:where(.agents-view, .agents-view-portal) .stdot.waiting::after {
display: none;
}
@@ -395,28 +214,6 @@
overflow: hidden;
}
- :where(.agents-view, .agents-view-portal) .topbar {
- height: 48px;
- flex-shrink: 0;
- display: flex;
- align-items: center;
- justify-content: space-between;
- gap: 12px;
- padding: 0 24px;
- }
-
- :where(.agents-view, .agents-view-portal) .topbar h1 {
- flex: 1;
- min-width: 0;
- }
-
- :where(.agents-view, .agents-view-portal) .topbar h1 {
- margin: 0;
- font-size: 14px;
- font-weight: 600;
- letter-spacing: -0.03em;
- }
-
:where(.agents-view, .agents-view-portal) .seg {
display: inline-flex;
padding: 2px;
@@ -475,28 +272,11 @@
min-width: 0;
}
- :where(.agents-view, .agents-view-portal) .aside > .seg.side {
- margin: 16px 6px 0;
- width: auto;
- flex-shrink: 0;
- }
-
:where(.agents-view, .agents-view-portal) .seg.side button .ph {
width: 14px;
height: 14px;
}
- :where(.agents-view, .agents-view-portal) .aside .content {
- gap: 20px;
- padding-top: 14px;
- }
-
- :where(.agents-view, .agents-view-portal) .topbar .right {
- display: flex;
- align-items: center;
- gap: 8px;
- }
-
:where(.agents-view, .agents-view-portal) .body {
flex: 1;
min-height: 0;
@@ -1163,13 +943,6 @@
}
/* ---------- sidebar: per-mode new button, routines view ---------- */
- :where(.agents-view, .agents-view-portal) .top-actions {
- display: flex;
- flex-direction: column;
- gap: 8px;
- flex-shrink: 0;
- }
-
/* ---------- slash menu: skills from the composer ---------- */
:where(.agents-view, .agents-view-portal) .composer-anchor {
display: block;
@@ -2365,10 +2138,6 @@
border-radius: inherit;
}
- :where(.agents-view, .agents-view-portal) .aside .content[hidden] {
- display: none;
- }
-
:where(.agents-view, .agents-view-portal) .list-note {
margin: 0;
padding: 8px 12px;
@@ -2385,7 +2154,6 @@
}
/* The view shell sizes the columns; each fills its slot. */
- :where(.agents-view, .agents-view-portal) .aside,
:where(.agents-view, .agents-view-portal) .main {
height: 100%;
}
diff --git a/apps/web/src/features/agents-view/components/AgentsSidebar.test.tsx b/apps/web/src/features/agents-view/components/AgentsSidebar.test.tsx
index 69c8adc672..ee1a4b672f 100644
--- a/apps/web/src/features/agents-view/components/AgentsSidebar.test.tsx
+++ b/apps/web/src/features/agents-view/components/AgentsSidebar.test.tsx
@@ -1,5 +1,4 @@
import { fireEvent, render, screen } from '@solidjs/testing-library';
-import type { JSX } from 'solid-js';
import { describe, expect, it, vi } from 'vitest';
import {
type AgentConversationEntity,
@@ -7,12 +6,12 @@ import {
} from '../core/recent-conversations';
import { AgentsSidebar } from './AgentsSidebar';
-vi.mock('@app/components/view-shell', () => ({
+vi.mock('@app/components/view-shell', async (importOriginal) => ({
+ ...(await importOriginal<typeof import('@app/components/view-shell')>()),
useViewControlHotkeys: vi.fn(),
- ViewSidebar: {
- Header: (props: { children: JSX.Element }) => <div>{props.children}</div>,
- Title: (props: { children: JSX.Element }) => <h1>{props.children}</h1>,
- },
+}));
+vi.mock('@solid-primitives/resize-observer', () => ({
+ createResizeObserver: () => {},
}));
vi.mock('@components/app/split-layout/layoutUtils', () => ({
useSplitPanelOrThrow: () => ({
diff --git a/apps/web/src/features/agents-view/components/AgentsSidebar.tsx b/apps/web/src/features/agents-view/components/AgentsSidebar.tsx
index 4d8e7b22d5..fde57daa92 100644
--- a/apps/web/src/features/agents-view/components/AgentsSidebar.tsx
+++ b/apps/web/src/features/agents-view/components/AgentsSidebar.tsx
@@ -1,12 +1,18 @@
-import { useViewControlHotkeys, ViewSidebar } from '@app/components/view-shell';
+import {
+ CollapsibleSection,
+ SearchBar,
+ useViewControlHotkeys,
+ ViewSidebar,
+} from '@app/components/view-shell';
import { SidebarCreateButton } from '@app/components/view-shell/SidebarCreateButton';
import { useSplitPanelOrThrow } from '@components/app/split-layout/layoutUtils';
-import { SplitPanel } from '@components/app/split-panel';
import ChatIcon from '@phosphor/chat-circle.svg';
import CodeIcon from '@phosphor/code.svg';
import MagnifyingGlassIcon from '@phosphor/magnifying-glass.svg';
+import SpinnerIcon from '@phosphor/spinner.svg';
import { Key } from '@solid-primitives/keyed';
-import { createSignal, For, Show } from 'solid-js';
+import { cn } from '@ui';
+import { createSignal, Show } from 'solid-js';
import {
conversationState,
conversationStateLabel,
@@ -60,60 +66,61 @@ function Row(props: {
};
return (
- <button
- type="button"
- class={props.active ? 'row active' : 'row'}
+ <ViewSidebar.Item
+ active={props.active}
+ class={cn(props.mode === 'code' && 'h-12 items-start py-1.5 touch:h-12')}
title={title()}
data-kind={props.mode}
- aria-current={props.active ? 'page' : undefined}
onClick={props.onOpen}
>
- <span class="lead">
+ <ViewSidebar.Icon>
<Show
when={state() === 'starting'}
fallback={
- <Show
- when={props.mode === 'code'}
- fallback={<ChatIcon class="ph" />}
- >
- <CodeIcon class="ph" />
+ <Show when={props.mode === 'code'} fallback={<ChatIcon />}>
+ <CodeIcon />
</Show>
}
>
- <span class="spin" />
+ <SpinnerIcon class="motion-safe:animate-spin" />
</Show>
- </span>
- <span class="truncate">{title()}</span>
- <Show
- when={props.mode === 'code'}
- fallback={<span class="when">{age()}</span>}
- >
- <span />
- <span class="sub">
- <Show when={props.handle}>
- {(handle) => <span class="h">@{handle()}</span>}
- </Show>
- <Show when={props.handle && stateLabel()}>
- <span>·</span>
- </Show>
- <Show when={stateLabel()}>{(label) => <span>{label()}</span>}</Show>
- <span class="when" style={{ 'margin-left': 'auto' }}>
- {age()}
+ </ViewSidebar.Icon>
+ <span class="min-w-0 flex-1">
+ <span class="block truncate">{title()}</span>
+ <Show when={props.mode === 'code'}>
+ <span class="flex min-w-0 items-center gap-1.5 text-xs leading-4 text-ink-extra-muted">
+ <Show when={props.handle}>
+ {(handle) => <span class="truncate">@{handle()}</span>}
+ </Show>
+ <Show when={props.handle && stateLabel()}>
+ <span>·</span>
+ </Show>
+ <Show when={stateLabel()}>
+ {(label) => <span class="shrink-0">{label()}</span>}
+ </Show>
+ <span class="ml-auto shrink-0 tabular-nums">{age()}</span>
</span>
+ </Show>
+ </span>
+ <Show when={props.mode !== 'code'}>
+ <span class="shrink-0 text-xs text-ink-extra-muted tabular-nums">
+ {age()}
</span>
</Show>
- </button>
+ </ViewSidebar.Item>
);
}
export function AgentsSidebar(props: AgentsSidebarProps) {
const panel = useSplitPanelOrThrow();
const [searchOpen, setSearchOpen] = createSignal(false);
+ const [conversationsOpen, setConversationsOpen] = createSignal(true);
let searchInput: HTMLInputElement | undefined;
const total = () =>
props.groups.reduce((sum, group) => sum + group.conversations.length, 0);
const openSearch = () => {
+ setConversationsOpen(true);
setSearchOpen(true);
queueMicrotask(() => searchInput?.focus());
};
@@ -135,119 +142,134 @@ export function AgentsSidebar(props: AgentsSidebarProps) {
});
return (
- <aside class="aside" aria-label="Agents navigation">
+ <ViewSidebar.Root aria-label="Agents navigation">
<ViewSidebar.Header>
<div class="flex min-w-0 items-center gap-1">
- <SplitPanel.CloseButton />
+ <ViewSidebar.CloseButton />
<ViewSidebar.Title>Agents</ViewSidebar.Title>
</div>
</ViewSidebar.Header>
- <div class="content" data-view="agents">
- <div class="top-actions">
- <SidebarCreateButton
- label="New conversation"
- onCreate={props.onNewConversation}
- />
- </div>
+ <ViewSidebar.Primary>
+ <SidebarCreateButton
+ label="New conversation"
+ onCreate={props.onNewConversation}
+ />
+ </ViewSidebar.Primary>
- <section class="recent">
- <div class="sec-head">
- <h2>Conversations</h2>
- <button
- type="button"
- class="icon-btn"
+ <ViewSidebar.Content class="overflow-hidden">
+ <CollapsibleSection.Root
+ open={conversationsOpen()}
+ onOpenChange={setConversationsOpen}
+ class={cn(
+ 'flex min-h-0 flex-col',
+ conversationsOpen() ? 'flex-1' : 'shrink-0'
+ )}
+ >
+ <CollapsibleSection.Header>
+ <CollapsibleSection.Trigger class="flex-1">
+ <span class="min-w-0 truncate">Conversations</span>
+ <CollapsibleSection.Indicator />
+ </CollapsibleSection.Trigger>
+ <CollapsibleSection.Action
+ label="Search conversations"
aria-pressed={searchOpen()}
- aria-label="Search conversations"
+ class={cn(searchOpen() && 'bg-active text-ink')}
onClick={() => (searchOpen() ? closeSearch() : openSearch())}
>
- <MagnifyingGlassIcon class="ph" />
- </button>
- </div>
- <Show when={searchOpen()}>
- <div class="search">
- <MagnifyingGlassIcon class="ph" />
- <input
+ <MagnifyingGlassIcon class="size-3.5" />
+ </CollapsibleSection.Action>
+ </CollapsibleSection.Header>
+ <CollapsibleSection.Content class="flex min-h-0 flex-1 flex-col gap-1">
+ <Show when={searchOpen()}>
+ <SearchBar
ref={searchInput}
placeholder="Search conversations"
- aria-label="Search conversations"
+ label="Search conversations"
value={props.search}
- onInput={(event) =>
- props.onSearchChange(event.currentTarget.value)
- }
- onKeyDown={(event) => {
- if (event.key === 'Escape' && !props.search) closeSearch();
+ onValueChange={props.onSearchChange}
+ onEscape={() => {
+ if (!props.search) closeSearch();
}}
+ class="h-9 shrink-0 rounded-xl"
/>
- </div>
- </Show>
- <nav
- class="list"
- aria-label="Recent conversations"
- onScroll={(event) => {
- const list = event.currentTarget;
- if (!props.hasNextPage || props.loadingNextPage) return;
- if (
- list.scrollTop + list.clientHeight >=
- list.scrollHeight - 200
- ) {
- props.onLoadMore();
- }
- }}
- >
- <For each={props.groups}>
- {(group) => (
- <>
- <Show when={group.label}>
- {(label) => (
- <div class="group-h">
- {label()}
- <span class="n">{group.conversations.length}</span>
- </div>
- )}
- </Show>
- <Key each={group.conversations} by="id">
- {(conversation) => (
- <Row
- conversation={conversation()}
- mode={props.modeForConversation(conversation())}
- active={
- props.activeConversationId === conversation().id
- }
- handle={props.handleForBot(
- conversationBotId(conversation())
- )}
- onOpen={(event) =>
- props.onOpenConversation(conversation(), event)
- }
- />
- )}
- </Key>
- </>
- )}
- </For>
- <Show when={props.loading}>
- <p class="list-note">Loading conversations…</p>
- </Show>
- <Show when={props.error}>
- <button type="button" class="row" onClick={props.onRetry}>
- <span class="lead" />
- <span class="truncate">Retry loading</span>
- </button>
</Show>
- <Show when={!props.loading && !props.error && total() === 0}>
- <p class="list-note">
- {props.search.trim()
- ? `No results for "${props.search.trim()}"`
- : 'No conversations yet.'}
- </p>
- </Show>
- <Show when={props.loadingNextPage}>
- <p class="list-note">Loading more…</p>
- </Show>
- </nav>
- </section>
- </div>
- </aside>
+ <ViewSidebar.Nav
+ class="min-h-0 flex-1 shrink overflow-auto"
+ aria-label="Recent conversations"
+ onScroll={(event) => {
+ const list = event.currentTarget;
+ if (!props.hasNextPage || props.loadingNextPage) return;
+ if (
+ list.scrollTop + list.clientHeight >=
+ list.scrollHeight - 200
+ ) {
+ props.onLoadMore();
+ }
+ }}
+ >
+ <Key each={props.groups} by="id">
+ {(group) => (
+ <>
+ <Show when={group().label}>
+ {(label) => (
+ <ViewSidebar.Toolbar>
+ <h3 class="text-xs font-medium text-ink-muted">
+ {label()}
+ </h3>
+ <span class="text-xs text-ink-extra-muted tabular-nums">
+ {group().conversations.length}
+ </span>
+ </ViewSidebar.Toolbar>
+ )}
+ </Show>
+ <Key each={group().conversations} by="id">
+ {(conversation) => (
+ <Row
+ conversation={conversation()}
+ mode={props.modeForConversation(conversation())}
+ active={
+ props.activeConversationId === conversation().id
+ }
+ handle={props.handleForBot(
+ conversationBotId(conversation())
+ )}
+ onOpen={(event) =>
+ props.onOpenConversation(conversation(), event)
+ }
+ />
+ )}
+ </Key>
+ </>
+ )}
+ </Key>
+ <Show when={props.loading}>
+ <p class="px-(--sidebar-item-inset) py-2 text-xs text-ink-muted">
+ Loading conversations…
+ </p>
+ </Show>
+ <Show when={props.error}>
+ <ViewSidebar.Item onClick={props.onRetry}>
+ <ViewSidebar.Icon />
+ <span class="truncate">Retry loading</span>
+ </ViewSidebar.Item>
+ </Show>
+ <Show when={!props.loading && !props.error && total() === 0}>
+ <p class="px-(--sidebar-item-inset) py-2 text-xs text-ink-muted">
+ {props.search.trim()
+ ? `No results for "${props.search.trim()}"`
+ : 'No conversations yet.'}
+ </p>
+ </Show>
+ <Show when={props.loadingNextPage}>
+ <p class="px-(--sidebar-item-inset) py-2 text-xs text-ink-muted">
+ Loading more…
+ </p>
+ </Show>
+ </ViewSidebar.Nav>
+ </CollapsibleSection.Content>
+ </CollapsibleSection.Root>
+ </ViewSidebar.Content>
+ </ViewSidebar.Root>
);
}
diff --git a/apps/web/src/features/agents-view/components/Topbar.tsx b/apps/web/src/features/agents-view/components/Topbar.tsx
index a1d5b49a88..20dc897093 100644
--- a/apps/web/src/features/agents-view/components/Topbar.tsx
+++ b/apps/web/src/features/agents-view/components/Topbar.tsx
@@ -1,4 +1,4 @@
-import { ViewSidebarToggle } from '@app/components/view-shell/ViewShell';
+import { ViewShell } from '@app/components/view-shell/ViewShell';
import CopyIcon from '@phosphor/copy.svg';
import DotsIcon from '@phosphor/dots-three.svg';
import PencilIcon from '@phosphor/pencil-simple.svg';
@@ -31,10 +31,11 @@ export function Topbar(props: {
children?: JSX.Element;
}) {
return (
- <div class="topbar">
- <ViewSidebarToggle action="expand" />
- <h1 class="truncate">{props.title}</h1>
- <div class="right">
+ <ViewShell.TopBar class="touch:flex">
+ <h1 class="min-w-0 flex-1 truncate text-sm font-semibold text-ink">
+ {props.title}
+ </h1>
+ <div class="flex shrink-0 items-center gap-2">
{props.children}
<div class="bbar" role="toolbar" aria-label="Session actions">
<button
@@ -159,6 +160,6 @@ export function Topbar(props: {
</MenuAnchor>
</div>
</div>
- </div>
+ </ViewShell.TopBar>
);
}
diff --git a/apps/web/src/features/agents-view/views/AgentsView.tsx b/apps/web/src/features/agents-view/views/AgentsView.tsx
index 8a068b358a..33c596e9dc 100644
--- a/apps/web/src/features/agents-view/views/AgentsView.tsx
+++ b/apps/web/src/features/agents-view/views/AgentsView.tsx
@@ -293,9 +293,9 @@ function AgentsWorkspace(props: { initialRoute?: AgentsRoute }) {
>
<ViewShell.Root
asidePreferenceKey="agents"
+ class="bg-panel"
resizable
aside={{
- width: 280,
min: 224,
max: 380,
preserveDuringResize: false,
diff --git a/apps/web/src/features/channels-view/components/rail/ChannelRailItems.tsx b/apps/web/src/features/channels-view/components/rail/ChannelRailItems.tsx
index 4f9103fd74..e8e3e5effa 100644
--- a/apps/web/src/features/channels-view/components/rail/ChannelRailItems.tsx
+++ b/apps/web/src/features/channels-view/components/rail/ChannelRailItems.tsx
@@ -210,7 +210,7 @@ export function ChannelAvatar(props: {
size?: 'sm' | 'md';
}) {
const sizeClass = () =>
- props.size === 'md' ? 'size-9 [&_svg]:size-4.5' : 'size-6 [&_svg]:size-3.5';
+ props.size === 'md' ? 'size-9 [&_svg]:size-4.5' : 'size-5 [&_svg]:size-4';
return (
<Switch>
diff --git a/apps/web/src/features/channels-view/components/rail/ChannelsRailSection.tsx b/apps/web/src/features/channels-view/components/rail/ChannelsRailSection.tsx
index dd07d7f164..bad6ff880b 100644
--- a/apps/web/src/features/channels-view/components/rail/ChannelsRailSection.tsx
+++ b/apps/web/src/features/channels-view/components/rail/ChannelsRailSection.tsx
@@ -1,13 +1,29 @@
+import {
+ ViewSidebar,
+ CollapsibleSection as WorkspaceSection,
+} from '@app/components/view-shell';
+import { CollapseTransition } from '@app/components/view-shell/CollapseTransition';
import CaretDownIcon from '@phosphor/caret-down.svg';
import CaretUpIcon from '@phosphor/caret-up.svg';
import PlusIcon from '@phosphor/plus.svg';
import SidebarIcon from '@phosphor/sidebar-simple.svg';
import SpinnerIcon from '@phosphor/spinner.svg';
import { Button, cn, Scroll, Tooltip } from '@ui';
-import { createSignal, For, type JSX, Match, Show, Switch } from 'solid-js';
+import {
+ createContext,
+ createSignal,
+ For,
+ type JSX,
+ Match,
+ Show,
+ Suspense,
+ Switch,
+ useContext,
+} from 'solid-js';
import { useOffscreenActivity } from './hooks/useOffscreenActivity';
const LOADING_SKELETON_ROWS = [0, 1, 2];
+const SectionContainerContext = createContext<() => HTMLElement | undefined>();
function SectionScrollArea(props: {
contentRef: (element: HTMLDivElement) => void;
@@ -33,7 +49,7 @@ function SectionScrollArea(props: {
}}
>
<div role="group" class={props.class}>
- {props.children}
+ <Suspense>{props.children}</Suspense>
</div>
</Scroll>
<Show when={activity.direction()}>
@@ -80,19 +96,24 @@ function CollapsibleSectionRoot(props: {
class?: string;
children: JSX.Element;
}) {
+ let sectionRef: HTMLElement | undefined;
+
return (
- <section
- class={cn(
- 'flex min-h-0 flex-col gap-1',
- props.open && props.fillAvailable && 'flex-1',
- props.open && !props.fillAvailable && 'shrink',
- !props.open && 'shrink-0',
- props.open && !props.fillAvailable && 'max-h-[calc(50%_-_0.375rem)]',
- props.class
- )}
- >
- {props.children}
- </section>
+ <SectionContainerContext.Provider value={() => sectionRef}>
+ <section
+ ref={sectionRef}
+ class={cn(
+ 'group/sidebar-section flex min-h-0 flex-col gap-(--sidebar-section-content-gap)',
+ props.open && props.fillAvailable && 'flex-1',
+ props.open && !props.fillAvailable && 'shrink',
+ !props.open && 'shrink-0',
+ props.open && !props.fillAvailable && 'max-h-[calc(50%_-_0.375rem)]',
+ props.class
+ )}
+ >
+ {props.children}
+ </section>
+ </SectionContainerContext.Provider>
);
}
@@ -103,16 +124,16 @@ function CollapsibleSectionHeader(props: {
children: JSX.Element;
}) {
return (
- <div
+ <WorkspaceSection.Header
class={cn(
- 'group/section-header flex w-full items-center rounded-xl text-xs font-medium uppercase tracking-wide text-ink-extra-muted transition-colors hover:text-ink-muted',
+ 'w-full rounded-lg text-xs leading-5 font-medium text-ink-muted transition-colors group-hover/sidebar-section:text-ink',
props.focused && 'bg-hover text-ink-muted',
!props.focused && props.focusWithin && 'text-ink-muted',
props.class
)}
>
{props.children}
- </div>
+ </WorkspaceSection.Header>
);
}
@@ -126,8 +147,14 @@ function CollapsibleSectionContent(props: {
activityTooltip?: boolean;
children: JSX.Element;
}) {
+ const container = useContext(SectionContainerContext);
+
return (
- <Show when={props.open}>
+ <CollapseTransition
+ open={props.open}
+ container={container}
+ collapsedSize={32}
+ >
<SectionScrollArea
contentRef={props.contentRef}
containerClass={props.containerClass}
@@ -138,7 +165,7 @@ function CollapsibleSectionContent(props: {
>
{props.children}
</SectionScrollArea>
- </Show>
+ </CollapseTransition>
);
}
@@ -171,14 +198,15 @@ export function RailListLoadingMore(props: {
class={cn(
'flex items-center',
props.variant === 'slim' && 'h-10 justify-center',
- props.variant === 'channel' && 'h-10 gap-2 px-2',
+ props.variant === 'channel' &&
+ 'h-(--sidebar-row-height) gap-(--sidebar-label-gap) px-(--sidebar-item-inset) touch:h-11',
props.variant === 'recent' && 'h-20 items-start gap-3 px-2 py-2'
)}
>
<div
class={cn(
'skeleton-shimmer shrink-0 rounded-full bg-skeleton',
- props.variant === 'channel' && 'size-6',
+ props.variant === 'channel' && 'size-5',
props.variant !== 'channel' && 'size-8'
)}
/>
@@ -226,14 +254,9 @@ export function CreateRailAction(props: {
onClick: () => void;
}) {
return (
- <button
- type="button"
- class="flex size-7 shrink-0 items-center justify-center rounded-lg text-ink-muted transition-colors hover:bg-hover hover:text-ink focus-visible:ring-2 focus-visible:ring-accent"
- aria-label={props.label}
- onClick={props.onClick}
- >
+ <ViewSidebar.Control label={props.label} onClick={props.onClick}>
<PlusIcon class="size-3.5" />
- </button>
+ </ViewSidebar.Control>
);
}
diff --git a/apps/web/src/features/channels-view/components/rail/ExpandedChannelsRail.tsx b/apps/web/src/features/channels-view/components/rail/ExpandedChannelsRail.tsx
index 80ab0df42f..79f7f098b6 100644
--- a/apps/web/src/features/channels-view/components/rail/ExpandedChannelsRail.tsx
+++ b/apps/web/src/features/channels-view/components/rail/ExpandedChannelsRail.tsx
@@ -4,26 +4,17 @@ import { FavoriteIcon } from '@app/features/favorites/FavoriteIcon';
import { DEBUG_SETTING_KEYS, useDebugSetting } from '@app/lib/debugSettings';
import { useFavoriteDisplayName } from '@app/util/favorites';
import { openNewChannelModal } from '@channel/CreateChannelModal';
-import { SplitPanel } from '@components/app/split-panel';
import { useUserId } from '@core/context/user';
import { isTouchDevice } from '@core/mobile/isTouchDevice';
import EmptyStateNoSearchMatchGraphic from '@design/empty-state-no-search-match.svg';
import { type ChannelEntity, Entity } from '@entity';
import CaretDownIcon from '@phosphor/caret-down.svg';
import CheckIcon from '@phosphor/check.svg';
-import FunnelIcon from '@phosphor/funnel-simple.svg';
import MagnifyingGlassIcon from '@phosphor/magnifying-glass.svg';
+import SortIcon from '@phosphor/sort-ascending.svg';
import XIcon from '@phosphor/x.svg';
import type { Favorite } from '@service-storage/generated/schemas/favorite';
-import {
- Button,
- cn,
- Dropdown,
- EmptyStatePanel,
- Hotkey,
- Tabs,
- Tooltip,
-} from '@ui';
+import { cn, Dropdown, EmptyStatePanel, Hotkey, Tabs, Tooltip } from '@ui';
import {
type Accessor,
createSignal,
@@ -130,12 +121,10 @@ function ChannelSortDropdown(props: { group: ChannelsGroup; label: string }) {
return (
<Dropdown placement="bottom-end">
<Dropdown.Trigger
- variant="ghost"
- size="icon-sm"
- class="size-7 rounded-lg"
+ as={ViewSidebar.Control}
label={`Sort ${props.label.toLowerCase()}`}
>
- <FunnelIcon class="size-3.5" />
+ <SortIcon class="size-3.5" />
</Dropdown.Trigger>
<Dropdown.Content class="min-w-40">
<Dropdown.Group>
@@ -166,36 +155,29 @@ function FavoriteOption(props: { favorite: Favorite }) {
const item = useChannelRailFavoriteItemState(() => props.favorite);
return (
- <button
+ <ViewSidebar.Item
id={item().domId}
type="button"
role="treeitem"
tabIndex={-1}
class={cn(
- 'flex h-8 w-full min-w-0 items-center gap-2 rounded-xl px-2 text-left outline-none transition-colors',
- item().selected && !isTouchDevice() && 'bg-active text-ink',
- (!item().selected || isTouchDevice()) && 'text-ink-muted',
+ 'group/channel-option relative',
!item().selected &&
!isTouchDevice() &&
item().focused &&
- 'bg-hover text-ink',
- !item().selected &&
- !isTouchDevice() &&
- !item().focused &&
- 'hover:bg-hover hover:text-ink'
+ 'bg-hover text-ink'
)}
+ active={item().selected && !isTouchDevice()}
aria-current={item().selected ? 'page' : undefined}
onClick={(event) =>
rail.activateRow(rowKeyForFavorite(props.favorite), event)
}
>
- <span class="flex size-6 shrink-0 items-center justify-center">
- <FavoriteIcon favorite={props.favorite} avatarSize="md" />
- </span>
- <span class="min-w-0 flex-1 truncate text-sm font-medium">
- {displayName()}
- </span>
- </button>
+ <ViewSidebar.Icon>
+ <FavoriteIcon favorite={props.favorite} class="size-4" />
+ </ViewSidebar.Icon>
+ <span class="min-w-0 flex-1 truncate">{displayName()}</span>
+ </ViewSidebar.Item>
);
}
@@ -207,33 +189,29 @@ function ChannelOption(props: { channel: ChannelEntity }) {
return (
<ChannelRailItemContextMenu channel={props.channel} class="block w-full">
- <div
+ <ViewSidebar.Item
+ as="div"
id={item().domId}
role="treeitem"
tabIndex={-1}
class={cn(
- 'group/channel-option relative flex h-8 w-full min-w-0 items-center gap-2 rounded-xl px-2 text-left outline-none',
- item().selected && !isTouchDevice() && 'bg-active text-ink',
- (!item().selected || isTouchDevice()) && 'text-ink-muted',
+ 'group/channel-option relative',
!item().selected &&
!isTouchDevice() &&
item().focused &&
- 'bg-hover text-ink',
- !item().selected &&
- !isTouchDevice() &&
- !item().focused &&
- 'hover:bg-hover hover:text-ink'
+ 'bg-hover text-ink'
)}
+ active={item().selected && !isTouchDevice()}
aria-current={item().selected ? 'page' : undefined}
onMouseDown={(event) => {
if (!isPrimaryMouseDown(event)) return;
rail.activateRow(rowKeyForChannel(props.channel.id), event);
}}
>
- <ChannelAvatar channel={props.channel} />
- <span class="min-w-0 flex-1 truncate text-sm font-medium">
- {props.channel.name}
- </span>
+ <ViewSidebar.Icon>
+ <ChannelAvatar channel={props.channel} />
+ </ViewSidebar.Icon>
+ <span class="min-w-0 flex-1 truncate">{props.channel.name}</span>
<span class="flex shrink-0 items-center gap-2">
<ChannelMutedIndicator muted={item().muted} />
<ChannelCallIndicator
@@ -277,7 +255,7 @@ function ChannelOption(props: { channel: ChannelEntity }) {
callId={item().incomingCallId}
channelId={props.channel.id}
/>
- </div>
+ </ViewSidebar.Item>
</ChannelRailItemContextMenu>
);
}
@@ -292,7 +270,6 @@ function ExpandedFavoritesSection() {
<CollapsibleSection.Header
focused={section().focused}
focusWithin={section().containsFocus}
- class="h-9"
>
<button
id={section().domId}
@@ -310,8 +287,7 @@ function ExpandedFavoritesSection() {
<span class="min-w-0 truncate">Favorites</span>
<CaretDownIcon
class={cn(
- 'size-2.5 shrink-0 opacity-0 transition-[opacity,transform] group-hover/section-header:opacity-100 group-focus-within/section-header:opacity-100',
- section().focused && 'opacity-100',
+ 'size-2.5 shrink-0 opacity-0 transition-[opacity,rotate] duration-200 motion-reduce:transition-none group-hover/sidebar-section:opacity-100',
!section().open && '-rotate-90 opacity-100'
)}
/>
@@ -340,40 +316,37 @@ function ExpandedHeader(props: { search: ChannelRailSearch }) {
};
return (
- <div class="flex shrink-0 flex-col gap-3">
+ <div class="flex shrink-0 flex-col">
<ViewSidebar.Header>
<div class="flex min-w-0 items-center gap-1">
- <SplitPanel.CloseButton />
+ <ViewSidebar.CloseButton />
<ViewSidebar.Title>Chat</ViewSidebar.Title>
</div>
</ViewSidebar.Header>
- <div class="flex items-center justify-between gap-2 px-4">
- <Tabs
- aria-label="Chat sidebar views"
- list={CHANNEL_TABS}
- value={rail.tab()}
- onChange={selectTab}
- />
- <Button
- variant="ghost"
- size="icon-sm"
- label={
- props.search.isOpen() ? 'Close search' : 'Search conversations'
- }
- aria-pressed={props.search.isOpen()}
- class={cn(
- 'size-7 rounded-lg',
- props.search.isOpen() && 'bg-active text-ink'
- )}
- onClick={() =>
- props.search.isOpen() ? props.search.close() : props.search.open()
- }
- >
- <MagnifyingGlassIcon class="size-3.5" />
- </Button>
- </div>
+ <ViewSidebar.Primary>
+ <ViewSidebar.Toolbar>
+ <Tabs
+ aria-label="Chat sidebar views"
+ list={CHANNEL_TABS}
+ value={rail.tab()}
+ onChange={selectTab}
+ />
+ <ViewSidebar.Control
+ label={
+ props.search.isOpen() ? 'Close search' : 'Search conversations'
+ }
+ aria-pressed={props.search.isOpen()}
+ class={cn(props.search.isOpen() && 'bg-active text-ink')}
+ onClick={() =>
+ props.search.isOpen() ? props.search.close() : props.search.open()
+ }
+ >
+ <MagnifyingGlassIcon class="size-3.5" />
+ </ViewSidebar.Control>
+ </ViewSidebar.Toolbar>
+ </ViewSidebar.Primary>
<Show when={props.search.isOpen()}>
- <div class="px-4">
+ <div class="px-(--sidebar-content-inset) pt-(--sidebar-gutter)">
<SearchBar
ref={props.search.registerInput}
label="Search channels and direct messages"
@@ -424,7 +397,7 @@ function ExpandedSearchResults(props: { search: ChannelRailSearch }) {
ref={pagination.registerVirtualizer}
data={props.search.results()}
scrollRef={scrollRoot()}
- itemSize={rail.tab() === 'recents' ? CONVERSATION_CARD_HEIGHT : 42}
+ itemSize={rail.tab() === 'recents' ? CONVERSATION_CARD_HEIGHT : 34}
bufferSize={360}
keepMounted={focusedIndex() >= 0 ? [focusedIndex()] : undefined}
onScroll={pagination.loadMoreNearEnd}
@@ -504,7 +477,6 @@ function ExpandedGroupSection(props: { config: GroupConfig }) {
<CollapsibleSection.Header
focused={section().focused}
focusWithin={section().containsFocus}
- class="h-9"
>
<button
id={section().domId}
@@ -522,8 +494,7 @@ function ExpandedGroupSection(props: { config: GroupConfig }) {
<span class="min-w-0 truncate">{props.config.label}</span>
<CaretDownIcon
class={cn(
- 'size-2.5 shrink-0 opacity-0 transition-[opacity,transform] group-hover/section-header:opacity-100 group-focus-within/section-header:opacity-100',
- section().focused && 'opacity-100',
+ 'size-2.5 shrink-0 opacity-0 transition-[opacity,rotate] duration-200 motion-reduce:transition-none group-hover/sidebar-section:opacity-100',
!section().open && '-rotate-90 opacity-100'
)}
/>
@@ -533,7 +504,7 @@ function ExpandedGroupSection(props: { config: GroupConfig }) {
</span>
</Show>
</button>
- <div data-section-action="" class="flex items-center gap-0.5 pr-1">
+ <div data-section-action="" class="flex items-center gap-0.5">
<ChannelSortDropdown
group={props.config.group}
label={props.config.label}
@@ -621,12 +592,12 @@ function ExpandedBrowse() {
<ChannelsEmptyState scope="channels" topAligned />
</Match>
<Match when={true}>
- <div class="flex h-full min-h-0 flex-col gap-2 px-4">
+ <ViewSidebar.Content class="h-full overflow-hidden">
<ExpandedFavoritesSection />
<For each={GROUPS}>
{(config) => <ExpandedGroupSection config={config} />}
</For>
- </div>
+ </ViewSidebar.Content>
</Match>
</Switch>
);
diff --git a/apps/web/src/features/channels-view/components/rail/SlimChannelsRail.tsx b/apps/web/src/features/channels-view/components/rail/SlimChannelsRail.tsx
index 2e4489ddad..7c7c22e693 100644
--- a/apps/web/src/features/channels-view/components/rail/SlimChannelsRail.tsx
+++ b/apps/web/src/features/channels-view/components/rail/SlimChannelsRail.tsx
@@ -1,4 +1,5 @@
import { ViewSidebarToggle } from '@app/components/view-shell/ViewShell';
+import { ViewSidebar } from '@app/components/view-shell/ViewSidebar';
import { runCreateAction } from '@app/features/command/Launcher';
import { FavoriteIcon } from '@app/features/favorites/FavoriteIcon';
import { DEBUG_SETTING_KEYS, useDebugSetting } from '@app/lib/debugSettings';
@@ -385,7 +386,7 @@ function SlimHeader() {
<div class="flex shrink-0 flex-col items-center gap-3 pt-2">
<div class="flex w-full items-center justify-center px-2">
<SplitPanel.ControlGroup>
- <SplitPanel.CloseButton size="icon-sm" />
+ <ViewSidebar.CloseButton />
<ViewSidebarToggle action="collapse" />
</SplitPanel.ControlGroup>
</div>
diff --git a/apps/web/src/features/channels-view/constants.ts b/apps/web/src/features/channels-view/constants.ts
index 9c45a436a7..a4f1edde2a 100644
--- a/apps/web/src/features/channels-view/constants.ts
+++ b/apps/web/src/features/channels-view/constants.ts
@@ -1,7 +1,8 @@
+import { DEFAULT_ASIDE_LAYOUT } from '@app/components/view-shell/view-shell-layout';
import type { ChannelListSort, ChannelsGroup } from './types';
export const CHANNELS_NARROW_RAIL_WIDTH = 64;
-export const CHANNELS_DEFAULT_RAIL_WIDTH = 256;
+export const CHANNELS_DEFAULT_RAIL_WIDTH = DEFAULT_ASIDE_LAYOUT.width;
export const CHANNELS_MIN_RAIL_WIDTH = 224;
export const CHANNELS_MAX_RAIL_WIDTH = 420;
diff --git a/apps/web/src/features/companies/components/CrmSidebar.tsx b/apps/web/src/features/companies/components/CrmSidebar.tsx
index e17a1cec0b..850826a2a4 100644
--- a/apps/web/src/features/companies/components/CrmSidebar.tsx
+++ b/apps/web/src/features/companies/components/CrmSidebar.tsx
@@ -33,7 +33,7 @@ export function CrmSidebar(props: {
const [viewsOpen, setViewsOpen] = createSignal(true);
const [listsOpen, setListsOpen] = createSignal(true);
return (
- <ViewSidebar.Root aria-label="CRM navigation" class="gap-4 bg-panel">
+ <ViewSidebar.Root aria-label="CRM navigation">
<SidebarCreateHeader
title="Customers"
label="New company"
@@ -51,7 +51,7 @@ export function CrmSidebar(props: {
</Tooltip>
}
/>
- <ViewSidebar.Content class="flex flex-col gap-6">
+ <ViewSidebar.Content>
<div class="px-1.5">
<TabsInset
aria-label="Company layout"
@@ -69,7 +69,7 @@ export function CrmSidebar(props: {
/>
</div>
<CollapsibleSection.Root open={viewsOpen()} onOpenChange={setViewsOpen}>
- <CollapsibleSection.Trigger class="text-xs">
+ <CollapsibleSection.Trigger>
<span>Views</span>
<CollapsibleSection.Indicator />
</CollapsibleSection.Trigger>
@@ -82,7 +82,8 @@ export function CrmSidebar(props: {
active={props.active === view.id}
onClick={() => props.onNavigate(view.id)}
>
- <span class="ml-7 truncate">{view.label}</span>
+ <ViewSidebar.Icon />
+ <span class="truncate">{view.label}</span>
</ViewSidebar.Item>
</Tooltip>
)}
@@ -109,7 +110,7 @@ export function CrmSidebar(props: {
open={listsOpen()}
onOpenChange={setListsOpen}
>
- <CollapsibleSection.Trigger class="text-xs">
+ <CollapsibleSection.Trigger>
<span>Lists</span>
<CollapsibleSection.Indicator />
</CollapsibleSection.Trigger>
@@ -155,7 +156,7 @@ export function CrmSidebar(props: {
</CollapsibleSection.Root>
</Show>
</ViewSidebar.Content>
- <div class="shrink-0 border-t border-edge-muted p-1.5 py-3">
+ <ViewSidebar.Footer>
<ViewSidebar.Nav aria-label="CRM tools">
<ViewSidebar.Item
onClick={props.onImport}
@@ -182,7 +183,7 @@ export function CrmSidebar(props: {
CRM settings
</ViewSidebar.Item>
</ViewSidebar.Nav>
- </div>
+ </ViewSidebar.Footer>
</ViewSidebar.Root>
);
}
diff --git a/apps/web/src/features/companies/views/CrmWorkspace.tsx b/apps/web/src/features/companies/views/CrmWorkspace.tsx
index 4b9c8a79ff..f6c7643b0e 100644
--- a/apps/web/src/features/companies/views/CrmWorkspace.tsx
+++ b/apps/web/src/features/companies/views/CrmWorkspace.tsx
@@ -286,7 +286,7 @@ export function CrmWorkspace(props: {
return (
<ViewShell.Root
class="touch:pt-(--safe-top) touch:pb-(--mobile-content-inset-bottom)"
- aside={collapsed() ? false : { width: 216, min: 216, max: 216 }}
+ aside={collapsed() ? false : {}}
main={{ min: 320 }}
>
<ViewShell.Aside>
diff --git a/apps/web/src/features/drive-view/components/DriveDetailView.tsx b/apps/web/src/features/drive-view/components/DriveDetailView.tsx
index df5e5c9aca..6f05cdf92d 100644
--- a/apps/web/src/features/drive-view/components/DriveDetailView.tsx
+++ b/apps/web/src/features/drive-view/components/DriveDetailView.tsx
@@ -16,7 +16,6 @@ import { MarkdownDetailBreadcrumbItem } from '@block-md/component/MarkdownDetail
import type { MarkdownDocumentKind } from '@block-md/types';
import { SidePanel } from '@components/app/side-panel';
import { useSplitPanelOrThrow } from '@components/app/split-layout/layoutUtils';
-import { SplitPanel } from '@components/app/split-panel';
import {
ShareDialogContext,
ShareTrigger,
@@ -73,7 +72,6 @@ function DriveDetailTopBar() {
return (
<ViewShell.TopBar class="touch:flex">
- <SplitPanel.CloseButton class="hidden shrink-0 @max-[720px]/view-shell:flex" />
<DriveBreadcrumbsOutlet
aria-label="File location"
fallback={<EntityDetailBreadcrumbSkeleton />}
diff --git a/apps/web/src/features/drive-view/components/drive-navigation.tsx b/apps/web/src/features/drive-view/components/drive-navigation.tsx
index 42982483b7..11ba5f0c4e 100644
--- a/apps/web/src/features/drive-view/components/drive-navigation.tsx
+++ b/apps/web/src/features/drive-view/components/drive-navigation.tsx
@@ -24,14 +24,15 @@ export function DriveNavigation(props: {
active={
props.location.kind === 'tab' && props.location.tab === tab.id
}
- class="font-normal"
onClick={() => props.onNavigate(tab.id)}
>
- <Dynamic
- component={icons[tab.id]}
- class="size-4 shrink-0"
- aria-hidden="true"
- />
+ <ViewSidebar.Icon>
+ <Dynamic
+ component={icons[tab.id]}
+ class="size-4 shrink-0"
+ aria-hidden="true"
+ />
+ </ViewSidebar.Icon>
<span class="truncate">{tab.label}</span>
</ViewSidebar.Item>
</props.locationMenu>
diff --git a/apps/web/src/features/drive-view/components/folder-tree.tsx b/apps/web/src/features/drive-view/components/folder-tree.tsx
index 63c7a1e8b0..babea0539a 100644
--- a/apps/web/src/features/drive-view/components/folder-tree.tsx
+++ b/apps/web/src/features/drive-view/components/folder-tree.tsx
@@ -1,8 +1,6 @@
import { ViewSidebar } from '@app/components/view-shell';
-import CaretRightIcon from '@phosphor/caret-right.svg';
import FolderIcon from '@phosphor/folder.svg';
-import { Button, cn } from '@ui';
-import { For, Show } from 'solid-js';
+import { For } from 'solid-js';
import type { DriveFolderNode } from '../core/types';
import type { DriveLocationMenu } from './drive-navigation';
@@ -16,7 +14,7 @@ export function FolderTree(props: {
locationMenu: DriveLocationMenu;
}) {
return (
- <ul class="flex min-w-0 flex-col gap-0.5">
+ <ul class="flex min-w-0 flex-col gap-(--sidebar-row-gap)">
<For each={props.nodes}>
{(node) => {
const open = () =>
@@ -24,56 +22,22 @@ export function FolderTree(props: {
return (
<li class="min-w-0">
<props.locationMenu location={{ kind: 'folder', id: node.id }}>
- <div
- class={cn(
- 'flex min-w-0 items-center rounded-xl',
- props.selectedId === node.id
- ? 'bg-active'
- : 'hover:bg-hover'
- )}
+ <ViewSidebar.TreeItem
+ active={props.selectedId === node.id}
+ expanded={node.children.length > 0 ? open() : undefined}
+ label={node.name}
+ onToggle={() => props.onToggle(node.id)}
+ onClick={() => props.onSelect(node.id)}
>
- <Show
- when={node.children.length > 0}
- fallback={<span class="w-6 shrink-0" />}
- >
- <Button
- variant="ghost"
- size="sm"
- square
- class="size-6 shrink-0 rounded-lg not-disabled:hover:bg-transparent not-touch:not-disabled:hover:bg-none not-touch:not-disabled:active:bg-none"
- aria-label={`${open() ? 'Collapse' : 'Expand'} ${node.name}`}
- aria-expanded={open()}
- onClick={() => props.onToggle(node.id)}
- >
- <CaretRightIcon
- class={cn(
- 'size-3 transition-transform',
- open() && 'rotate-90'
- )}
- />
- </Button>
- </Show>
- <ViewSidebar.Item
- class={cn(
- 'min-w-0 flex-1 justify-start px-2 font-normal bg-transparent not-disabled:hover:bg-transparent not-touch:not-disabled:hover:bg-none not-touch:not-disabled:active:bg-none',
- props.selectedId === node.id && 'text-ink'
- )}
- title={node.name}
- aria-current={
- props.selectedId === node.id ? 'page' : undefined
- }
- onClick={() => props.onSelect(node.id)}
- >
- <FolderIcon class="size-4 shrink-0" />
- <span class="truncate">{node.name}</span>
- </ViewSidebar.Item>
- </div>
+ <ViewSidebar.Icon>
+ <FolderIcon class="size-4" />
+ </ViewSidebar.Icon>
+ <span class="truncate">{node.name}</span>
+ </ViewSidebar.TreeItem>
</props.locationMenu>
- <Show when={open() && node.children.length > 0}>
- <div class="ml-3 border-l border-edge pl-3">
- <FolderTree {...props} nodes={node.children} />
- </div>
- </Show>
+ <ViewSidebar.Branch open={open() && node.children.length > 0}>
+ <FolderTree {...props} nodes={node.children} />
+ </ViewSidebar.Branch>
</li>
);
}}
diff --git a/apps/web/src/features/drive-view/drive-view.tsx b/apps/web/src/features/drive-view/drive-view.tsx
index 3ac7a72883..31d304d4bf 100644
--- a/apps/web/src/features/drive-view/drive-view.tsx
+++ b/apps/web/src/features/drive-view/drive-view.tsx
@@ -121,11 +121,12 @@ function DriveFavorite(props: {
return (
<FavoriteContextMenu favorite={props.favorite} triggerClass="block">
<ViewSidebar.Item
- class="font-normal"
title={name()}
onClick={(event) => props.onOpen(props.favorite, name(), event)}
>
- <FavoriteIcon favorite={props.favorite} class="size-4 shrink-0" />
+ <ViewSidebar.Icon>
+ <FavoriteIcon favorite={props.favorite} class="size-4" />
+ </ViewSidebar.Icon>
<span class="truncate">{name()}</span>
</ViewSidebar.Item>
</FavoriteContextMenu>
@@ -309,15 +310,14 @@ function DriveViewContent(props: DriveViewProps) {
const CreateMenu = () => (
<Dropdown placement="bottom-start">
- <Dropdown.Trigger
- variant="ghost"
- depth={2}
- class="h-10 w-full shrink-0 justify-start gap-3 rounded-xl bg-ink/5 px-3"
- aria-label="New file or folder"
- >
- <PlusIcon class="size-4 shrink-0" />
- <span>New</span>
- <CaretDownIcon class="ml-auto size-3 shrink-0" />
+ <Dropdown.Trigger as={ViewSidebar.Action} aria-label="New file or folder">
+ <ViewSidebar.Icon>
+ <PlusIcon class="size-4" />
+ </ViewSidebar.Icon>
+ <span class="truncate">New</span>
+ <ViewSidebar.Trailing>
+ <CaretDownIcon class="size-3 shrink-0" />
+ </ViewSidebar.Trailing>
</Dropdown.Trigger>
<Dropdown.Content class="min-w-48">
<Dropdown.Group>
diff --git a/apps/web/src/features/drive-view/views/drive-layout.tsx b/apps/web/src/features/drive-view/views/drive-layout.tsx
index 5c63a3ad23..93521546f6 100644
--- a/apps/web/src/features/drive-view/views/drive-layout.tsx
+++ b/apps/web/src/features/drive-view/views/drive-layout.tsx
@@ -6,6 +6,7 @@ import {
ViewSidebar,
} from '@app/components/view-shell';
import { SplitPanel } from '@components/app/split-panel';
+import { isTouchDevice } from '@core/mobile/isTouchDevice';
import CaretDownIcon from '@phosphor/caret-down.svg';
import FolderIcon from '@phosphor/folder.svg';
import SearchIcon from '@phosphor/magnifying-glass.svg';
@@ -75,7 +76,7 @@ export function DriveLayout(props: {
open={props.state.favoritesOpen}
onOpenChange={props.onFavoritesOpen}
>
- <CollapsibleSection.Trigger class="text-xs">
+ <CollapsibleSection.Trigger>
<span class="min-w-0 truncate">Favorites</span>
<CollapsibleSection.Indicator />
</CollapsibleSection.Trigger>
@@ -87,16 +88,13 @@ export function DriveLayout(props: {
open={props.state.rootOpen}
onOpenChange={props.onRootOpen}
>
- <div class="flex items-center gap-1">
- <CollapsibleSection.Trigger class="min-w-0 flex-1 text-xs">
+ <CollapsibleSection.Header>
+ <CollapsibleSection.Trigger class="flex-1">
<span class="min-w-0 truncate">Folders</span>
<CollapsibleSection.Indicator />
</CollapsibleSection.Trigger>
- <Button
- variant="ghost"
- size="icon-sm"
+ <CollapsibleSection.Action
label="Search folders"
- class="ml-auto mr-2 shrink-0 rounded-lg"
onClick={() => {
const open = !searchingFolders();
setSearchingFolders(open);
@@ -105,8 +103,8 @@ export function DriveLayout(props: {
}}
>
<SearchIcon class="size-3.5" />
- </Button>
- </div>
+ </CollapsibleSection.Action>
+ </CollapsibleSection.Header>
<CollapsibleSection.Content>
<Show when={searchingFolders()}>
<SearchBar
@@ -132,7 +130,7 @@ export function DriveLayout(props: {
<span>Drive</span>
</ViewSidebar.Item>
</props.locationMenu>
- <div class="ml-3 border-l border-edge pl-3">
+ <ViewSidebar.Branch>
<Show
when={!props.foldersLoading}
fallback={
@@ -176,7 +174,7 @@ export function DriveLayout(props: {
</Show>
</Show>
</Show>
- </div>
+ </ViewSidebar.Branch>
</ViewSidebar.Nav>
</CollapsibleSection.Content>
</CollapsibleSection.Root>
@@ -193,18 +191,17 @@ export function DriveLayout(props: {
main={{ preferredWidth: 640 }}
>
<ViewShell.Aside>
- <ViewSidebar.Root
- aria-label="Drive navigation"
- class="gap-4 bg-panel"
- >
+ <ViewSidebar.Root aria-label="Drive navigation">
<ViewSidebar.Header>
<div class="flex min-w-0 items-center gap-1">
- <SplitPanel.CloseButton />
+ <ViewSidebar.CloseButton />
<ViewSidebar.Title>Drive</ViewSidebar.Title>
</div>
</ViewSidebar.Header>
- <ViewSidebar.Content class="flex flex-col gap-6">
+ <ViewSidebar.Primary>
<props.createMenu />
+ </ViewSidebar.Primary>
+ <ViewSidebar.Content>
<SidebarContent />
</ViewSidebar.Content>
</ViewSidebar.Root>
@@ -215,7 +212,6 @@ export function DriveLayout(props: {
fallback={
<>
<ViewShell.TopBar class="touch:flex">
- <SplitPanel.CloseButton class="hidden shrink-0 @max-[720px]/view-shell:flex" />
<h1 class="hidden min-w-0 truncate text-sm font-semibold tracking-[-0.03em] text-ink @max-[720px]/view-shell:block">
Drive
</h1>
@@ -227,28 +223,37 @@ export function DriveLayout(props: {
<ViewShell.Header>
<div class="flex min-w-0 flex-col gap-3">
<div class="hidden min-w-0 items-center gap-2 @max-[720px]/view-shell:flex">
- <Dropdown
- open={navigationOpen()}
- onOpenChange={setNavigationOpen}
- placement="bottom-start"
+ <Show
+ when={isTouchDevice()}
+ fallback={
+ <h1 class="min-w-0 truncate text-xl font-semibold tracking-[-0.03em] text-ink">
+ {title()}
+ </h1>
+ }
>
- <h1 class="min-w-0">
- <Dropdown.Trigger
- variant="ghost"
- size="sm"
- class="h-auto min-w-0 max-w-full gap-1 rounded-lg px-2 py-1 text-xl font-semibold tracking-[-0.03em] text-ink"
- aria-label={`Select Drive view: ${title()}`}
- >
- <span class="truncate">{title()}</span>
- <CaretDownIcon class="size-3.5 shrink-0 text-ink-muted" />
- </Dropdown.Trigger>
- </h1>
- <Dropdown.Content class="max-h-[70vh] w-72 overflow-auto rounded-2xl">
- <Dropdown.Group class="gap-5 p-3">
- <SidebarContent />
- </Dropdown.Group>
- </Dropdown.Content>
- </Dropdown>
+ <Dropdown
+ open={navigationOpen()}
+ onOpenChange={setNavigationOpen}
+ placement="bottom-start"
+ >
+ <h1 class="min-w-0">
+ <Dropdown.Trigger
+ variant="ghost"
+ size="sm"
+ class="h-auto min-w-0 max-w-full gap-1 rounded-lg px-2 py-1 text-xl font-semibold tracking-[-0.03em] text-ink"
+ aria-label={`Select Drive view: ${title()}`}
+ >
+ <span class="truncate">{title()}</span>
+ <CaretDownIcon class="size-3.5 shrink-0 text-ink-muted" />
+ </Dropdown.Trigger>
+ </h1>
+ <Dropdown.Content class="max-h-[70vh] w-72 overflow-auto rounded-2xl">
+ <Dropdown.Group class="gap-5 p-3">
+ <SidebarContent />
+ </Dropdown.Group>
+ </Dropdown.Content>
+ </Dropdown>
+ </Show>
<div class="ml-auto shrink-0">
<props.createMenu />
</div>
diff --git a/apps/web/src/features/email-view/components/EmailDetailView.tsx b/apps/web/src/features/email-view/components/EmailDetailView.tsx
index 3eba093aee..25a35474af 100644
--- a/apps/web/src/features/email-view/components/EmailDetailView.tsx
+++ b/apps/web/src/features/email-view/components/EmailDetailView.tsx
@@ -13,7 +13,6 @@ import {
useCanAutofocusSplitContent,
useSplitPanelOrThrow,
} from '@components/app/split-layout/layoutUtils';
-import { SplitPanel } from '@components/app/split-panel';
import { EntityIcon } from '@core/component/EntityIcon';
import { toEntityLoadError } from '@core/component/EntityLoadGate';
import {
@@ -177,7 +176,6 @@ export function EmailDetailView(props: { thread: EmailThreadTarget }) {
<SidePanel.Root defaultOpen={false}>
<div class="flex size-full min-h-0 min-w-0 flex-col overflow-hidden">
<ViewShell.TopBar class="touch:flex">
- <SplitPanel.CloseButton class="hidden shrink-0 @max-[720px]/view-shell:flex" />
<ViewBreadcrumbs.Outlet
class="flex-1"
aria-label="Email location"
diff --git a/apps/web/src/features/email-view/components/EmailHeader.tsx b/apps/web/src/features/email-view/components/EmailHeader.tsx
index 18e1477761..fb74571f6c 100644
--- a/apps/web/src/features/email-view/components/EmailHeader.tsx
+++ b/apps/web/src/features/email-view/components/EmailHeader.tsx
@@ -5,7 +5,6 @@ import {
ViewShell,
} from '@app/components/view-shell';
import { useSplitPanelOrThrow } from '@components/app/split-layout/layoutUtils';
-import { SplitPanel } from '@components/app/split-panel';
import CaretDownIcon from '@phosphor/caret-down.svg';
import PlusIcon from '@phosphor/plus.svg';
import { Button, Dropdown, pressHandlers } from '@ui';
@@ -51,7 +50,6 @@ export function EmailViewBreadcrumbItem() {
export function EmailTopBar() {
return (
<ViewShell.TopBar>
- <SplitPanel.CloseButton class="hidden shrink-0 @max-[720px]/view-shell:flex" />
<ViewBreadcrumbs.Outlet class="flex-1" aria-label="Email location" />
</ViewShell.TopBar>
);
diff --git a/apps/web/src/features/email-view/components/EmailInboxSelector.tsx b/apps/web/src/features/email-view/components/EmailInboxSelector.tsx
index 5693c4a01c..7acb60f140 100644
--- a/apps/web/src/features/email-view/components/EmailInboxSelector.tsx
+++ b/apps/web/src/features/email-view/components/EmailInboxSelector.tsx
@@ -8,7 +8,7 @@ import CheckIcon from '@phosphor/check.svg';
import PlusIcon from '@phosphor/plus.svg';
import TrayIcon from '@phosphor/tray.svg';
import { useEmailLinksQuery } from '@queries/email/link';
-import { Button, cn, Dropdown, pressHandlers } from '@ui';
+import { cn, Dropdown, pressHandlers } from '@ui';
import { createMemo, For, type JSX, Show } from 'solid-js';
import { useEmailView } from '../email-view-context';
@@ -100,11 +100,8 @@ export function EmailInboxList(props: { class?: string }) {
return (
<Show when={selection.visible()}>
- <ViewSidebar.Nav
- aria-label="Inboxes"
- class={cn('border-b border-edge-muted pb-3', props.class)}
- >
- <div class="flex min-w-0 items-center gap-1">
+ <ViewSidebar.Nav aria-label="Inboxes" class={props.class}>
+ <div class="flex min-w-0 items-center gap-1 pr-(--sidebar-action-inset)">
<ViewSidebar.Item
active={selection.isAll()}
aria-current={selection.isAll() ? 'true' : undefined}
@@ -117,17 +114,13 @@ export function EmailInboxList(props: { class?: string }) {
<span class="truncate">All inboxes</span>
</ViewSidebar.Item>
<Show when={selection.canAddInbox()}>
- <Button
+ <ViewSidebar.Control
type="button"
- variant="ghost"
- size="sm"
- square
- class="size-8 shrink-0 rounded-full text-ink-muted transition-none"
label="Connect another account"
{...pressHandlers(selection.addInbox)}
>
<PlusIcon class="size-4" />
- </Button>
+ </ViewSidebar.Control>
</Show>
</div>
<For each={selection.options()}>
diff --git a/apps/web/src/features/email-view/components/EmailSidebar.tsx b/apps/web/src/features/email-view/components/EmailSidebar.tsx
index 6744a6201e..8b2dbdf078 100644
--- a/apps/web/src/features/email-view/components/EmailSidebar.tsx
+++ b/apps/web/src/features/email-view/components/EmailSidebar.tsx
@@ -76,14 +76,14 @@ export function EmailSidebar() {
});
return (
- <ViewSidebar.Root aria-label="Email navigation" class="gap-4">
+ <ViewSidebar.Root aria-label="Email navigation">
<SidebarCreateHeader
title="Email"
label="New email"
onCreate={() => composeEmail()}
/>
- <ViewSidebar.Content class="flex flex-col gap-6">
+ <ViewSidebar.Content>
<EmailInboxList />
<EmailNavigation />
diff --git a/apps/web/src/features/inbox-view/components/HomeEntityIcon.tsx b/apps/web/src/features/inbox-view/components/HomeEntityIcon.tsx
index abe8f1cf58..5269861a53 100644
--- a/apps/web/src/features/inbox-view/components/HomeEntityIcon.tsx
+++ b/apps/web/src/features/inbox-view/components/HomeEntityIcon.tsx
@@ -1,13 +1,11 @@
+import { ViewSidebar } from '@app/components/view-shell';
import { EntityIcon } from '@entity/extractors/entity-icon';
import { type EntityData, isGithubPrEntity } from '@entity/types/entity';
/** Shared entity icons sized for compact Home rows. */
export function HomeEntityIcon(props: { entity: EntityData }) {
return (
- <span
- class="flex size-5 shrink-0 items-center justify-center"
- aria-hidden="true"
- >
+ <ViewSidebar.Icon>
<span
class={
props.entity.type === 'channel' &&
@@ -23,6 +21,6 @@ export function HomeEntityIcon(props: { entity: EntityData }) {
showTooltip={false}
/>
</span>
- </span>
+ </ViewSidebar.Icon>
);
}
diff --git a/apps/web/src/features/inbox-view/components/HomeListEntity.tsx b/apps/web/src/features/inbox-view/components/HomeListEntity.tsx
index 73066a04f6..f02510c361 100644
--- a/apps/web/src/features/inbox-view/components/HomeListEntity.tsx
+++ b/apps/web/src/features/inbox-view/components/HomeListEntity.tsx
@@ -1,3 +1,4 @@
+import { ViewSidebar } from '@app/components/view-shell';
import { useUserId } from '@core/context/user';
import { getDisplayName, tryMacroId } from '@core/user';
import { Entity, MaybeEntityRow } from '@entity';
@@ -21,18 +22,15 @@ export function HomeListEntity(props: HomeListEntityProps) {
const unread = () => unreadFilterFn(props.entity);
return (
- <div class="soup-list-entity relative mx-1.5 my-0.5">
+ <div class="soup-list-entity relative mx-(--sidebar-gutter) my-(--sidebar-row-gap)">
<MaybeEntityRow
entityId={props.occurrenceKey}
config={props.entityRowConfig}
>
- <div
- class={cn(
- 'group/home-item relative flex h-8 min-w-0 items-center gap-2 rounded-xl px-2.5 text-left text-sm outline-none touch:h-11',
- props.checked || props.highlighted
- ? 'bg-active text-ink'
- : 'text-ink-muted hover:bg-hover hover:text-ink'
- )}
+ <ViewSidebar.Item
+ as="div"
+ class="group/home-item relative"
+ active={props.checked || props.highlighted}
{...pressHandlers((event) => {
event.preventDefault();
props.onClick?.(event);
@@ -43,9 +41,9 @@ export function HomeListEntity(props: HomeListEntityProps) {
when={threadEntity()}
fallback={<HomeEntityIcon entity={props.entity} />}
>
- <span class="flex size-5 shrink-0 items-center justify-center">
+ <ViewSidebar.Icon>
<ArrowBendUpLeftIcon class="size-4" />
- </span>
+ </ViewSidebar.Icon>
</Show>
<span
class={cn(
@@ -87,7 +85,7 @@ export function HomeListEntity(props: HomeListEntityProps) {
class="size-1.5 shrink-0 rounded-full bg-accent"
/>
</Show>
- </div>
+ </ViewSidebar.Item>
</MaybeEntityRow>
</div>
);
diff --git a/apps/web/src/features/inbox-view/inbox-view.tsx b/apps/web/src/features/inbox-view/inbox-view.tsx
index fc462005c7..1dc95145de 100644
--- a/apps/web/src/features/inbox-view/inbox-view.tsx
+++ b/apps/web/src/features/inbox-view/inbox-view.tsx
@@ -78,7 +78,6 @@ function InboxViewRoot() {
<ViewShell.Root
asidePreferenceKey="inbox"
aside={{
- width: 256,
min: 224,
max: 420,
preserveDuringResize: false,
diff --git a/apps/web/src/features/property/tags/SidebarTagsSection.test.tsx b/apps/web/src/features/property/tags/SidebarTagsSection.test.tsx
index b58923e659..31c0267da9 100644
--- a/apps/web/src/features/property/tags/SidebarTagsSection.test.tsx
+++ b/apps/web/src/features/property/tags/SidebarTagsSection.test.tsx
@@ -5,7 +5,7 @@
import type { TagSetResponse } from '@service-properties/generated/schemas/tagSetResponse';
import { fireEvent, render, screen } from '@solidjs/testing-library';
import { createSignal } from 'solid-js';
-import { describe, expect, it, vi } from 'vitest';
+import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest';
import {
SidebarTagsSection,
type SidebarTagsSectionProps,
@@ -17,6 +17,19 @@ const mocks = vi.hoisted(() => ({
tagEditorDialog: vi.fn(),
}));
+beforeEach(() => {
+ vi.stubGlobal(
+ 'ResizeObserver',
+ class {
+ observe() {}
+ unobserve() {}
+ disconnect() {}
+ }
+ );
+});
+
+afterEach(() => vi.unstubAllGlobals());
+
vi.mock('./TagEditorDialog', () => ({
TagEditorDialog: (props: { open: boolean }) => {
mocks.tagEditorDialog(props);
diff --git a/apps/web/src/features/property/tags/SidebarTagsSection.tsx b/apps/web/src/features/property/tags/SidebarTagsSection.tsx
index 19dae4ab87..c8bea147e0 100644
--- a/apps/web/src/features/property/tags/SidebarTagsSection.tsx
+++ b/apps/web/src/features/property/tags/SidebarTagsSection.tsx
@@ -1,7 +1,6 @@
import { CollapsibleSection, ViewSidebar } from '@app/components/view-shell';
import PlusIcon from '@phosphor/plus.svg';
import { useCurrentTeamQuery } from '@queries/team/teams';
-import { Button } from '@ui';
import { createSignal, Show } from 'solid-js';
import { TagTree } from './components/tag-tree';
import type { TagTreeNode } from './core/tag-tree';
@@ -60,22 +59,19 @@ export function SidebarTagsSection(props: SidebarTagsSectionProps) {
open={props.open}
onOpenChange={props.onOpenChange}
>
- <div class="flex items-center gap-1">
- <CollapsibleSection.Trigger class="min-w-0 flex-1 text-xs">
+ <CollapsibleSection.Header>
+ <CollapsibleSection.Trigger class="flex-1">
<span class="min-w-0 truncate">Tags</span>
<CollapsibleSection.Indicator />
</CollapsibleSection.Trigger>
- <Button
+ <CollapsibleSection.Action
type="button"
- variant="ghost"
- size="icon-sm"
label="New tag"
- class="ml-auto mr-2 shrink-0 rounded-lg"
onClick={() => setCreating(true)}
>
<PlusIcon class="size-3.5" />
- </Button>
- </div>
+ </CollapsibleSection.Action>
+ </CollapsibleSection.Header>
<CollapsibleSection.Content>
<Show
when={tree().length > 0}
diff --git a/apps/web/src/features/property/tags/components/tag-tree.tsx b/apps/web/src/features/property/tags/components/tag-tree.tsx
index fa77e52fa4..cb147d97eb 100644
--- a/apps/web/src/features/property/tags/components/tag-tree.tsx
+++ b/apps/web/src/features/property/tags/components/tag-tree.tsx
@@ -1,6 +1,4 @@
import { ViewSidebar } from '@app/components/view-shell';
-import CaretRightIcon from '@phosphor/caret-right.svg';
-import { Button, cn } from '@ui';
import { For, Show } from 'solid-js';
import type { TagTreeNode } from '../core/tag-tree';
import { TagDot } from '../TagDot';
@@ -14,7 +12,7 @@ export function TagTree(props: {
onSelect: (id: string) => void;
}) {
return (
- <ul class="flex min-w-0 flex-col gap-0.5">
+ <ul class="flex min-w-0 flex-col gap-(--sidebar-row-gap)">
<For each={props.nodes}>
{(node) => {
const open = () => props.isExpanded(node);
@@ -22,62 +20,28 @@ export function TagTree(props: {
Boolean(node.tag && props.activeIds.includes(node.tag.id));
return (
<li class="min-w-0">
- <div
- class={cn(
- 'flex min-w-0 items-center rounded-xl',
- active() ? 'bg-active' : 'hover:bg-hover'
- )}
+ <ViewSidebar.TreeItem
+ active={active()}
+ expanded={node.children.length > 0 ? open() : undefined}
+ label={node.path}
+ onToggle={() => props.onToggle(node)}
+ onClick={() =>
+ node.tag ? props.onSelect(node.tag.id) : props.onToggle(node)
+ }
>
- <Show
- when={node.children.length > 0}
- fallback={<span class="w-6 shrink-0" />}
- >
- <Button
- variant="ghost"
- size="icon-sm"
- class="size-6 shrink-0 rounded-lg not-disabled:hover:bg-transparent not-touch:not-disabled:hover:bg-none not-touch:not-disabled:active:bg-none"
- aria-label={`${open() ? 'Collapse' : 'Expand'} ${node.path}`}
- aria-expanded={open()}
- onClick={() => props.onToggle(node)}
+ <ViewSidebar.Icon>
+ <Show
+ when={node.children.length > 0}
+ fallback={<TagDot color={node.tag?.color} />}
>
- <CaretRightIcon
- class={cn(
- 'size-3 transition-transform',
- open() && 'rotate-90'
- )}
- />
- </Button>
- </Show>
- <ViewSidebar.Item
- class={cn(
- 'min-w-0 flex-1 justify-start px-2 font-normal bg-transparent not-disabled:hover:bg-transparent not-touch:not-disabled:hover:bg-none not-touch:not-disabled:active:bg-none',
- active() && 'text-ink'
- )}
- title={node.path}
- aria-current={active() ? 'page' : undefined}
- aria-expanded={!node.tag ? open() : undefined}
- onClick={() =>
- node.tag
- ? props.onSelect(node.tag.id)
- : props.onToggle(node)
- }
- >
- <ViewSidebar.Icon>
- <Show
- when={node.children.length > 0}
- fallback={<TagDot color={node.tag?.color} />}
- >
- <BranchTagIcon node={node} />
- </Show>
- </ViewSidebar.Icon>
- <span class="truncate">{node.name}</span>
- </ViewSidebar.Item>
- </div>
- <Show when={open() && node.children.length > 0}>
- <div class="ml-3 border-l border-edge pl-3">
- <TagTree {...props} nodes={node.children} />
- </div>
- </Show>
+ <BranchTagIcon node={node} />
+ </Show>
+ </ViewSidebar.Icon>
+ <span class="truncate">{node.name}</span>
+ </ViewSidebar.TreeItem>
+ <ViewSidebar.Branch open={open() && node.children.length > 0}>
+ <TagTree {...props} nodes={node.children} />
+ </ViewSidebar.Branch>
</li>
);
}}
diff --git a/apps/web/src/features/tasks-view/components/TasksDetailView.tsx b/apps/web/src/features/tasks-view/components/TasksDetailView.tsx
index 92bad6ddd1..bb591b88ce 100644
--- a/apps/web/src/features/tasks-view/components/TasksDetailView.tsx
+++ b/apps/web/src/features/tasks-view/components/TasksDetailView.tsx
@@ -12,7 +12,6 @@ import { ViewBreadcrumbs, ViewShell } from '@app/components/view-shell';
import { MarkdownDetailBreadcrumbItem } from '@block-md/component/MarkdownDetailBreadcrumbItem';
import { SidePanel } from '@components/app/side-panel';
import { useSplitPanelOrThrow } from '@components/app/split-layout/layoutUtils';
-import { SplitPanel } from '@components/app/split-panel';
import { toast } from '@core/component/Toast/Toast';
import {
ShareDialogContext,
@@ -53,7 +52,6 @@ function TaskDetailTopBar(props: {
return (
<ViewShell.TopBar class="touch:flex">
- <SplitPanel.CloseButton class="hidden shrink-0 @max-[720px]/view-shell:flex" />
<ViewBreadcrumbs.Outlet
aria-label="Task location"
fallback={<EntityDetailBreadcrumbSkeleton />}
diff --git a/apps/web/src/features/tasks-view/components/TasksHeader.tsx b/apps/web/src/features/tasks-view/components/TasksHeader.tsx
index 380179a123..48d6e0ecd3 100644
--- a/apps/web/src/features/tasks-view/components/TasksHeader.tsx
+++ b/apps/web/src/features/tasks-view/components/TasksHeader.tsx
@@ -6,7 +6,6 @@ import {
} from '@app/components/view-shell';
import { useSplitLayout } from '@components/app/split-layout/layout';
import { useSplitPanelOrThrow } from '@components/app/split-layout/layoutUtils';
-import { SplitPanel } from '@components/app/split-panel';
import { isTouchDevice } from '@core/mobile/isTouchDevice';
import CaretDownIcon from '@phosphor/caret-down.svg';
import PlusIcon from '@phosphor/plus.svg';
@@ -50,7 +49,6 @@ export function TaskViewBreadcrumbItem() {
export function TasksTopBar() {
return (
<ViewShell.TopBar>
- <SplitPanel.CloseButton class="hidden shrink-0 @max-[720px]/view-shell:flex" />
<h1 class="hidden min-w-0 truncate text-sm font-semibold tracking-[-0.03em] text-ink @max-[720px]/view-shell:block">
Tasks
</h1>
diff --git a/apps/web/src/features/tasks-view/components/TasksSidebar.tsx b/apps/web/src/features/tasks-view/components/TasksSidebar.tsx
index 9b4ca103de..306412445c 100644
--- a/apps/web/src/features/tasks-view/components/TasksSidebar.tsx
+++ b/apps/web/src/features/tasks-view/components/TasksSidebar.tsx
@@ -116,7 +116,7 @@ function TaskFavorites(props: {
open={props.open}
onOpenChange={props.onOpenChange}
>
- <CollapsibleSection.Trigger class="text-xs">
+ <CollapsibleSection.Trigger>
<span class="min-w-0 truncate">Favorites</span>
<CollapsibleSection.Indicator />
</CollapsibleSection.Trigger>
@@ -158,7 +158,7 @@ export function TasksSidebar() {
});
return (
- <ViewSidebar.Root aria-label="Tasks navigation" class="gap-4 bg-panel">
+ <ViewSidebar.Root aria-label="Tasks navigation">
<SidebarCreateHeader
title="Tasks"
label="New task"
@@ -167,7 +167,7 @@ export function TasksSidebar() {
}
/>
- <ViewSidebar.Content class="flex flex-col gap-6">
+ <ViewSidebar.Content>
<TasksNavigation />
<TaskFavorites
diff --git a/apps/web/src/index.css b/apps/web/src/index.css
index 9d8ba2f9f6..b37554252a 100644
--- a/apps/web/src/index.css
+++ b/apps/web/src/index.css
@@ -67,6 +67,24 @@
--app-border-width: 0.5px;
--app-ring-width: 0.5px;
+ /* Workspace sidebar geometry. Both icon rails are 26px from the edge.
+ Controls align by their centers, independent of glyph or button size. */
+ --sidebar-gutter: 0.5rem;
+ --sidebar-item-inset: 0.5rem;
+ --sidebar-icon-slot: 1.25rem;
+ --sidebar-icon-size: 1rem;
+ --sidebar-control-size: 1.5rem;
+ --sidebar-row-height: 2rem;
+ --sidebar-row-gap: 0.125rem;
+ --sidebar-label-gap: 0.375rem;
+ --sidebar-section-gap: 1.5rem;
+ --sidebar-section-content-gap: 0.25rem;
+ --sidebar-content-inset: calc(var(--sidebar-gutter) + var(--sidebar-item-inset));
+ --sidebar-local-rail: calc(var(--sidebar-item-inset) + var(--sidebar-icon-slot) / 2);
+ --sidebar-control-overhang: calc((var(--sidebar-icon-slot) - var(--sidebar-control-size)) / 2);
+ --sidebar-action-inset: calc(var(--sidebar-item-inset) + var(--sidebar-control-overhang));
+ --sidebar-header-action-inset: calc(var(--sidebar-gutter) + var(--sidebar-action-inset));
+
/* mobile safe areas */
--safe-bottom: max(env(safe-area-inset-bottom, 0px), var(--tauri-inset-bottom, 0px));
--safe-right: max(env(safe-area-inset-right, 0px), var(--tauri-inset-right, 0px));
@@ -537,6 +555,7 @@ body.tauri-ios {
/* Restore native feedback suppressed by Tailwind's reset; glass opts out below. */
html[data-touch-device='true'] {
+ --sidebar-control-size: 2.25rem;
-webkit-tap-highlight-color: initial;
}
diff --git a/apps/web/src/lib/core/hotkey/tokens.ts b/apps/web/src/lib/core/hotkey/tokens.ts
index fc6fe3cb18..cf421697d0 100644
--- a/apps/web/src/lib/core/hotkey/tokens.ts
+++ b/apps/web/src/lib/core/hotkey/tokens.ts
@@ -1,4 +1,7 @@
export const TOKENS = {
+ workspace: {
+ toggleNavigation: 'workspace.toggleNavigation',
+ },
// soup
soup: {
openSearch: 'soup.openSearch',
diff --git a/apps/web/src/lib/queries/preview/preview.ts b/apps/web/src/lib/queries/preview/preview.ts
index c1940096c6..9c08c2e6ec 100644
--- a/apps/web/src/lib/queries/preview/preview.ts
+++ b/apps/web/src/lib/queries/preview/preview.ts
@@ -177,9 +177,13 @@ export function useItemPreview(item: Accessor<ItemEntity>) {
const preview = createMemo(() => {
const data = previewQuery.data();
- const channelMessageData = queryReadyGate(maybeChannelMessageQuery)
- ? maybeChannelMessageQuery.data
- : undefined;
+ // Disabled message queries are pending but not loading. Reading their
+ // data still suspends briefly whenever a preview row mounts.
+ const channelMessageData =
+ !maybeChannelMessageQuery.isPending &&
+ queryReadyGate(maybeChannelMessageQuery)
+ ? maybeChannelMessageQuery.data
+ : undefined;
if (!data) {
return {
diff --git a/apps/web/vitest.config.ts b/apps/web/vitest.config.ts
index b28f9d92fd..467a1db69b 100644
--- a/apps/web/vitest.config.ts
+++ b/apps/web/vitest.config.ts
@@ -166,6 +166,29 @@ export default defineConfig({
name: 'tauri',
},
},
+ {
+ // Keep transition primitives on the same browser runtime as their callers.
+ // Optimizing the CommonJS entry otherwise bundles a second Solid instance.
+ extends: './src/lib/core/vitest.config.ts',
+ resolve: {
+ alias: {
+ 'solid-transition-group': fileURLToPath(
+ new URL(
+ '../../node_modules/solid-transition-group/dist/index.js',
+ import.meta.url
+ )
+ ),
+ },
+ },
+ ssr: {
+ resolve: { conditions: ['browser', 'development'] },
+ },
+ test: {
+ deps: { optimizer: { web: { enabled: false } } },
+ include: ['src/components/view-shell/**/*.{test,spec}.{ts,tsx}'],
+ name: 'view-shell',
+ },
+ },
{
// App-shell and feature tests without a specialized environment.
extends: './src/lib/core/vitest.config.ts',
@@ -173,6 +196,7 @@ export default defineConfig({
environment: 'jsdom',
exclude: [
...configDefaults.exclude,
+ 'src/components/view-shell/**/*',
'src/features/{theme,block-channel,block-call,block-pr,block-md,channel,notifications,block-email,email-message,email-thread,email-compose}/**/*',
],
include: [
diff --git a/docs/AGENT_GUIDE/navigation.md b/docs/AGENT_GUIDE/navigation.md
index 69749b7c6b..df05fff76a 100644
--- a/docs/AGENT_GUIDE/navigation.md
+++ b/docs/AGENT_GUIDE/navigation.md
@@ -34,13 +34,41 @@ Splits: the app is a tiling window manager. A second pane appends its own segmen
(`/app/<left>/<right>`). Desktop panes expose Close when available and omit
split-history back/forward buttons. Mobile content panes retain their back button.
+The app views are referred to as **workspaces**. Expanded workspace sidebars start
+at the shared 256px width; manual resizing and narrow layouts can change the
+displayed width. Workspace navigation uses shared 32px rows (44px on touch), 16px
+glyphs in aligned 20px icon slots, a 6px text gap, and compact sentence-case section
+headings. Tags and folders have a separate disclosure button on the **right** of
+the row: clicking the label selects the destination; clicking Expand/Collapse
+only opens or closes its children. Long destination names are single-line and
+expose the full name on hover. Section chevrons point right and stay visible when
+collapsed. Expanded chevrons point down and appear when hovering their section;
+the section heading also brightens on hover. Sections and nested branches briefly
+animate height and opacity when toggled, and respect reduced-motion preferences.
+The sidebar spacing contract uses 8px outer gutters, 24px between sections, and
+4px between a section header and its rows. Leading icons and trailing actions
+share rails 26px from either edge, including collapse, search, add, and tree
+controls. Use the shared slots described in
+[the sidebar spacing guide](../../apps/web/src/components/view-shell/README.md).
+
Desktop app navigation panels have **Hide navigation** at the right end of their
48px title bar. It hides only that split's navigation; **Show navigation** (the
hamburger) appears before the main header's title/breadcrumbs, including when a
document, email, or conversation is open. Home's filter sits beside its label.
+The split's **Close** control aligns with the navigation icons when expanded and
+appears immediately before the hamburger when collapsed. Both use 16px icons in
+24px desktop buttons. Close remains hidden when the split cannot be closed.
+The hamburger sits directly beside the item title or view breadcrumbs. Narrow
+desktop Drive headers use a plain view title; use the hamburger to navigate.
+**Cmd+.** (Ctrl+. on Windows/Linux) toggles navigation in the active split, even
+while typing. It leaves the outer app rail and other splits in place. Docked
+navigation and the adjacent content animate their width over 140ms, with a brief
+sidebar fade; reduced-motion preferences skip the animation.
+Narrow navigation overlays use the same brief width and opacity animation.
Visibility is a sticky preference per app type (Home, Email, Chat, Tasks, Drive,
Agents, Customers), independent of other apps and restored on reload. Narrow
-workspaces reopen navigation as an overlay; the backdrop closes it. Mobile keeps
+workspaces reopen navigation as an overlay; the backdrop or **Hide navigation**
+closes it. The overlay never contains the split's **Close** button. Mobile keeps
its existing navigation controls. Block detail panels (including Calendar) have
**Hide side panel** in their own header and a hamburger **Show side panel** beside
the main title when hidden, with separate preferences per block type.