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.

Add persistent per-app sidebar collapse and hamburger controls (#6532)

Jacob Beckerman7dde5b733303
diff --git a/apps/web/src/components/app/PreviewPanel.tsx b/apps/web/src/components/app/PreviewPanel.tsx
index 28d38169ba..37b0c156c9 100644
--- a/apps/web/src/components/app/PreviewPanel.tsx
+++ b/apps/web/src/components/app/PreviewPanel.tsx
@@ -33,6 +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 {
createPriorityCollapseController,
PriorityCollapseOverflowSensor,
@@ -269,6 +270,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" />
<Show when={props.headerLeading}>
<div class="flex shrink-0 items-center">{props.headerLeading}</div>
</Show>
diff --git a/apps/web/src/components/app/side-panel/SidePanel.tsx b/apps/web/src/components/app/side-panel/SidePanel.tsx
index 5b106568fd..035811c66a 100644
--- a/apps/web/src/components/app/side-panel/SidePanel.tsx
+++ b/apps/web/src/components/app/side-panel/SidePanel.tsx
@@ -1,4 +1,5 @@
import { usePreference } from '@app/preferences/use-preference';
+import { useMaybeBlockAliasedName } from '@core/block';
import { Resize, ResizeZoneContext } from '@core/component/Resize/Resize';
import { registerHotkey } from '@core/hotkey/hotkeys';
import { TOKENS } from '@core/hotkey/tokens';
@@ -9,6 +10,7 @@ import ArrowLeft from '@phosphor/arrow-left.svg';
import CaretRight from '@phosphor/caret-right.svg';
import CircleDashedEmpty from '@phosphor/circle-dashed.svg';
import InfoIcon from '@phosphor/info.svg';
+import ListIcon from '@phosphor/list.svg';
import SidePanelIcon from '@phosphor/sidebar-simple.svg';
import { Button, Panel, Scroll } from '@ui';
import { cn } from '@ui/utils/classname';
@@ -29,7 +31,10 @@ import {
useContext,
} from 'solid-js';
import { HeaderIsland } from '../split-layout/components/HeaderIsland';
-import { SplitHeaderRight } from '../split-layout/components/SplitHeader';
+import {
+ SplitHeaderLeft,
+ SplitHeaderRight,
+} from '../split-layout/components/SplitHeader';
import { useSplitPanel } from '../split-layout/layoutUtils';
import {
SidePanelContext,
@@ -71,13 +76,19 @@ function createWideOpenState(
function Root(
props: ParentProps<{ defaultOpen?: boolean; persistKey?: string }>
) {
+ const splitPanel = useSplitPanel();
+ const content = splitPanel?.handle.content();
+ const persistKey =
+ props.persistKey ??
+ useMaybeBlockAliasedName() ??
+ (content?.type === 'component' ? content.id : content?.type);
const [sections, setSections] = createSignal<SidePanelSectionEntry[]>([]);
const [openIds, setOpenIds] = createSignal<string[]>([]);
// Independent open state per mode so wide and narrow can have different
// defaults (and the user's preference in one mode doesn't bleed into the
// other after a resize).
const [isWideOpen, setIsWideOpen] = createWideOpenState(
- props.persistKey,
+ persistKey,
props.defaultOpen ?? true
);
const [isNarrowOpen, setIsNarrowOpen] = createSignal(false);
@@ -113,7 +124,6 @@ function Root(
};
const hasSections = createMemo(() => sections().length > 0);
- const splitPanel = useSplitPanel();
if (splitPanel?.splitHotkeyScope) {
registerHotkey({
hotkey: ']',
@@ -250,7 +260,18 @@ function SidePanelLayoutInner(
maxSize={SIDE_MAX_PX}
index={1}
>
- <div class={'relative size-full z-split-panel-chrome'}>
+ <div class="relative flex size-full min-h-0 flex-col z-split-panel-chrome">
+ <div class="flex h-12 shrink-0 items-center justify-between border-b border-edge-muted px-4">
+ <span class="text-sm font-semibold text-ink">Details</span>
+ <Button
+ variant="ghost"
+ size="icon-sm"
+ label="Hide side panel"
+ onClick={() => props.setIsOpen(false)}
+ >
+ <SidePanelIcon class="size-4" />
+ </Button>
+ </div>
<SidePanelOutlet
sections={props.sections}
openIds={props.openIds}
@@ -329,6 +350,7 @@ function Toggle() {
}
function SidePanelHeaderToggle() {
+ const panel = useSplitPanel();
const ctx = useContext(SidePanelContext);
if (!ctx) {
throw new Error('<SidePanelHeaderToggle> must be inside <SidePanel.Root>');
@@ -336,18 +358,36 @@ function SidePanelHeaderToggle() {
return (
<Show when={ctx.hasSections()}>
- <SplitHeaderRight>
- <div class="order-last flex items-center">
- <HeaderIsland
- class={cn(
- 'size-10 justify-center !px-0',
- ctx.isOpen() && 'text-accent'
- )}
- >
- <Toggle />
- </HeaderIsland>
- </div>
- </SplitHeaderRight>
+ <Show when={!isTouchDevice() && !panel?.isInlinePreview && !ctx.isOpen()}>
+ <SplitHeaderLeft>
+ <div class="order-first flex shrink-0 items-center">
+ <Button
+ variant="ghost"
+ size="icon-sm"
+ label="Show side panel"
+ aria-label="Show side panel"
+ aria-expanded={false}
+ onClick={() => ctx.setIsOpen(true)}
+ >
+ <ListIcon class="size-4" />
+ </Button>
+ </div>
+ </SplitHeaderLeft>
+ </Show>
+ <Show when={isTouchDevice() || panel?.isInlinePreview}>
+ <SplitHeaderRight>
+ <div class="order-last flex items-center">
+ <HeaderIsland
+ class={cn(
+ 'size-10 justify-center !px-0',
+ ctx.isOpen() && 'text-accent'
+ )}
+ >
+ <Toggle />
+ </HeaderIsland>
+ </div>
+ </SplitHeaderRight>
+ </Show>
</Show>
);
}
diff --git a/apps/web/src/components/view-shell/SidebarCreateButton.tsx b/apps/web/src/components/view-shell/SidebarCreateButton.tsx
index bf9b444a2e..6fe2b6f2cb 100644
--- a/apps/web/src/components/view-shell/SidebarCreateButton.tsx
+++ b/apps/web/src/components/view-shell/SidebarCreateButton.tsx
@@ -10,6 +10,7 @@ export function SidebarCreateHeader(props: {
label: string;
onCreate: () => void;
actions?: JSX.Element;
+ titleActions?: JSX.Element;
}) {
return (
<header class="flex shrink-0 flex-col">
@@ -18,6 +19,7 @@ export function SidebarCreateHeader(props: {
<div class="flex min-w-0 items-center gap-1">
<SplitPanel.CloseButton class="shrink-0" />
<ViewSidebar.Title>{props.title}</ViewSidebar.Title>
+ {props.titleActions}
</div>
{props.actions}
</ViewSidebar.Header>
diff --git a/apps/web/src/components/view-shell/ViewShell.test.tsx b/apps/web/src/components/view-shell/ViewShell.test.tsx
new file mode 100644
index 0000000000..c95c509207
--- /dev/null
+++ b/apps/web/src/components/view-shell/ViewShell.test.tsx
@@ -0,0 +1,140 @@
+import {
+ cleanup,
+ fireEvent,
+ render,
+ screen,
+ within,
+} from '@solidjs/testing-library';
+import { type JSX, onMount } from 'solid-js';
+import { afterEach, beforeEach, expect, it, vi } from 'vitest';
+import { ViewShell } from './ViewShell';
+import { ViewSidebar } from './ViewSidebar';
+
+const measurement = vi.hoisted(() => ({ width: 1000 }));
+vi.mock('@solid-primitives/resize-observer', () => ({
+ createElementSize: () => measurement,
+}));
+vi.mock('@core/component/Resize', () => ({
+ Resize: {
+ Zone: (props: { children: JSX.Element }) => <div>{props.children}</div>,
+ Panel: (props: { children: JSX.Element; collapsed?: () => boolean }) => (
+ <div hidden={props.collapsed?.()}>{props.children}</div>
+ ),
+ },
+}));
+vi.mock('@ui', async () => ({
+ ...(await import('../ui/utils/classname')),
+ Button: (
+ props: JSX.ButtonHTMLAttributes<HTMLButtonElement> & { label?: string }
+ ) => (
+ <button
+ aria-label={props.label}
+ aria-expanded={props['aria-expanded']}
+ onClick={props.onClick}
+ >
+ {props.children}
+ </button>
+ ),
+}));
+
+beforeEach(() => {
+ const values = new Map<string, string>();
+ vi.stubGlobal('localStorage', {
+ getItem: (key: string) => values.get(key) ?? null,
+ setItem: (key: string, value: string) => values.set(key, value),
+ removeItem: (key: string) => values.delete(key),
+ });
+ measurement.width = 1000;
+});
+afterEach(() => {
+ cleanup();
+ vi.unstubAllGlobals();
+});
+
+function Workspace(props: { app: string; mounted?: () => void }) {
+ function Content() {
+ onMount(() => props.mounted?.());
+ return <input aria-label={`${props.app} draft`} />;
+ }
+ return (
+ <section aria-label={props.app}>
+ <ViewShell.Root asidePreferenceKey={props.app}>
+ <ViewShell.Aside>
+ <ViewSidebar.Header>
+ <ViewSidebar.Title>{props.app}</ViewSidebar.Title>
+ </ViewSidebar.Header>
+ </ViewShell.Aside>
+ <ViewShell.Main>
+ <ViewShell.TopBar>
+ <h1>Selected item</h1>
+ </ViewShell.TopBar>
+ <Content />
+ </ViewShell.Main>
+ </ViewShell.Root>
+ </section>
+ );
+}
+
+it('hides only the owning split and keeps the current item mounted', () => {
+ const mounted = vi.fn();
+ render(() => (
+ <>
+ <Workspace app="email" mounted={mounted} />
+ <Workspace app="tasks" />
+ </>
+ ));
+ const email = within(screen.getByRole('region', { name: 'email' }));
+ const tasks = within(screen.getByRole('region', { name: 'tasks' }));
+ fireEvent.input(email.getByRole('textbox'), {
+ target: { value: 'Unsent draft' },
+ });
+ fireEvent.click(email.getByRole('button', { name: 'Hide navigation' }));
+ expect(email.queryByRole('button', { name: 'Hide navigation' })).toBeNull();
+ expect(tasks.getByRole('button', { name: 'Hide navigation' })).toBeTruthy();
+ fireEvent.click(email.getByRole('button', { name: 'Show navigation' }));
+ expect((email.getByRole('textbox') as HTMLInputElement).value).toBe(
+ 'Unsent draft'
+ );
+ expect(mounted).toHaveBeenCalledTimes(1);
+});
+
+it('restores visibility per app after remount and persists reopening', () => {
+ const first = render(() => <Workspace app="email" />);
+ fireEvent.click(screen.getByRole('button', { name: 'Hide navigation' }));
+ first.unmount();
+ const second = render(() => (
+ <>
+ <Workspace app="email" />
+ <Workspace app="calendar" />
+ </>
+ ));
+ expect(
+ within(screen.getByRole('region', { name: 'calendar' })).getByRole(
+ 'button',
+ { name: 'Hide navigation' }
+ )
+ ).toBeTruthy();
+ fireEvent.click(screen.getByRole('button', { name: 'Show navigation' }));
+ second.unmount();
+ render(() => <Workspace app="email" />);
+ expect(screen.getByRole('button', { name: 'Hide navigation' })).toBeTruthy();
+});
+
+it('reopens automatic narrow collapse as a dismissible overlay', () => {
+ measurement.width = 600;
+ render(() => <Workspace app="documents" />);
+ fireEvent.click(screen.getByRole('button', { name: 'Show navigation' }));
+ expect(screen.getByRole('button', { name: 'Hide navigation' })).toBeTruthy();
+ fireEvent.keyDown(screen.getByRole('button', { name: 'Hide navigation' }), {
+ key: 'Escape',
+ });
+ expect(screen.getByRole('button', { name: 'Show navigation' })).toBeTruthy();
+ fireEvent.click(screen.getByRole('button', { name: 'Show navigation' }));
+ fireEvent.click(
+ screen.getByRole('button', { name: 'Close navigation backdrop' })
+ );
+ expect(screen.getByRole('button', { name: 'Show navigation' })).toBeTruthy();
+ expect(
+ screen.queryByRole('button', { name: 'Close navigation backdrop' })
+ ).toBeNull();
+});
diff --git a/apps/web/src/components/view-shell/ViewShell.tsx b/apps/web/src/components/view-shell/ViewShell.tsx
index 6441aa8a8e..f017aee496 100644
--- a/apps/web/src/components/view-shell/ViewShell.tsx
+++ b/apps/web/src/components/view-shell/ViewShell.tsx
@@ -1,11 +1,14 @@
+import { usePreference } from '@app/preferences/use-preference';
import {
type BreakpointAccessors,
type BreakpointThresholds,
createSizeBreakpoints,
} from '@app/util/create-size-breakpoints';
import { Resize } from '@core/component/Resize';
+import ListIcon from '@phosphor/list.svg';
+import SidebarIcon from '@phosphor/sidebar-simple.svg';
import { createElementSize } from '@solid-primitives/resize-observer';
-import { cn } from '@ui';
+import { Button, cn } from '@ui';
import {
type Accessor,
createContext,
@@ -42,6 +45,10 @@ export type ViewShellLayout = {
layout: Accessor<AsideLayout>;
mode: Accessor<AsideMode>;
isCollapsed: Accessor<boolean>;
+ canCollapse: Accessor<boolean>;
+ isOverlay: Accessor<boolean>;
+ collapse: () => void;
+ expand: () => void;
};
main: {
layout: Accessor<MainLayout>;
@@ -104,6 +111,8 @@ export type ViewShellRootProps = Omit<
resizable?: boolean;
/** Set to false when the workspace has no navigation region. */
aside?: false | Partial<AsideLayout>;
+ /** Sticky navigation visibility, scoped to this app type rather than an entry. */
+ asidePreferenceKey?: string;
main?: Partial<MainLayout>;
detail?: Partial<DetailLayout>;
/** Controlled detail open state. Omit for uncontrolled. */
@@ -126,6 +135,7 @@ function Root(props: ViewShellRootProps) {
'layoutBreakpoint',
'resizable',
'aside',
+ 'asidePreferenceKey',
'main',
'detail',
'detailOpen',
@@ -133,6 +143,13 @@ function Root(props: ViewShellRootProps) {
'onDetailOpenChange',
]);
+ const [asideCollapsed, setAsideCollapsed] = local.asidePreferenceKey
+ ? usePreference(
+ `macro:pref:view-sidebar:collapsed:${local.asidePreferenceKey}`,
+ { default: false }
+ )
+ : createSignal(false);
+ const [narrowAsideOpen, setNarrowAsideOpen] = createSignal(false);
const id = createUniqueId();
const [root, setRoot] = createSignal<HTMLDivElement>();
const size = createElementSize(root);
@@ -188,14 +205,20 @@ function Root(props: ViewShellRootProps) {
};
const asideMode = (): AsideMode =>
- local.aside === false || atLayoutBreakpoint() ? 'collapsed' : 'docked';
+ local.aside === false ||
+ asideCollapsed() ||
+ (atLayoutBreakpoint() && !narrowAsideOpen())
+ ? 'collapsed'
+ : 'docked';
+ const asideOverlay = () => atLayoutBreakpoint() && asideMode() === 'docked';
const canFitInlineDetail = () => {
const currentWidth = width();
if (currentWidth === undefined) return false;
- const asideMin = asideMode() === 'docked' ? asideLayout().min : 0;
- const panelCount = asideMode() === 'docked' ? 3 : 2;
+ const asideMin =
+ asideMode() === 'docked' && !asideOverlay() ? asideLayout().min : 0;
+ const panelCount = asideMode() === 'docked' && !asideOverlay() ? 3 : 2;
const minimumWidth =
asideMin +
mainLayout().min +
@@ -220,6 +243,17 @@ function Root(props: ViewShellRootProps) {
layout: asideLayout,
mode: asideMode,
isCollapsed: () => asideMode() === 'collapsed',
+ canCollapse: () =>
+ local.asidePreferenceKey !== undefined && local.aside !== false,
+ isOverlay: asideOverlay,
+ collapse: () => {
+ setAsideCollapsed(true);
+ setNarrowAsideOpen(false);
+ },
+ expand: () => {
+ setAsideCollapsed(false);
+ setNarrowAsideOpen(true);
+ },
},
main: {
layout: mainLayout,
@@ -303,24 +337,104 @@ function Aside(props: ViewShellAsideProps) {
};
return (
- <Resize.Panel
- id={`${ws.id}-aside`}
- index={0}
- minSize={ws.aside.layout().min}
- maxSize={ws.aside.layout().max}
- redistributionPreferredSize={redistributionPreferredSize()}
- target={{ kind: 'px', px: ws.aside.layout().width }}
- collapsed={() => ws.aside.isCollapsed()}
- onSizeChangeEnd={local.onWidthChangeEnd}
+ <Show
+ when={ws.aside.isOverlay()}
+ fallback={
+ <Resize.Panel
+ id={`${ws.id}-aside`}
+ index={0}
+ minSize={ws.aside.layout().min}
+ maxSize={ws.aside.layout().max}
+ redistributionPreferredSize={redistributionPreferredSize()}
+ target={{ kind: 'px', px: ws.aside.layout().width }}
+ collapsed={() => ws.aside.isCollapsed()}
+ onSizeChangeEnd={local.onWidthChangeEnd}
+ >
+ <div
+ {...rest}
+ class={cn('size-full min-h-0 min-w-0', local.class)}
+ data-view-shell-aside=""
+ >
+ {local.children}
+ </div>
+ </Resize.Panel>
+ }
>
<div
- {...rest}
- class={cn('size-full min-h-0 min-w-0', local.class)}
- 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
+ )}
+ style={{ width: `${ws.aside.layout().width}px` }}
+ data-view-shell-aside=""
+ >
+ {local.children}
+ </div>
</div>
- </Resize.Panel>
+ </Show>
+ );
+}
+
+/** Safe outside a shell so block preview headers can share this control. */
+export function ViewSidebarToggle(props: { action: 'collapse' | 'expand' }) {
+ const ws = useContext(ViewShellContext);
+ const visible = () =>
+ ws?.aside.canCollapse() &&
+ (props.action === 'expand'
+ ? ws.aside.isCollapsed()
+ : !ws.aside.isCollapsed());
+ return (
+ <Show when={visible()}>
+ <Button
+ variant="ghost"
+ size="icon-sm"
+ class={cn(
+ 'shrink-0 touch:hidden',
+ props.action === 'collapse' && 'ml-auto'
+ )}
+ label={
+ props.action === 'expand' ? 'Show navigation' : 'Hide navigation'
+ }
+ aria-expanded={props.action !== 'expand'}
+ data-view-sidebar-toggle={props.action}
+ onClick={(event) => {
+ const shell = event.currentTarget.closest('[data-view-shell]');
+ if (props.action === 'expand') ws?.aside.expand();
+ else ws?.aside.collapse();
+ const nextAction = props.action === 'expand' ? 'collapse' : 'expand';
+ queueMicrotask(() =>
+ shell
+ ?.querySelector<HTMLButtonElement>(
+ `[data-view-sidebar-toggle="${nextAction}"]`
+ )
+ ?.focus()
+ );
+ }}
+ >
+ <Show
+ when={props.action === 'expand'}
+ fallback={<SidebarIcon class="size-4" />}
+ >
+ <ListIcon class="size-4" />
+ </Show>
+ </Button>
+ </Show>
);
}
@@ -366,6 +480,7 @@ function TopBar(props: JSX.HTMLAttributes<HTMLDivElement>) {
)}
data-view-shell-top-bar=""
>
+ <ViewSidebarToggle action="expand" />
{local.children}
</div>
);
diff --git a/apps/web/src/components/view-shell/ViewSidebar.tsx b/apps/web/src/components/view-shell/ViewSidebar.tsx
index 9987a6b074..ac2f34a641 100644
--- a/apps/web/src/components/view-shell/ViewSidebar.tsx
+++ b/apps/web/src/components/view-shell/ViewSidebar.tsx
@@ -1,6 +1,7 @@
import { cn, NavRow, type NavRowProps } from '@ui';
import type { JSX } from 'solid-js';
import { splitProps } from 'solid-js';
+import { ViewSidebarToggle } from './ViewShell';
function Root(props: JSX.HTMLAttributes<HTMLElement>) {
const [local, rest] = splitProps(props, ['children', 'class']);
@@ -27,6 +28,7 @@ function Header(props: JSX.HTMLAttributes<HTMLDivElement>) {
data-view-sidebar-header=""
>
{local.children}
+ <ViewSidebarToggle action="collapse" />
</div>
);
}
diff --git a/apps/web/src/features/agents-view/components/AgentSessionPane.tsx b/apps/web/src/features/agents-view/components/AgentSessionPane.tsx
index ce07e7bf11..12e2add197 100644
--- a/apps/web/src/features/agents-view/components/AgentSessionPane.tsx
+++ b/apps/web/src/features/agents-view/components/AgentSessionPane.tsx
@@ -1,3 +1,4 @@
+import { ViewSidebarToggle } from '@app/components/view-shell/ViewShell';
import { AgentComposer } from '@app/features/block-agent/component/AgentComposer';
import { AgentPullRequestChip } from '@app/features/block-agent/component/AgentPullRequestChip';
import { Transcript } from '@app/features/block-agent/component/Transcript';
@@ -19,7 +20,8 @@ function AgentSessionContent() {
return (
<>
<header class="flex h-12 shrink-0 items-center justify-between gap-3 border-b border-edge px-4">
- <h2 class="min-w-0 truncate text-sm font-semibold text-ink">
+ <ViewSidebarToggle action="expand" />
+ <h2 class="min-w-0 flex-1 truncate text-sm font-semibold text-ink">
{metadata()?.title ?? session()?.name ?? 'New Chat'}
</h2>
<Show when={session()?.pullRequestUrl}>
diff --git a/apps/web/src/features/agents-view/views/AgentsView.tsx b/apps/web/src/features/agents-view/views/AgentsView.tsx
index 3f8d4af728..7ff7a67b31 100644
--- a/apps/web/src/features/agents-view/views/AgentsView.tsx
+++ b/apps/web/src/features/agents-view/views/AgentsView.tsx
@@ -129,6 +129,7 @@ function AgentsWorkspace() {
<SplitPanel.Root>
<SplitPanel.Body>
<ViewShell.Root
+ asidePreferenceKey="agents"
class="bg-panel"
resizable
aside={{
diff --git a/apps/web/src/features/channels-view/channels-view.tsx b/apps/web/src/features/channels-view/channels-view.tsx
index d63ea7273f..09b7d2e1ac 100644
--- a/apps/web/src/features/channels-view/channels-view.tsx
+++ b/apps/web/src/features/channels-view/channels-view.tsx
@@ -121,6 +121,7 @@ function ChannelsViewRoot() {
fallback={
<div ref={setWorkspace} class="size-full min-h-0 bg-panel">
<ViewShell.Root
+ asidePreferenceKey="channels"
aside={railLayout()}
breakpoints={{ collapsed: 0 }}
layoutBreakpoint="collapsed"
@@ -144,17 +145,22 @@ function ChannelsViewRoot() {
<Show
when={selectedChannel()}
fallback={
- <div class="flex size-full items-center justify-center px-6 text-center">
- <div class="flex max-w-sm flex-col gap-2">
- <h2 class="text-base font-semibold text-ink">
- Select a conversation
- </h2>
- <p class="text-sm leading-5 text-ink-muted">
- Choose a channel or person from the sidebar to
- open the conversation here.
- </p>
+ <>
+ <ViewShell.TopBar>
+ <span class="text-sm font-semibold">Chat</span>
+ </ViewShell.TopBar>
+ <div class="flex min-h-0 flex-1 items-center justify-center px-6 text-center">
+ <div class="flex max-w-sm flex-col gap-2">
+ <h2 class="text-base font-semibold text-ink">
+ Select a conversation
+ </h2>
+ <p class="text-sm leading-5 text-ink-muted">
+ Choose a channel or person from the sidebar to
+ open the conversation here.
+ </p>
+ </div>
</div>
- </div>
+ </>
}
>
{(channel) => (
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 28658061cd..80ab0df42f 100644
--- a/apps/web/src/features/channels-view/components/rail/ExpandedChannelsRail.tsx
+++ b/apps/web/src/features/channels-view/components/rail/ExpandedChannelsRail.tsx
@@ -58,7 +58,6 @@ import {
RailListError,
RailListLoading,
RailListLoadingMore,
- RailModeButton,
} from './ChannelsRailSection';
import {
useChannelRailFavoriteItemState,
@@ -347,9 +346,6 @@ function ExpandedHeader(props: { search: ChannelRailSearch }) {
<SplitPanel.CloseButton />
<ViewSidebar.Title>Chat</ViewSidebar.Title>
</div>
- <SplitPanel.ControlGroup>
- <RailModeButton expanded onToggle={() => rail.setMode('slim')} />
- </SplitPanel.ControlGroup>
</ViewSidebar.Header>
<div class="flex items-center justify-between gap-2 px-4">
<Tabs
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 f232c6efbf..2e4489ddad 100644
--- a/apps/web/src/features/channels-view/components/rail/SlimChannelsRail.tsx
+++ b/apps/web/src/features/channels-view/components/rail/SlimChannelsRail.tsx
@@ -1,3 +1,4 @@
+import { ViewSidebarToggle } from '@app/components/view-shell/ViewShell';
import { runCreateAction } from '@app/features/command/Launcher';
import { FavoriteIcon } from '@app/features/favorites/FavoriteIcon';
import { DEBUG_SETTING_KEYS, useDebugSetting } from '@app/lib/debugSettings';
@@ -385,6 +386,7 @@ function SlimHeader() {
<div class="flex w-full items-center justify-center px-2">
<SplitPanel.ControlGroup>
<SplitPanel.CloseButton size="icon-sm" />
+ <ViewSidebarToggle action="collapse" />
</SplitPanel.ControlGroup>
</div>
<div class="flex h-8 w-full items-center justify-center px-2">
diff --git a/apps/web/src/features/companies/views/CrmWorkspace.tsx b/apps/web/src/features/companies/views/CrmWorkspace.tsx
index e59ad88135..4b9c8a79ff 100644
--- a/apps/web/src/features/companies/views/CrmWorkspace.tsx
+++ b/apps/web/src/features/companies/views/CrmWorkspace.tsx
@@ -25,7 +25,7 @@ import { enableCrmLists } from '@core/constant/featureFlags';
import { useSettingsState } from '@core/constant/SettingsState';
import { useUserId } from '@core/context/user';
import { type EntityData, isCrmCompanyEntity } from '@entity';
-import SidebarIcon from '@phosphor/sidebar-simple.svg';
+import ListIcon from '@phosphor/list.svg';
import { fetchCrmExportCompanies } from '@queries/crm/export';
import { useCrmLists } from '@queries/crm/lists';
import { useQuickAccessCrmCompaniesQuery } from '@queries/soup/quick-access-crm-companies';
@@ -63,7 +63,7 @@ function NavigationToggle(props: {
label="Expand CRM sidebar"
onClick={props.onExpand}
>
- <SidebarIcon class="size-4" />
+ <ListIcon class="size-4" />
</Button>
</Tooltip>
}
@@ -75,7 +75,7 @@ function NavigationToggle(props: {
size="icon-sm"
aria-label="Show CRM navigation"
>
- <SidebarIcon class="size-4" />
+ <ListIcon class="size-4" />
</Dropdown.Trigger>
</Tooltip>
<Dropdown.Content class="w-55 max-h-[80vh] overflow-auto p-0">
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 e19c7fd529..5c63a3ad23 100644
--- a/apps/web/src/features/drive-view/views/drive-layout.tsx
+++ b/apps/web/src/features/drive-view/views/drive-layout.tsx
@@ -187,6 +187,7 @@ export function DriveLayout(props: {
<SplitPanel.Root>
<SplitPanel.Body>
<ViewShell.Root
+ asidePreferenceKey="documents"
resizable
aside={{ preserveDuringResize: false }}
main={{ preferredWidth: 640 }}
diff --git a/apps/web/src/features/email-view/email-view.tsx b/apps/web/src/features/email-view/email-view.tsx
index 410f9899d1..31929803d9 100644
--- a/apps/web/src/features/email-view/email-view.tsx
+++ b/apps/web/src/features/email-view/email-view.tsx
@@ -74,6 +74,7 @@ function EmailDesktopLayout(
return (
<ViewShell.Root
+ asidePreferenceKey="email"
resizable
aside={{ preserveDuringResize: false }}
main={{ preferredWidth: 640 }}
diff --git a/apps/web/src/features/inbox-view/components/HomeChatStart.tsx b/apps/web/src/features/inbox-view/components/HomeChatStart.tsx
index 024b465545..af4df3e2a4 100644
--- a/apps/web/src/features/inbox-view/components/HomeChatStart.tsx
+++ b/apps/web/src/features/inbox-view/components/HomeChatStart.tsx
@@ -1,12 +1,20 @@
+import { useViewShell, ViewShell } from '@app/components/view-shell';
import { DragDropWrapper } from '@core/component/AI/component/DragDrop';
import { ChatInputProvider } from '@core/component/AI/context';
+import { Show } from 'solid-js';
import { HomeRecommendedActions } from '../../home/components/home-recommended-actions';
import { HomeChatInput } from '../../home/home-chat-input';
/** Desktop Home's idle pane uses the single-line chat composer and send flow. */
export function HomeChatStart() {
+ const shell = useViewShell();
return (
<ChatInputProvider>
+ <Show when={shell.aside.isCollapsed()}>
+ <ViewShell.TopBar>
+ <span class="text-sm font-semibold">Home</span>
+ </ViewShell.TopBar>
+ </Show>
<DragDropWrapper class="relative size-full min-h-0 min-w-0 overflow-y-auto px-6">
<div class="mx-auto grid h-full min-h-64 min-w-0 w-full max-w-180 grid-cols-1 grid-rows-[1fr_auto_1fr] pb-16">
<h1 class="mb-6 min-h-0 min-w-0 self-end text-center text-2xl font-normal leading-[42px] text-ink">
diff --git a/apps/web/src/features/inbox-view/components/InboxHeader.tsx b/apps/web/src/features/inbox-view/components/InboxHeader.tsx
index 0925e8fc8b..9aa2984737 100644
--- a/apps/web/src/features/inbox-view/components/InboxHeader.tsx
+++ b/apps/web/src/features/inbox-view/components/InboxHeader.tsx
@@ -32,7 +32,7 @@ export function InboxListLayout(
title="Home"
label="New chat"
onCreate={props.onNewChat}
- actions={<InboxFilterDropdown />}
+ titleActions={<InboxFilterDropdown />}
/>
}
>
diff --git a/apps/web/src/features/inbox-view/inbox-view.tsx b/apps/web/src/features/inbox-view/inbox-view.tsx
index 032b6fbc87..fc462005c7 100644
--- a/apps/web/src/features/inbox-view/inbox-view.tsx
+++ b/apps/web/src/features/inbox-view/inbox-view.tsx
@@ -76,6 +76,7 @@ function InboxViewRoot() {
fallback={
<div class="size-full min-h-0 bg-panel">
<ViewShell.Root
+ asidePreferenceKey="inbox"
aside={{
width: 256,
min: 224,
diff --git a/apps/web/src/features/tasks-view/tasks-view.tsx b/apps/web/src/features/tasks-view/tasks-view.tsx
index 5159b7176e..33b61d24a0 100644
--- a/apps/web/src/features/tasks-view/tasks-view.tsx
+++ b/apps/web/src/features/tasks-view/tasks-view.tsx
@@ -71,6 +71,7 @@ function TasksViewRoot() {
<SplitPanel.Root>
<SplitPanel.Body>
<ViewShell.Root
+ asidePreferenceKey="tasks"
resizable
aside={{ preserveDuringResize: false }}
main={{ preferredWidth: 640 }}
diff --git a/docs/AGENT_GUIDE/channels.md b/docs/AGENT_GUIDE/channels.md
index 4450cb6bda..acbe0eb6e2 100644
--- a/docs/AGENT_GUIDE/channels.md
+++ b/docs/AGENT_GUIDE/channels.md
@@ -244,6 +244,11 @@ a channel cached away from its latest page, and a delta longer than one page use
## Chat navigation rail
+The title bar's **Hide navigation** control hides the whole rail. Reopen it with
+**Show navigation** (the hamburger) immediately before the conversation title,
+or in the Chat header when no conversation is selected. Chat remembers this
+choice independently of other apps and restores it after reload.
+
On desktop, the Chat rail has `All` and `Recent` tabs. All contains an
optional `Favorites` section above the independently paginated `Channels` and
`DMs` sections. It appears when the user has channel favorites and only lists
diff --git a/docs/AGENT_GUIDE/navigation.md b/docs/AGENT_GUIDE/navigation.md
index ebdd58b85c..f0257a3233 100644
--- a/docs/AGENT_GUIDE/navigation.md
+++ b/docs/AGENT_GUIDE/navigation.md
@@ -28,6 +28,17 @@ 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.
+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.
+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
+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.
+
Split focus mode (`Shift+Esc`) floats the active split in a rounded, bordered
panel over the same glass scrim as dialogs. Click the scrim or use the shortcut
again to restore the split layout.