Macro is a unified workspace for teams: email, chat, docs, tasks, agents, calls, and CRM — @-linked together with shared AI memory.
TypeScript agentaiai-agentsall-in-onecrmcrm-systememaillinearmcpmessagingnotesnotionofficerustslackslack-alternativestartupstartup-toolstypescriptworkspace
fix(app-views): home breadcrumb and narrow split, not narrow chats rail (#6573)
Seamus2ecd4bfd8f80
diff --git a/apps/web/src/components/app/PreviewPanel.tsx b/apps/web/src/components/app/PreviewPanel.tsxindex 1a517389fe..d6c12715eb 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 { ViewNavigationControls } from '../view-shell/ViewShell';+import { ViewShell } from '../view-shell/ViewShell';import {createPriorityCollapseController,PriorityCollapseOverflowSensor,@@ -287,11 +287,10 @@ function PreviewPanelContent(onPointerDown={() => setInteractedWith(true)}tabIndex={-1}>- <div+ <ViewShell.TopBarref={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]"+ class="relative w-full py-0 touch:flex">- <ViewNavigationControls /><Show when={props.headerLeading}><div class="flex shrink-0 items-center">{props.headerLeading}</div></Show>@@ -299,7 +298,11 @@ function PreviewPanelContent(controller={headerCollapseController}truncateAsLastResortclass="relative h-full min-w-0 shrink overflow-hidden"- contentClass="flex h-full items-center gap-1"+ contentClass={+ props.headerLeading+ ? 'flex h-full items-center gap-1 pl-0.5'+ : 'flex h-full items-center gap-1'+ }contentRef={(element) => {scopedLayoutRefs.headerLeft = element;}}@@ -310,7 +313,7 @@ function PreviewPanelContent(scopedLayoutRefs.headerRight = ref;}}/>- </div>+ </ViewShell.TopBar><divref={toolbarCollapseController.setRow}class="relative flex min-h-0 w-full shrink-0 items-center justify-between px-2"diff --git a/apps/web/src/components/app/split-layout/components/SplitLabel.tsx b/apps/web/src/components/app/split-layout/components/SplitLabel.tsxindex 2f65522e86..e5ba79189b 100644--- a/apps/web/src/components/app/split-layout/components/SplitLabel.tsx+++ b/apps/web/src/components/app/split-layout/components/SplitLabel.tsx@@ -78,7 +78,7 @@ export function StaticSplitLabel(props: {<HeaderIsland class="shrink" onClick={openTitleFileMenu}><divclass={cn(- 'z-split-header-content relative flex items-center gap-2 max-w-full h-full shrink',+ 'z-split-header-content relative flex items-center gap-1.5 max-w-full h-full shrink',props.class)}>@@ -91,7 +91,9 @@ export function StaticSplitLabel(props: {/></Show><Show when={props.icon}>- <div class="shrink-0">{props.icon}</div>+ <div class="flex shrink-0 items-center justify-center">+ {props.icon}+ </div></Show><Show when={props.badges}>{props.badges}</Show><span class="inline-flex min-w-0 items-center gap-1">diff --git a/apps/web/src/components/view-shell/ViewSidebar.tsx b/apps/web/src/components/view-shell/ViewSidebar.tsxindex e261260315..396ab9ed58 100644--- a/apps/web/src/components/view-shell/ViewSidebar.tsx+++ b/apps/web/src/components/view-shell/ViewSidebar.tsx@@ -44,7 +44,10 @@ function Title(props: JSX.HTMLAttributes<HTMLHeadingElement>) {return (<h1{...rest}- class={cn('min-w-0 truncate text-sm font-semibold text-ink', local.class)}+ class={cn(+ 'min-w-0 truncate text-sm font-semibold tracking-[-0.03em] text-ink',+ local.class+ )}>{local.children}</h1>diff --git a/apps/web/src/features/channels-view/channels-view-context.tsx b/apps/web/src/features/channels-view/channels-view-context.tsxindex f896fc0153..9c7dd875ae 100644--- a/apps/web/src/features/channels-view/channels-view-context.tsx+++ b/apps/web/src/features/channels-view/channels-view-context.tsx@@ -6,7 +6,6 @@ import type { ContextProviderProps } from '@solid-primitives/context';import { createStore, type Store } from 'solid-js/store';import {CHANNELS_DEFAULT_RAIL_WIDTH,- CHANNELS_DEFAULT_SLIM_GROUPS,CHANNELS_DEFAULT_SORT_BY,clampChannelsRailWidth,} from './constants';@@ -15,7 +14,6 @@ import type {ChannelListSort,ChannelsGroup,ChannelsQueryScope,- ChannelsRailMode,ChannelsRailSection,ChannelsTab,ChannelsViewState,@@ -33,9 +31,7 @@ export type ChannelsViewContext = {setSelectedChannelId: (channelId: string | undefined) => void;setGroupOpen: (group: ChannelsRailSection, open: boolean) => void;setSortBy: (group: ChannelsGroup, sort: ChannelListSort) => void;- setSlimGroupEnabled: (group: ChannelsGroup, enabled: boolean) => void;setAsideWidth: (width: number) => void;- setRailMode: (mode: Exclude<ChannelsRailMode, 'auto'>) => void;};function createInitialState(@@ -57,27 +53,14 @@ function createInitialState(initial.sortBy?.direct_messages ??CHANNELS_DEFAULT_SORT_BY.direct_messages,},- slimGroups: {- channels:- initial.slimGroups?.channels ?? CHANNELS_DEFAULT_SLIM_GROUPS.channels,- direct_messages:- initial.slimGroups?.direct_messages ??- CHANNELS_DEFAULT_SLIM_GROUPS.direct_messages,- },asideWidth: clampChannelsRailWidth(initial.asideWidth ?? CHANNELS_DEFAULT_RAIL_WIDTH),- railMode: initial.railMode ?? 'auto',};}function shouldRestorePreferences(initial: ChannelsViewStateOptions): boolean {- return (- initial.asideWidth === undefined &&- initial.railMode === undefined &&- initial.sortBy === undefined &&- initial.slimGroups === undefined- );+ return initial.asideWidth === undefined && initial.sortBy === undefined;}export const [ChannelsViewProvider, useChannelsView] =@@ -106,11 +89,8 @@ export const [ChannelsViewProvider, useChannelsView] =setState('selectedChannelId', channelId),setGroupOpen: (group, open) => setState('expandedGroups', group, open),setSortBy: (group, sort) => setState('sortBy', group, sort),- setSlimGroupEnabled: (group, enabled) =>- setState('slimGroups', group, enabled),setAsideWidth: (width) =>setState('asideWidth', clampChannelsRailWidth(width)),- setRailMode: (mode) => setState('railMode', mode),};});diff --git a/apps/web/src/features/channels-view/channels-view.tsx b/apps/web/src/features/channels-view/channels-view.tsxindex 09b7d2e1ac..26adca517d 100644--- a/apps/web/src/features/channels-view/channels-view.tsx+++ b/apps/web/src/features/channels-view/channels-view.tsx@@ -1,6 +1,5 @@import { ViewShell } from '@app/components/view-shell';import { MaybeSoupEntityActionDrawerManager } from '@app/features/soup';-import { createSizeBreakpoints } from '@app/util/create-size-breakpoints';import { useGlobalBlockOrchestrator } from '@components/app/GlobalAppState';import { PreviewPanel } from '@components/app/PreviewPanel';import { useSplitPanelOrThrow } from '@components/app/split-layout/layoutUtils';@@ -9,16 +8,10 @@ import { StaticMarkdownContext } from '@core/component/LexicalMarkdown/componentimport { isTouchDevice } from '@core/mobile/isTouchDevice';import { ListEntityMetadataQueryProvider } from '@entity';import SpinnerIcon from '@phosphor/spinner.svg';-import { createElementSize } from '@solid-primitives/resize-observer';import { createMemo, createSignal, onMount, Show, Suspense } from 'solid-js';import { ChannelsViewProvider, useChannelsView } from './channels-view-context';import { ChannelsMobileView } from './components/ChannelsMobileView';import { ChannelsRail } from './components/rail/ChannelsRail';-import {- CHANNELS_MAX_RAIL_WIDTH,- CHANNELS_MIN_RAIL_WIDTH,- CHANNELS_NARROW_RAIL_WIDTH,-} from './constants';import {deduplicateChannels,resolveSelectedChannel,@@ -35,33 +28,8 @@ export type ChannelsViewProps = {function ChannelsViewRoot() {const panel = useSplitPanelOrThrow();const orchestrator = useGlobalBlockOrchestrator();- const { state, setAsideWidth, setMobileTab, setRailMode } = useChannelsView();- const [workspace, setWorkspace] = createSignal<HTMLDivElement>();+ const { state, setAsideWidth, setMobileTab } = useChannelsView();const [railSearchOpen, setRailSearchOpen] = createSignal(false);- const workspaceSize = createElementSize(workspace);- const breakpoints = createSizeBreakpoints(- () => workspaceSize.width ?? undefined,- { narrow: 720 }- );- const railMode = () =>- state.railMode === 'auto'- ? breakpoints.narrow()- ? 'slim'- : 'full'- : state.railMode;- const railLayout = () =>- railMode() === 'slim'- ? {- width: CHANNELS_NARROW_RAIL_WIDTH,- min: CHANNELS_NARROW_RAIL_WIDTH,- max: CHANNELS_NARROW_RAIL_WIDTH,- }- : {- width: state.asideWidth,- min: CHANNELS_MIN_RAIL_WIDTH,- max: CHANNELS_MAX_RAIL_WIDTH,- preserveDuringResize: false,- };const sources = useChannelsSources((scope) => {@@ -70,10 +38,7 @@ function ChannelsViewRoot() {if (railSearchOpen()) return scope === 'search';if (scope === 'search') return false;if (scope === 'recents') return state.tab === 'recents';- return (- state.tab === 'browse' &&- (railMode() === 'full' || state.slimGroups[scope])- );+ return state.tab === 'browse';},(group) => state.sortBy[group]);@@ -119,24 +84,19 @@ function ChannelsViewRoot() {<Showwhen={isTouchDevice()}fallback={- <div ref={setWorkspace} class="size-full min-h-0 bg-panel">+ <div class="size-full min-h-0 bg-panel"><ViewShell.RootasidePreferenceKey="channels"- aside={railLayout()}- breakpoints={{ collapsed: 0 }}- layoutBreakpoint="collapsed"- main={{ min: 224, preferredWidth: 640 }}- resizable={railMode() === 'full'}+ aside={{+ width: state.asideWidth,+ preserveDuringResize: false,+ }}+ main={{ preferredWidth: 640 }}+ resizable>- <ViewShell.Aside- onWidthChangeEnd={(width) => {- if (railMode() === 'full') setAsideWidth(width);- }}- >+ <ViewShell.Aside onWidthChangeEnd={setAsideWidth}><ChannelsRailsources={sources}- mode={railMode()}- onModeChange={setRailMode}searchOpen={railSearchOpen()}onSearchOpenChange={setRailSearchOpen}/>@@ -204,7 +164,7 @@ function ChannelsViewRoot() {);}-/** Channels workspace matching the V2 Chat rail experiment. */+/** Chat workspace with shared workspace navigation. */export function ChannelsView(props: ChannelsViewProps) {return (<ChannelsViewProvider initialState={props.initialState}>diff --git a/apps/web/src/features/channels-view/components/rail/ChannelsRail.tsx b/apps/web/src/features/channels-view/components/rail/ChannelsRail.tsxindex d600086ad1..5e30715be6 100644--- a/apps/web/src/features/channels-view/components/rail/ChannelsRail.tsx+++ b/apps/web/src/features/channels-view/components/rail/ChannelsRail.tsx@@ -28,7 +28,6 @@ import {createMemo,createSignal,createUniqueId,- on,onCleanup,} from 'solid-js';import type { VirtualizerHandle } from 'virtua/solid';@@ -39,7 +38,6 @@ import {deduplicateChannels,} from '../../queries';import type {- ChannelsGroup,ChannelsQueryScope,ChannelsRailSection,ChannelsTab,@@ -57,7 +55,6 @@ import {import { ExpandedChannelsRail } from './ExpandedChannelsRail';import { useChannelCalls } from './hooks/useChannelCalls';import { useChannelRailActivity } from './hooks/useChannelRailActivity';-import { SlimChannelsRail } from './SlimChannelsRail';const CHANNEL_RAIL_SECTIONS: ChannelsRailSection[] = ['favorites',@@ -74,8 +71,6 @@ const CHANNEL_SEARCH_FILTERS = {export type ChannelsRailProps = {sources: ChannelsSources;- mode: 'full' | 'slim';- onModeChange: (mode: 'full' | 'slim') => void;searchOpen: boolean;onSearchOpenChange: (open: boolean) => void;};@@ -90,11 +85,7 @@ type ChannelRailItemsByScope = Record<export function buildChannelRailRows(tab: ChannelsTab,expandedGroups: Record<ChannelsRailSection, boolean>,- items: ChannelRailItemsByScope,- options: {- mode: 'full' | 'slim';- slimGroups: Record<ChannelsGroup, boolean>;- }+ items: ChannelRailItemsByScope): ChannelRailRow[] {if (tab === 'recents') {return items.recents.map((channel, localIndex) => ({@@ -127,28 +118,6 @@ export function buildChannelRailRows(}}- if (options.mode === 'slim') {- let virtualIndex = 0;- for (const group of BROWSE_QUERY_SCOPES) {- if (!options.slimGroups[group]) continue;-- rows.push(- ...items[group].map(- (channel, localIndex): ChannelRailRow => ({- kind: 'conversation',- id: `channel:${channel.id}`,- group,- scope: group,- localIndex,- virtualIndex: virtualIndex++,- channel,- })- )- );- }- return rows;- }-rows.push({kind: 'section',id: 'section:channels',@@ -193,14 +162,8 @@ export function buildChannelRailRows(}export function ChannelsRail(props: ChannelsRailProps) {- const {- state,- setGroupOpen,- setSelectedChannelId,- setSlimGroupEnabled,- setSortBy,- setTab,- } = useChannelsView();+ const { state, setGroupOpen, setSelectedChannelId, setSortBy, setTab } =+ useChannelsView();const panel = useSplitPanelOrThrow();const layout = useSplitLayout();@@ -238,7 +201,6 @@ export function ChannelsRail(props: ChannelsRailProps) {};const openSearch = () => {- if (props.mode === 'slim') props.onModeChange('full');props.onSearchOpenChange(true);queueMicrotask(() => searchInput?.focus());};@@ -345,20 +307,12 @@ export function ChannelsRail(props: ChannelsRailProps) {);}- return buildChannelRailRows(- state.tab,- state.expandedGroups,- {- favorites: favorites(),- channels: props.sources.channels.items(),- direct_messages: props.sources.direct_messages.items(),- recents: props.sources.recents.items(),- },- {- mode: props.mode,- slimGroups: state.slimGroups,- }- );+ return buildChannelRailRows(state.tab, state.expandedGroups, {+ favorites: favorites(),+ channels: props.sources.channels.items(),+ direct_messages: props.sources.direct_messages.items(),+ recents: props.sources.recents.items(),+ });});const list = withSplitPanelOwner(listOwnedSlotName('controller'), () =>@@ -415,10 +369,7 @@ export function ChannelsRail(props: ChannelsRailProps) {if (row.kind === 'conversation') {const virtualizer = virtualizers()[row.scope];if (virtualizer) {- virtualizer.scrollToIndex(- row.virtualIndex ?? row.localIndex,- options- );+ virtualizer.scrollToIndex(row.localIndex, options);return;}}@@ -509,7 +460,7 @@ export function ChannelsRail(props: ChannelsRailProps) {};createEffect(() => {- if (!restoreListScroll() || props.mode !== 'full') return;+ if (!restoreListScroll()) return;const searchOpen = props.searchOpen;const sourcesReady = searchOpen@@ -522,7 +473,7 @@ export function ChannelsRail(props: ChannelsRailProps) {if (!sourcesReady) return;const frame = requestAnimationFrame(() => {- if (props.searchOpen !== searchOpen || props.mode !== 'full') return;+ if (props.searchOpen !== searchOpen) return;if (searchOpen) {scrollSearchToSelectedOrStart();@@ -626,10 +577,7 @@ export function ChannelsRail(props: ChannelsRailProps) {alternateDescription: 'Open in new split',},disclosure: {- getKey: (row) =>- props.mode === 'slim' && row.kind === 'conversation'- ? undefined- : row.group,+ getKey: (row) => row.group,isExpanded: (group) =>state.expandedGroups[group as ChannelsRailSection],setExpanded: (group, expanded) =>@@ -665,10 +613,7 @@ export function ChannelsRail(props: ChannelsRailProps) {const sectionHotkeys = createHotkeyGroup();const sectionHotkeysEnabled = () =>- panel.isPanelActive() &&- props.mode === 'full' &&- !props.searchOpen &&- state.tab === 'browse';+ panel.isPanelActive() && !props.searchOpen && state.tab === 'browse';registerHotkey({hotkey: ']',@@ -686,27 +631,6 @@ export function ChannelsRail(props: ChannelsRailProps) {}).withGroup(sectionHotkeys);onCleanup(() => sectionHotkeys.dispose());- createEffect(- on(- () => props.mode,- () => {- if (props.mode === 'slim') {- closeSearch();- return;- }-- const focusedIndex = list.focus.index();- if (focusedIndex < 0) return;-- const frame = requestAnimationFrame(() => {- scrollHandle.scrollToIndex(focusedIndex);- });- onCleanup(() => cancelAnimationFrame(frame));- },- { defer: true }- )- );-const activateRow = (rowId: ChannelRailRow['id'], event?: MouseEvent) => {list.activate.key(rowId, {reason: 'pointer',@@ -736,10 +660,6 @@ export function ChannelsRail(props: ChannelsRailProps) {list,tab: () => state.tab,selectTab,- setMode: (mode) => {- if (mode === 'slim') closeSearch();- props.onModeChange(mode);- },sources: props.sources,favorites,selectedChannelId: () => state.selectedChannelId,@@ -747,8 +667,6 @@ export function ChannelsRail(props: ChannelsRailProps) {toggleGroup: (group) => setGroupOpen(group, !state.expandedGroups[group]),sortBy: (group) => state.sortBy[group],setSortBy,- slimGroupEnabled: (group) => state.slimGroups[group],- setSlimGroupEnabled,registerRootRef: setListRoot,activateRow,registerScrollRef: (group, element) => {@@ -767,26 +685,22 @@ export function ChannelsRail(props: ChannelsRailProps) {aria-label="Chat navigation"class="flex size-full min-h-0 flex-col gap-3 bg-panel">- {props.mode === 'full' ? (- <ExpandedChannelsRail- search={{- isOpen: () => props.searchOpen,- query: searchQuery,- results: searchResults,- isLoading: searchLoading,- error: searchError,- open: openSearch,- close: closeSearch,- setQuery: setSearchQuery,- registerInput: (element) => {- searchInput = element;- },- retry: retrySearch,- }}- />- ) : (- <SlimChannelsRail />- )}+ <ExpandedChannelsRail+ search={{+ isOpen: () => props.searchOpen,+ query: searchQuery,+ results: searchResults,+ isLoading: searchLoading,+ error: searchError,+ open: openSearch,+ close: closeSearch,+ setQuery: setSearchQuery,+ registerInput: (element) => {+ searchInput = element;+ },+ retry: retrySearch,+ }}+ /></aside></ChannelsRailProvider>);diff --git a/apps/web/src/features/channels-view/components/rail/ChannelsRailContext.ts b/apps/web/src/features/channels-view/components/rail/ChannelsRailContext.tsindex 482c6cf7c5..62d4c42123 100644--- a/apps/web/src/features/channels-view/components/rail/ChannelsRailContext.ts+++ b/apps/web/src/features/channels-view/components/rail/ChannelsRailContext.ts@@ -34,7 +34,6 @@ export type ChannelRailRow =group?: ChannelsGroup;scope: ChannelsSourceScope;localIndex: number;- virtualIndex?: number;channel: ChannelEntity;};@@ -60,7 +59,6 @@ export type ChannelsRailContext = {list: ListController<ChannelRailRow, ChannelRailActivationMetadata>;tab: Accessor<ChannelsTab>;selectTab: (tab: ChannelsTab) => void;- setMode: (mode: 'full' | 'slim') => void;sources: ChannelsSources;favorites: Accessor<readonly Favorite[]>;selectedChannelId: Accessor<string | undefined>;@@ -68,8 +66,6 @@ export type ChannelsRailContext = {toggleGroup: (group: ChannelsRailSection) => void;sortBy: (group: ChannelsGroup) => ChannelListSort;setSortBy: (group: ChannelsGroup, sort: ChannelListSort) => void;- slimGroupEnabled: (group: ChannelsGroup) => boolean;- setSlimGroupEnabled: (group: ChannelsGroup, enabled: boolean) => void;registerRootRef: (element: HTMLDivElement) => void;activateRow: (rowId: ChannelRailRow['id'], event?: MouseEvent) => void;registerScrollRef: (diff --git a/apps/web/src/features/channels-view/components/rail/ChannelsRailSection.tsx b/apps/web/src/features/channels-view/components/rail/ChannelsRailSection.tsxindex bad6ff880b..d8ffb470c1 100644--- a/apps/web/src/features/channels-view/components/rail/ChannelsRailSection.tsx+++ b/apps/web/src/features/channels-view/components/rail/ChannelsRailSection.tsx@@ -6,7 +6,6 @@ import { CollapseTransition } from '@app/components/view-shell/CollapseTransitioimport 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 {@@ -186,9 +185,7 @@ export function RailListLoading() {);}-export function RailListLoadingMore(props: {- variant: 'channel' | 'recent' | 'slim';-}) {+export function RailListLoadingMore(props: { variant: 'channel' | 'recent' }) {return (<div role="status" aria-label="Loading more conversations"><For each={LOADING_SKELETON_ROWS}>@@ -197,7 +194,6 @@ export function RailListLoadingMore(props: {aria-hidden="true"class={cn('flex items-center',- props.variant === 'slim' && 'h-10 justify-center',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'@@ -210,19 +206,17 @@ export function RailListLoadingMore(props: {props.variant !== 'channel' && 'size-8')}/>- <Show when={props.variant !== 'slim'}>- <div class="flex min-w-0 flex-1 flex-col gap-2">- <div- class={cn(- 'skeleton-shimmer h-2.5 rounded-full bg-skeleton',- row % 2 === 0 ? 'w-1/2' : 'w-2/3'- )}- />- <Show when={props.variant === 'recent'}>- <div class="skeleton-shimmer h-2 w-4/5 rounded-full bg-skeleton" />- </Show>- </div>- </Show>+ <div class="flex min-w-0 flex-1 flex-col gap-2">+ <div+ class={cn(+ 'skeleton-shimmer h-2.5 rounded-full bg-skeleton',+ row % 2 === 0 ? 'w-1/2' : 'w-2/3'+ )}+ />+ <Show when={props.variant === 'recent'}>+ <div class="skeleton-shimmer h-2 w-4/5 rounded-full bg-skeleton" />+ </Show>+ </div></div>)}</For>@@ -259,20 +253,3 @@ export function CreateRailAction(props: {</ViewSidebar.Control>);}--export function RailModeButton(props: {- expanded: boolean;- onToggle: () => void;-}) {- return (- <Button- variant="ghost"- size="icon-sm"- label={props.expanded ? 'Collapse chat rail' : 'Expand chat rail'}- tooltipPlacement={props.expanded ? 'bottom' : 'right'}- onClick={props.onToggle}- >- <SidebarIcon class="size-4" />- </Button>- );-}diff --git a/apps/web/src/features/channels-view/components/rail/ExpandedChannelsRail.tsx b/apps/web/src/features/channels-view/components/rail/ExpandedChannelsRail.tsxindex 79f7f098b6..2b191edcfb 100644--- a/apps/web/src/features/channels-view/components/rail/ExpandedChannelsRail.tsx+++ b/apps/web/src/features/channels-view/components/rail/ExpandedChannelsRail.tsx@@ -122,6 +122,8 @@ function ChannelSortDropdown(props: { group: ChannelsGroup; label: string }) {<Dropdown placement="bottom-end"><Dropdown.Triggeras={ViewSidebar.Control}+ variant="ghost"+ size="icon-sm"label={`Sort ${props.label.toLowerCase()}`}><SortIcon class="size-3.5" />diff --git a/apps/web/src/features/channels-view/components/rail/SlimChannelsRail.tsx b/apps/web/src/features/channels-view/components/rail/SlimChannelsRail.tsxdeleted file mode 100644index 7c7c22e693..0000000000--- a/apps/web/src/features/channels-view/components/rail/SlimChannelsRail.tsx+++ /dev/null@@ -1,744 +0,0 @@-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';-import {- useFavoriteDisplayName,- useFavoriteDmRecipientId,-} from '@app/util/favorites';-import { openNewChannelModal } from '@channel/CreateChannelModal';-import { SplitPanel } from '@components/app/split-panel';-import { UserIcon } from '@core/component/UserIcon';-import { isTouchDevice } from '@core/mobile/isTouchDevice';-import { type ChannelEntity, Entity } from '@entity';-import { Popover } from '@kobalte/core/popover';-import ArrowClockwiseIcon from '@phosphor/arrow-clockwise.svg';-import CaretDownIcon from '@phosphor/caret-down.svg';-import ChatTeardropIcon from '@phosphor/chat-teardrop.svg';-import ChatTextIcon from '@phosphor/chat-text.svg';-import ChatsIcon from '@phosphor/chats-circle.svg';-import CheckIcon from '@phosphor/check.svg';-import GearIcon from '@phosphor/gear.svg';-import ChannelIcon from '@phosphor/hash-straight.svg';-import PlusIcon from '@phosphor/plus.svg';-import StarIcon from '@phosphor/star.svg';-import type { Favorite } from '@service-storage/generated/schemas/favorite';-import { Button, cn, Dropdown, Layer, Tabs, ToggleSwitch, Tooltip } from '@ui';-import {- createMemo,- createSignal,- For,- Match,- onCleanup,- Show,- Switch,-} from 'solid-js';-import { Virtualizer, type VirtualizerHandle } from 'virtua/solid';-import type { ChannelListSort, ChannelsGroup } from '../../types';-import { channelInitials, isDirectMessage } from '../../utils';-import {- ChannelCallIndicator,- ChannelMutedIndicator,- ChannelRailItemContextMenu,- isPrimaryMouseDown,-} from './ChannelRailItems';-import {- domIdForRow,- rowKeyForChannel,- rowKeyForFavorite,- useChannelsRail,-} from './ChannelsRailContext';-import {- CollapsibleSection,- RailListLoading,- RailListLoadingMore,- RailModeButton,-} from './ChannelsRailSection';-import {- useChannelRailFavoriteItemState,- useChannelRailFavoritesState,- useChannelRailItemState,- useChannelRailScopeState,- useChannelRailVirtualizer,-} from './hooks/useChannelRailState';--function AllTabLabel() {- return (- <>- <span class="sr-only">All</span>- <span aria-hidden="true" class="[&_svg]:size-4">- <ChatsIcon />- </span>- </>- );-}--function RecentTabLabel() {- return (- <>- <span class="sr-only">Recent</span>- <span aria-hidden="true" class="[&_svg]:size-4">- <ChatTextIcon />- </span>- </>- );-}--const SLIM_CHANNEL_TABS = [- { value: 'browse', label: AllTabLabel },- { value: 'recents', label: RecentTabLabel },-];--const SLIM_GROUPS: {- group: ChannelsGroup;- label: string;-}[] = [- { group: 'channels', label: 'Channels' },- { group: 'direct_messages', label: 'DMs' },-];--const SLIM_SORT_OPTIONS: { value: ChannelListSort; label: string }[] = [- { value: 'viewed_at', label: 'Last viewed' },- { value: 'updated_at', label: 'Last updated' },- { value: 'created_at', label: 'Date created' },-];--const SLIM_ROW_HEIGHT = 42;-const LOAD_MORE_THRESHOLD = 300;--function SlimFavoriteAvatar(props: {- favorite: Favorite;- displayName: () => string;-}) {- const dmRecipientId = useFavoriteDmRecipientId(props.favorite);-- return (- <Switch>- <Match when={dmRecipientId()}>- {(recipientId) => (- <span class="relative flex size-8 shrink-0 items-center justify-center overflow-hidden rounded-full border border-edge bg-surface-2">- <UserIcon- id={recipientId()}- size="fill"- suppressClick- showTooltip={false}- />- </span>- )}- </Match>- <Match when={props.favorite.channelType === 'direct_message'}>- <span class="relative flex size-8 shrink-0 items-center justify-center overflow-hidden rounded-full border border-edge bg-surface-2">- <FavoriteIcon favorite={props.favorite} class="size-4" />- </span>- </Match>- <Match when={true}>- <span class="flex size-8 shrink-0 items-center justify-center rounded-full border border-edge bg-surface-2 text-xs font-semibold tracking-wide text-ink">- {channelInitials(props.displayName())}- </span>- </Match>- </Switch>- );-}--function SlimFavoriteItem(props: { favorite: Favorite }) {- const rail = useChannelsRail();- const displayName = useFavoriteDisplayName(props.favorite);- const item = useChannelRailFavoriteItemState(() => props.favorite);-- return (- <Tooltip label={displayName()} placement="right" class="size-10">- <button- id={item().domId}- type="button"- role="treeitem"- tabIndex={-1}- class={cn(- 'relative flex size-10 items-center justify-center rounded-full text-left outline-none transition-colors',- item().selected && 'text-ink',- !item().selected && 'text-ink-muted',- !item().selected && !isTouchDevice() && item().focused && 'text-ink',- !item().selected &&- !isTouchDevice() &&- 'hover:bg-hover hover:text-ink'- )}- aria-current={item().selected ? 'page' : undefined}- onClick={(event) =>- rail.activateRow(rowKeyForFavorite(props.favorite), event)- }- >- <span- aria-hidden="true"- class={cn(- 'absolute -left-3 top-1/2 z-1 h-3 w-1 -translate-y-1/2 rounded-r-full bg-ink transition-[opacity,transform] duration-150 ease-out motion-reduce:transition-none',- item().selected ? 'scale-y-100 opacity-100' : 'scale-y-90 opacity-0'- )}- />- <SlimFavoriteAvatar- favorite={props.favorite}- displayName={displayName}- />- </button>- </Tooltip>- );-}--function SlimListError(props: { retry: () => Promise<void> }) {- return (- <div class="flex min-h-10 items-center justify-center">- <Button- variant="outline"- size="icon-sm"- label="Retry loading conversations"- tooltipPlacement="right"- onClick={() => void props.retry()}- >- <ArrowClockwiseIcon class="size-4" />- </Button>- </div>- );-}--function SlimFavoritesSection() {- const rail = useChannelsRail();- const section = useChannelRailFavoritesState();-- return (- <Show when={section().items.length > 0}>- <CollapsibleSection.Root open={section().open} class="items-center">- <CollapsibleSection.Header- focused={false}- focusWithin={section().containsFocus}- class="h-10 justify-center"- >- <Tooltip- label={`Favorites (${section().open ? 'expanded' : 'collapsed'})`}- placement="right"- class="size-10"- >- <button- id={section().domId}- type="button"- role="treeitem"- tabIndex={-1}- class="relative flex size-10 min-w-10 flex-none items-center justify-center rounded-full outline-none"- aria-expanded={section().open}- aria-label="Favorites"- onMouseDown={(event) => {- if (!isPrimaryMouseDown(event)) return;- event.preventDefault();- rail.toggleGroup('favorites');- }}- >- <StarIcon class="size-4" />- </button>- </Tooltip>- </CollapsibleSection.Header>- <CollapsibleSection.Content- open={section().open}- contentRef={(element) => rail.registerScrollRef('favorites', element)}- containerClass="w-full"- class="flex min-h-0 w-full flex-col items-center gap-0.5"- >- <For each={section().items}>- {(favorite) => (- <div class="flex justify-center">- <SlimFavoriteItem favorite={favorite} />- </div>- )}- </For>- </CollapsibleSection.Content>- </CollapsibleSection.Root>- </Show>- );-}--function SlimChannelAvatar(props: { channel: ChannelEntity }) {- return (- <Switch>- <Match when={isDirectMessage(props.channel)}>- <span class="relative flex size-8 shrink-0 items-center justify-center overflow-hidden rounded-full border border-edge bg-surface-2 [&_img]:size-full [&_svg]:size-4 [&_svg]:shrink-0">- <Entity.Icon- entity={props.channel}- suppressClick- showTooltip={false}- />- </span>- </Match>- <Match when={true}>- <span class="flex size-8 shrink-0 items-center justify-center rounded-full border border-edge bg-surface-2 text-xs font-semibold tracking-wide text-ink">- {channelInitials(props.channel.name)}- </span>- </Match>- </Switch>- );-}--function SlimChannelItem(props: { channel: ChannelEntity }) {- const rail = useChannelsRail();- const item = useChannelRailItemState(() => props.channel.id);-- return (- <ChannelRailItemContextMenu- channel={props.channel}- class="block size-10 self-center"- >- <Tooltip label={props.channel.name} placement="right" class="size-10">- <button- id={item().domId}- type="button"- role="treeitem"- tabIndex={-1}- class={cn(- 'relative flex size-10 items-center justify-center rounded-full text-left outline-none',- item().selected && 'text-ink',- !item().selected && 'text-ink-muted',- !item().selected &&- !isTouchDevice() &&- item().focused &&- 'text-ink',- !item().selected &&- !isTouchDevice() &&- 'hover:bg-hover hover:text-ink'- )}- aria-current={item().selected ? 'page' : undefined}- onMouseDown={(event) => {- if (!isPrimaryMouseDown(event)) return;- rail.activateRow(rowKeyForChannel(props.channel.id), event);- }}- >- <span- aria-hidden="true"- class={cn(- 'absolute -left-3 top-1/2 z-1 h-3 w-1 -translate-y-1/2 rounded-r-full bg-ink transition-[opacity,transform] duration-150 ease-out motion-reduce:transition-none',- item().selected- ? 'scale-y-100 opacity-100'- : 'scale-y-90 opacity-0'- )}- />- <span class="relative">- <SlimChannelAvatar channel={props.channel} />- <Show- when={item().callStatus}- fallback={- <ChannelMutedIndicator- muted={item().muted}- class="absolute -bottom-0.5 -right-0.5 rounded-full bg-inset p-0.5"- />- }- >- {(callStatus) => (- <ChannelCallIndicator- status={callStatus()}- class="absolute -bottom-0.5 -right-0.5 rounded-full bg-inset p-0.5"- />- )}- </Show>- <Show when={item().unread}>- <span- aria-label="Unread"- class="absolute -right-0.5 -top-0.5 size-2.5 rounded-full bg-accent ring-2 ring-surface"- />- </Show>- </span>- </button>- </Tooltip>- </ChannelRailItemContextMenu>- );-}--function SlimCreateMenu() {- return (- <Dropdown placement="right-start" gutter={8}>- <Dropdown.Trigger- variant="outline"- size="icon-sm"- class="size-10 rounded-full bg-transparent"- label="Create conversation"- >- <PlusIcon class="size-4" />- </Dropdown.Trigger>- <Dropdown.Content class="min-w-44">- <Dropdown.Group>- <Dropdown.Item onSelect={() => openNewChannelModal()}>- <ChannelIcon class="size-4 shrink-0" />- <span>Create channel</span>- </Dropdown.Item>- <Dropdown.Item onSelect={() => runCreateAction('channel')}>- <ChatTeardropIcon class="size-4 shrink-0" />- <span>Start direct message</span>- </Dropdown.Item>- </Dropdown.Group>- </Dropdown.Content>- </Dropdown>- );-}--function SlimHeader() {- const rail = useChannelsRail();- const selectTab = (value: string) => {- if (value === 'browse' || value === 'recents') {- rail.selectTab(value);- }- };-- return (- <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>- <ViewSidebar.CloseButton />- <ViewSidebarToggle action="collapse" />- </SplitPanel.ControlGroup>- </div>- <div class="flex h-8 w-full items-center justify-center px-2">- <RailModeButton- expanded={false}- onToggle={() => rail.setMode('full')}- />- </div>- <div class="w-full px-3">- <Tabs- aria-label="Chat sidebar views"- class="h-20 flex-col"- itemClass="h-auto min-h-0 w-full"- labelClass="size-full p-0"- fullWidth- list={SLIM_CHANNEL_TABS}- value={rail.tab()}- onChange={selectTab}- />- </div>- <div class="w-full border-t border-edge-muted" />- <div class="flex w-full justify-center px-2">- <SlimCreateMenu />- </div>- <div class="w-full border-t border-edge-muted" />- </div>- );-}--function SlimBrowseConversations() {- const rail = useChannelsRail();- const [scrollRoot, setScrollRoot] = createSignal<HTMLDivElement>();- const [virtualizer, setVirtualizer] = createSignal<VirtualizerHandle>();- const forceEmptyState = useDebugSetting(- DEBUG_SETTING_KEYS.FORCE_EMPTY_STATES- );- const channels = useChannelRailScopeState(() => 'channels');- const directMessages = useChannelRailScopeState(() => 'direct_messages');- const channelItems = () =>- rail.slimGroupEnabled('channels') ? channels().items : [];- const directMessageItems = () =>- rail.slimGroupEnabled('direct_messages') ? directMessages().items : [];- const items = createMemo(() => [...channelItems(), ...directMessageItems()]);- const keepMounted = createMemo(() => {- const indexes = rail.slimGroupEnabled('channels')- ? [...(channels().keepMounted ?? [])]- : [];- if (rail.slimGroupEnabled('direct_messages')) {- const offset = channelItems().length;- indexes.push(- ...(directMessages().keepMounted ?? []).map((index) => offset + index)- );- }- return indexes.length > 0 ? [...new Set(indexes)] : undefined;- });-- let unregisterVirtualizers: (() => void)[] = [];- const registerVirtualizer = (handle?: VirtualizerHandle) => {- for (const unregister of unregisterVirtualizers) unregister();- unregisterVirtualizers = [];- setVirtualizer(handle);- if (!handle) return;-- unregisterVirtualizers = SLIM_GROUPS.map(({ group }) =>- rail.registerVirtualizer(group, handle)- );- };- onCleanup(() => {- for (const unregister of unregisterVirtualizers) unregister();- });-- const registerScrollRoot = (element: HTMLDivElement) => {- setScrollRoot(element);- for (const { group } of SLIM_GROUPS) {- rail.registerScrollRef(group, element);- }- };- const visibleGroups = () =>- SLIM_GROUPS.filter(({ group }) => rail.slimGroupEnabled(group));- const isInitialLoading = () =>- items().length === 0 &&- visibleGroups().some(({ group }) => rail.sources[group].isLoading());- const hasError = () =>- visibleGroups().some(({ group }) => rail.sources[group].error());- const isLoadingMore = () =>- visibleGroups().some(({ group }) => rail.sources[group].isLoadingMore());- const retry = async () => {- await Promise.all(- visibleGroups().map(({ group }) => rail.sources[group].refresh())- );- };- const loadMoreNearEnd = (offset?: number) => {- const handle = virtualizer();- if (!handle) return;-- const viewportEnd = (offset ?? handle.scrollOffset) + handle.viewportSize;- let groupEnd = 0;- for (const { group } of visibleGroups()) {- const source = rail.sources[group];- groupEnd += source.items().length * SLIM_ROW_HEIGHT;- if (- groupEnd - viewportEnd > LOAD_MORE_THRESHOLD ||- source.isLoadingMore() ||- !source.hasMore()- ) {- continue;- }- void source.loadMore();- }- };-- return (- <Switch>- <Match when={forceEmptyState()}>{null}</Match>- <Match when={isInitialLoading()}>- <RailListLoading />- </Match>- <Match when={hasError() && items().length === 0}>- <SlimListError retry={retry} />- </Match>- <Match when={items().length > 0}>- <div- ref={registerScrollRoot}- class="scrollbar-hidden size-full min-h-0 overflow-y-auto"- aria-busy={isLoadingMore()}- >- <Virtualizer- ref={registerVirtualizer}- data={items()}- scrollRef={scrollRoot()}- itemSize={SLIM_ROW_HEIGHT}- bufferSize={240}- keepMounted={keepMounted()}- onScroll={loadMoreNearEnd}- >- {(channel) => (- <div class="flex justify-center pb-0.5">- <SlimChannelItem channel={channel} />- </div>- )}- </Virtualizer>- <Show when={isLoadingMore()}>- <RailListLoadingMore variant="slim" />- </Show>- <Show when={hasError() && !isLoadingMore()}>- <SlimListError retry={retry} />- </Show>- </div>- </Match>- </Switch>- );-}--function SlimBrowse() {- return (- <div class="flex h-full min-h-0 flex-col gap-2">- <SlimFavoritesSection />- <div class="min-h-0 flex-1">- <SlimBrowseConversations />- </div>- </div>- );-}--function SlimRecents() {- const [scrollRoot, setScrollRoot] = createSignal<HTMLDivElement>();- const scope = useChannelRailScopeState(() => 'recents');- const pagination = useChannelRailVirtualizer(() => 'recents');- const forceEmptyState = useDebugSetting(- DEBUG_SETTING_KEYS.FORCE_EMPTY_STATES- );-- return (- <Switch>- <Match when={forceEmptyState()}>{null}</Match>- <Match when={scope().source.isLoading() && scope().items.length === 0}>- <RailListLoading />- </Match>- <Match when={scope().source.error() && scope().items.length === 0}>- <SlimListError retry={scope().source.refresh} />- </Match>- <Match when={scope().items.length > 0}>- <div- ref={setScrollRoot}- class="scrollbar-hidden size-full min-h-0 overflow-y-auto"- aria-busy={scope().source.isLoadingMore()}- >- <Virtualizer- ref={pagination.registerVirtualizer}- data={scope().items}- scrollRef={scrollRoot()}- itemSize={42}- bufferSize={240}- keepMounted={scope().keepMounted}- onScroll={pagination.loadMoreNearEnd}- >- {(channel) => (- <div class="flex justify-center pb-0.5">- <SlimChannelItem channel={channel} />- </div>- )}- </Virtualizer>- <Show when={scope().source.isLoadingMore()}>- <RailListLoadingMore variant="slim" />- </Show>- <Show- when={scope().source.error() && !scope().source.isLoadingMore()}- >- <SlimListError retry={scope().source.refresh} />- </Show>- </div>- </Match>- </Switch>- );-}--function SlimSortDropdown(props: { group: ChannelsGroup; label: string }) {- const rail = useChannelsRail();- const selected = () =>- SLIM_SORT_OPTIONS.find(- (option) => option.value === rail.sortBy(props.group)- );- const setSort = (value: string) => {- const option = SLIM_SORT_OPTIONS.find((item) => item.value === value);- if (option) rail.setSortBy(props.group, option.value);- };-- return (- <Dropdown placement="right-start">- <Dropdown.Trigger- variant="ghost"- size="sm"- class="h-7 min-w-28 justify-between gap-1 rounded-lg px-2 text-sm font-normal"- aria-label={`Sort ${props.label.toLowerCase()}`}- >- <span class="truncate">{selected()?.label}</span>- <CaretDownIcon class="size-2.5 shrink-0" />- </Dropdown.Trigger>- <Dropdown.Content class="min-w-36">- <Dropdown.Group>- <Dropdown.RadioGroup- value={rail.sortBy(props.group)}- onChange={setSort}- >- <For each={SLIM_SORT_OPTIONS}>- {(option) => (- <Dropdown.RadioItem closeOnSelect value={option.value}>- <span class="flex-1">{option.label}</span>- <Dropdown.ItemIndicator>- <CheckIcon class="size-3.5 text-accent" />- </Dropdown.ItemIndicator>- </Dropdown.RadioItem>- )}- </For>- </Dropdown.RadioGroup>- </Dropdown.Group>- </Dropdown.Content>- </Dropdown>- );-}--function SlimRailSettings() {- const rail = useChannelsRail();-- return (- <footer class="flex h-12 shrink-0 items-center justify-center border-t border-edge-muted px-2">- <Popover placement="right-end" gutter={8}>- <Popover.Trigger- as={Button}- variant="ghost"- size="icon-md"- class="rounded-lg data-expanded:bg-active data-expanded:text-ink"- label="Chat rail settings"- >- <GearIcon class="size-4" />- </Popover.Trigger>- <Popover.Portal>- <Layer depth={3}>- <Popover.Content- class="portal-scope z-action-menu w-56 overflow-hidden rounded-xl border border-edge bg-menu-glass text-sm [--color-surface:var(--color-menu)] glass menu-open-animation"- onOpenAutoFocus={(event) => event.preventDefault()}- onCloseAutoFocus={(event) => event.preventDefault()}- >- <Popover.Title class="sr-only">Chat rail settings</Popover.Title>- <div class="flex size-full flex-col gap-(--app-border-width) bg-edge-muted/60">- <For each={SLIM_GROUPS}>- {(config) => (- <section class="flex flex-col bg-menu p-1.5">- <h3 class="flex h-7 items-center px-2 text-xs font-normal text-ink-extra-muted">- {config.label}- </h3>- <div class="flex h-8 items-center justify-between gap-3 rounded-lg px-2 font-normal text-ink">- <span>Visible</span>- <ToggleSwitch- size="xs"- checked={rail.slimGroupEnabled(config.group)}- onChange={(enabled) =>- rail.setSlimGroupEnabled(config.group, enabled)- }- label={`Show ${config.label.toLowerCase()}`}- labelClass="sr-only"- />- </div>- <div class="flex h-8 items-center justify-between gap-3 rounded-lg px-2 font-normal text-ink">- <span>Sort by</span>- <SlimSortDropdown- group={config.group}- label={config.label}- />- </div>- </section>- )}- </For>- </div>- </Popover.Content>- </Layer>- </Popover.Portal>- </Popover>- </footer>- );-}--export function SlimChannelsRail() {- const rail = useChannelsRail();- const activeDescendant = () => {- const rowId = rail.list.focus.key();- return rowId === undefined ? undefined : domIdForRow(rail.railId, rowId);- };-- return (- <>- <SlimHeader />- <div class="flex min-h-0 flex-1 flex-col">- <div- ref={rail.registerRootRef}- role="tree"- tabIndex={-1}- aria-activedescendant={activeDescendant()}- class="min-h-0 flex-1 overflow-hidden outline-none"- >- <Switch>- <Match when={rail.tab() === 'browse'}>- <SlimBrowse />- </Match>- <Match when={rail.tab() === 'recents'}>- <SlimRecents />- </Match>- </Switch>- </div>- </div>- <SlimRailSettings />- </>- );-}diff --git a/apps/web/src/features/channels-view/constants.ts b/apps/web/src/features/channels-view/constants.tsindex a4f1edde2a..4a1023d7a3 100644--- a/apps/web/src/features/channels-view/constants.ts+++ b/apps/web/src/features/channels-view/constants.ts@@ -1,21 +1,15 @@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 = DEFAULT_ASIDE_LAYOUT.width;-export const CHANNELS_MIN_RAIL_WIDTH = 224;-export const CHANNELS_MAX_RAIL_WIDTH = 420;+export const CHANNELS_MIN_RAIL_WIDTH = DEFAULT_ASIDE_LAYOUT.min;+export const CHANNELS_MAX_RAIL_WIDTH = DEFAULT_ASIDE_LAYOUT.max;export const CHANNELS_DEFAULT_SORT_BY = {channels: 'updated_at',direct_messages: 'updated_at',} satisfies Record<ChannelsGroup, ChannelListSort>;-export const CHANNELS_DEFAULT_SLIM_GROUPS = {- channels: true,- direct_messages: true,-} satisfies Record<ChannelsGroup, boolean>;-export function clampChannelsRailWidth(width: number): number {if (!Number.isFinite(width)) return CHANNELS_DEFAULT_RAIL_WIDTH;diff --git a/apps/web/src/features/channels-view/persistence.ts b/apps/web/src/features/channels-view/persistence.tsindex e72c8c7653..ad859234f3 100644--- a/apps/web/src/features/channels-view/persistence.ts+++ b/apps/web/src/features/channels-view/persistence.ts@@ -11,7 +11,6 @@ import type { Accessor } from 'solid-js';import { z } from 'zod';import {CHANNELS_DEFAULT_RAIL_WIDTH,- CHANNELS_DEFAULT_SLIM_GROUPS,CHANNELS_DEFAULT_SORT_BY,clampChannelsRailWidth,} from './constants';@@ -79,7 +78,6 @@ const channelsPreferencesSchema = z.object({.finite().default(CHANNELS_DEFAULT_RAIL_WIDTH).transform(clampChannelsRailWidth),- railMode: z.enum(['auto', 'full', 'slim']).default('auto'),sortBy: z.object({channels: z@@ -90,14 +88,6 @@ const channelsPreferencesSchema = z.object({.default(CHANNELS_DEFAULT_SORT_BY.direct_messages),}).default(CHANNELS_DEFAULT_SORT_BY),- slimGroups: z- .object({- channels: z.boolean().default(CHANNELS_DEFAULT_SLIM_GROUPS.channels),- direct_messages: z- .boolean()- .default(CHANNELS_DEFAULT_SLIM_GROUPS.direct_messages),- })- .default(CHANNELS_DEFAULT_SLIM_GROUPS),});type ChannelsPreferences = z.infer<typeof channelsPreferencesSchema>;@@ -105,9 +95,7 @@ type ChannelsPreferences = z.infer<typeof channelsPreferencesSchema>;const DEFAULT_CHANNELS_PREFERENCES = {version: 1,asideWidth: CHANNELS_DEFAULT_RAIL_WIDTH,- railMode: 'auto',sortBy: CHANNELS_DEFAULT_SORT_BY,- slimGroups: CHANNELS_DEFAULT_SLIM_GROUPS,} satisfies ChannelsPreferences;function selectEntryState(state: ChannelsViewState): ChannelsEntryState {@@ -203,9 +191,7 @@ function createChannelsPreferencesStorage(options: {JSON.stringify({version: 1,asideWidth: clampChannelsRailWidth(state.asideWidth),- railMode: state.railMode,sortBy: state.sortBy,- slimGroups: state.slimGroups,} satisfies ChannelsPreferences);return {@@ -227,17 +213,13 @@ function createChannelsPreferencesStorage(options: {return {...current,asideWidth: restored.asideWidth,- railMode: restored.railMode,sortBy: restored.sortBy,- slimGroups: restored.slimGroups,};} catch {return {...current,asideWidth: DEFAULT_CHANNELS_PREFERENCES.asideWidth,- railMode: DEFAULT_CHANNELS_PREFERENCES.railMode,sortBy: DEFAULT_CHANNELS_PREFERENCES.sortBy,- slimGroups: DEFAULT_CHANNELS_PREFERENCES.slimGroups,};}},diff --git a/apps/web/src/features/channels-view/types.ts b/apps/web/src/features/channels-view/types.tsindex 6aef8f7878..736c5eba2a 100644--- a/apps/web/src/features/channels-view/types.ts+++ b/apps/web/src/features/channels-view/types.ts@@ -8,23 +8,18 @@ export type ChannelsRailSection = 'favorites' | ChannelsGroup;export type ChannelsQueryScope = ChannelsGroup | 'recents';-export type ChannelsRailMode = 'auto' | 'full' | 'slim';-export type ChannelsViewState = {tab: ChannelsTab;mobileTab: ChannelsQueryScope;selectedChannelId?: string;expandedGroups: Record<ChannelsRailSection, boolean>;sortBy: Record<ChannelsGroup, ChannelListSort>;- slimGroups: Record<ChannelsGroup, boolean>;asideWidth: number;- railMode: ChannelsRailMode;};export type ChannelsViewStateOptions = Partial<- Omit<ChannelsViewState, 'expandedGroups' | 'sortBy' | 'slimGroups'>+ Omit<ChannelsViewState, 'expandedGroups' | 'sortBy'>> & {expandedGroups?: Partial<ChannelsViewState['expandedGroups']>;sortBy?: Partial<ChannelsViewState['sortBy']>;- slimGroups?: Partial<ChannelsViewState['slimGroups']>;};diff --git a/apps/web/src/features/inbox-view/components/HomeChatStart.tsx b/apps/web/src/features/inbox-view/components/HomeChatStart.tsxindex fdc44844af..2b058c19b1 100644--- a/apps/web/src/features/inbox-view/components/HomeChatStart.tsx+++ b/apps/web/src/features/inbox-view/components/HomeChatStart.tsx@@ -1,4 +1,8 @@-import { useViewShell, ViewShell } from '@app/components/view-shell';+import {+ useViewShell,+ ViewShell,+ ViewSidebar,+} from '@app/components/view-shell';import { useFeatureFlag } from '@app/lib/analytics/posthog';import { DragDropWrapper } from '@core/component/AI/component/DragDrop';import { ChatInputProvider } from '@core/component/AI/context';@@ -13,9 +17,9 @@ export function HomeChatStart() {const agents = useFeatureFlag(enableChatV3Agents);return (<ChatInputProvider>- <Show when={shell.aside.isCollapsed()}>+ <Show when={shell.aside.isCollapsed() || shell.aside.isOverlay()}><ViewShell.TopBar>- <span class="text-sm font-semibold">Home</span>+ <ViewSidebar.Title>Home</ViewSidebar.Title></ViewShell.TopBar></Show><DragDropWrapper class="relative size-full min-h-0 min-w-0 overflow-y-auto px-6">diff --git a/apps/web/src/features/inbox-view/components/InboxList.tsx b/apps/web/src/features/inbox-view/components/InboxList.tsxindex a2305b36a4..d9bb238747 100644--- a/apps/web/src/features/inbox-view/components/InboxList.tsx+++ b/apps/web/src/features/inbox-view/components/InboxList.tsx@@ -88,6 +88,7 @@ type InboxListActivationMetadata = {type InboxListProps = {previewEntity: EntityData | undefined;onPreviewEntityChange: (entity: EntityData | undefined) => void;+ onPreviewActivate?: () => void;};/** Compact notification list used by the Notifications workspace. */@@ -159,6 +160,7 @@ export function InboxList(props: InboxListProps) {if (!isTouchDevice() && !newSplit) {markEntitySeen(sourceRow.entity);showPreview(sourceRow.entity);+ props.onPreviewActivate?.();return;}diff --git a/apps/web/src/features/inbox-view/inbox-view.tsx b/apps/web/src/features/inbox-view/inbox-view.tsxindex 1dc95145de..9d81dd1f2f 100644--- a/apps/web/src/features/inbox-view/inbox-view.tsx+++ b/apps/web/src/features/inbox-view/inbox-view.tsx@@ -1,4 +1,8 @@-import { ViewShell } from '@app/components/view-shell';+import {+ useViewShell,+ ViewBreadcrumbs,+ ViewShell,+} from '@app/components/view-shell';import { useGlobalBlockOrchestrator } from '@components/app/GlobalAppState';import { PreviewPanel } from '@components/app/PreviewPanel';import { useSplitPanelOrThrow } from '@components/app/split-layout/layoutUtils';@@ -33,18 +37,44 @@ function HomeListPane(props: {onPreviewEntityChange: (entity: EntityData | undefined) => void;onNewChat: () => void;}) {+ const shell = useViewShell();+ const showContent = () => {+ if (shell.aside.isOverlay()) shell.aside.collapse();+ };+return (- <InboxListLayout tabs={<InboxTabs />} onNewChat={props.onNewChat}>+ <InboxListLayout+ tabs={<InboxTabs />}+ onNewChat={() => {+ props.onNewChat();+ showContent();+ }}+ ><Suspense fallback={<InboxFallback />}><InboxListpreviewEntity={props.previewEntity}onPreviewEntityChange={props.onPreviewEntityChange}+ onPreviewActivate={showContent}/></Suspense></InboxListLayout>);}+function HomeReturnBreadcrumb(props: { onReturn: () => void }) {+ return (+ <nav aria-label="Home location" class="flex items-center gap-0.5">+ <ViewBreadcrumbs.ReturnButton+ data-allow-focus-in-preview+ onClick={props.onReturn}+ >+ Home+ </ViewBreadcrumbs.ReturnButton>+ <ViewBreadcrumbs.Separator />+ </nav>+ );+}+function InboxViewRoot() {const panel = useSplitPanelOrThrow();const orchestrator = useGlobalBlockOrchestrator();@@ -77,14 +107,8 @@ function InboxViewRoot() {<div class="size-full min-h-0 bg-panel"><ViewShell.RootasidePreferenceKey="inbox"- aside={{- min: 224,- max: 420,- preserveDuringResize: false,- }}- breakpoints={{ collapsed: 0 }}- layoutBreakpoint="collapsed"- main={{ min: 224, preferredWidth: 640 }}+ aside={{ preserveDuringResize: false }}+ main={{ preferredWidth: 640 }}resizable><ViewShell.Aside class="flex flex-col bg-panel">@@ -109,6 +133,9 @@ function InboxViewRoot() {selectedEntity={entity()}orchestrator={orchestrator}splitPanelContext={panel}+ headerLeading={+ <HomeReturnBreadcrumb onReturn={newChat} />+ }/></Suspense>)}diff --git a/docs/AGENT_GUIDE/channels.md b/docs/AGENT_GUIDE/channels.mdindex 49babaa187..fbd61724f5 100644--- a/docs/AGENT_GUIDE/channels.md+++ b/docs/AGENT_GUIDE/channels.md@@ -247,7 +247,10 @@ a channel cached away from its latest page, and a delta longer than one page useThe 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.+choice independently of other workspaces and restores it after reload. Chat uses+the shared 256px default sidebar width and resize limits. In splits narrower than+720px, navigation collapses; the hamburger or `Cmd+.` opens it as a slide-over+with the same full sidebar contents. There is no separate skinny sidebar mode.On desktop, the Chat rail has `All` and `Recent` tabs. All contains anoptional `Favorites` section above the independently paginated `Channels` and@@ -273,10 +276,6 @@ exist in the DOM.Channels and DMs each have a sort action before their create action. They can besorted by last viewed, last updated, or date created, and each choice persistsindependently as a user preference.-In slim mode, Favorites remains a separate collapsible section, while Channels-and DMs render in one continuous list without section headings. The gear action-in the footer controls whether each group appears and exposes the same-independently persisted sort choices.Compact channel and DM rows in All have the same height. Section headings placetheir caret immediately after the title and reveal it on hover or while thesection is collapsed; hovering only undims the heading text, whilediff --git a/docs/AGENT_GUIDE/surfaces.md b/docs/AGENT_GUIDE/surfaces.mdindex a63c2a336c..75ba4daebe 100644--- a/docs/AGENT_GUIDE/surfaces.md+++ b/docs/AGENT_GUIDE/surfaces.md@@ -127,7 +127,13 @@ are isolated from the input. If generation stalls for 45 seconds, the shimmeris replaced with a retry action; a late result still appears automatically.Generation status updates do not extend that deadline. Retry starts a fresh45-second wait. Shift+Enter adds a line. Selecting a Home row replaces-the composer with its preview. Mobile continues to show the activity list alone.+the composer with its preview. Home uses the shared 256px sidebar and collapses+navigation below 720px. The hamburger or `Cmd+.` opens the full feed as a+slide-over. Activating a row or **New chat** closes that overlay to show content;+arrow-key browsing keeps it open. Preview headers start with **Home >**. Clicking+**Home** clears the preview and returns to the starting pane without changing+sidebar visibility. Use the hamburger to reopen the feed. Mobile continues to+show the activity list alone.AI chat, agent, and channel message bodies use 15px text, including thread replies.Desktop AI chats, agents, and channel composers share Home's rounded composer