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
Revert "feat(channels): open threads in a side panel" (#9182)
gbirmanef56c15fe34c
diff --git a/apps/web/src/features/channel/Channel/Channel.tsx b/apps/web/src/features/channel/Channel/Channel.tsxindex 0bbcb66beb..4ce4bdd879 100644--- a/apps/web/src/features/channel/Channel/Channel.tsx+++ b/apps/web/src/features/channel/Channel/Channel.tsx@@ -143,7 +143,6 @@ import {type ThreadManagerSnapshot,} from './thread-manager';import { createThreadPaginator } from './thread-paginator';-import { useChannelThreadPanel } from './thread-panel';import { UnifiedEditInput } from './UnifiedEditInput';import { UnifiedReplyInput } from './UnifiedReplyInput';import { UnreadNotificationsOverlay } from './UnreadNotificationsOverlay';@@ -419,22 +418,8 @@ export function Channel(props: ChannelProps) {},});- const threadPanel = useChannelThreadPanel();- // A thread stays inline while channel navigation positions one of its- // replies, so notification jumps keep landing on the reply itself.- const opensInPanel = (threadId: string) =>- !!threadPanel?.enabled() &&- !(- targetMessageController.activeTargetMessageId() === threadId &&- targetMessageController.activeTargetMessageReplyId()- );-const openReplyInput = (message: MessageData) => {const threadId = message.thread_id ?? message.id;- if (opensInPanel(threadId)) {- threadPanel?.open(threadId, { reply: true });- return;- }const state = threadManager.getOrCreateThreadState(threadId);if (isUnifiedInputMode()) {unifiedInput.bindReply(message);@@ -452,10 +437,6 @@ export function Channel(props: ChannelProps) {renderedText?: string) => {const threadId = message.thread_id ?? message.id;- if (opensInPanel(threadId)) {- threadPanel?.open(threadId, { reply: true });- return;- }const state = threadManager.getOrCreateThreadState(threadId);const beforeSnapshot = state.replyInputState();const nextSnapshot: InputSnapshot = {@@ -546,9 +527,6 @@ export function Channel(props: ChannelProps) {cancelLatestNavigation();if (replyId) {clearSelection();- // The reply lands inline; a narrow pane hides the timeline while a- // thread panel is open.- threadPanel?.close();prepareTargetReply(messageId);} else {selectMessage(messageId);@@ -982,19 +960,6 @@ export function Channel(props: ChannelProps) {unreadMessageIds={unread.unreadByThread().get(item.id)}- onOpenThread={- opensInPanel(item.id)- ? (options) =>- threadPanel?.open(- item.id,- options- )- : undefined- }- openInPanel={- threadPanel?.openThreadId() ===- item.id- }isExpanded={state.isExpanded}setIsExpanded={state.setIsExpandeddiff --git a/apps/web/src/features/channel/Channel/ChannelDetail.tsx b/apps/web/src/features/channel/Channel/ChannelDetail.tsxindex 02adf0db7b..229589cef6 100644--- a/apps/web/src/features/channel/Channel/ChannelDetail.tsx+++ b/apps/web/src/features/channel/Channel/ChannelDetail.tsx@@ -14,7 +14,6 @@ import { ChannelCallsTab } from '@channel/Calls/ChannelCallsTab';import { ChannelInviteButton } from '@channel/channel-invite-button';import { ChannelTitleIcon } from '@channel/components/ChannelTopIcon';import { DebugSuspense } from '@channel/DebugSuspense';-import { MediaDensityContext } from '@channel/Media/media-density';import { ChannelParticipantsTab } from '@channel/Participants/ChannelParticipantsTab';import { useGlobalBlockOrchestrator } from '@components/app/GlobalAppState';import { HeaderActionGroup } from '@components/app/HeaderActionGroup';@@ -35,11 +34,9 @@ import {useChannelName,useChannelType,} from '@core/context/channels';-import { registerHotkey } from '@core/hotkey/hotkeys';-import { TOKENS } from '@core/hotkey/tokens';import { createMethodRegistration } from '@core/orchestrator';import { lazyNamed } from '@core/util/lazyNamed';-import { cn, Tabs } from '@ui';+import { Tabs } from '@ui';import {type Accessor,children,@@ -60,8 +57,6 @@ import {type ChannelTargetRequest,} from './ChannelSurface';import { ChannelTabProvider, useChannelTab } from './ChannelTabContext';-import { ChannelThreadLayoutToggle } from './ChannelThreadLayoutToggle';-import { ChannelThreadPanel } from './ChannelThreadPanel';import { ChannelLiveIndicators } from './ChannelTopBarLiveIndicators';import { withChannelTabIcons } from './channel-tab-icons';import { type ChannelTabId, DEFAULT_CHANNEL_TAB } from './channel-tabs';@@ -71,10 +66,6 @@ import {toChannelTargetRequest,URL_PARAMS,} from './link';-import {- ChannelThreadPanelContext,- createChannelThreadPanel,-} from './thread-panel';import {canUseInlineCallTab,normalizeChannelTab,@@ -260,7 +251,6 @@ export function ChannelDetailTopBar(collapser={collapse.collapser}/></DebugSuspense>- <ChannelThreadLayoutToggle /></PriorityCollapseOverflowSensor><DebugSuspense name="ChannelDetail.actions"><ChannelDetailActions@@ -352,7 +342,6 @@ function ChannelDetailContent(props: ChannelDetailProps) {setActiveTabInternal(DEFAULT_CHANNEL_TAB);});const [pendingJoinCall, setPendingJoinCall] = createSignal(false);- const threadPanel = createChannelThreadPanel();// A new target within the already-mounted channel (a notification jump)// must land on the messages pane, whichever tab is open.@@ -399,22 +388,6 @@ function ChannelDetailContent(props: ChannelDetailProps) {);onCleanup(() => callCtx?.syncCallPageTab(channelId, false));- registerHotkey({- scopeId: panel.splitHotkeyScope,- hotkey: 'shift+cmd+e',- hotkeyToken: TOKENS.channel.toggleThreadPanel,- description: () =>- threadPanel.enabled()- ? 'Expand threads inline'- : 'Collapse threads into a side panel',- runWithInputFocused: true,- condition: threadPanel.available,- keyDownHandler: () => {- threadPanel.setEnabled(!threadPanel.enabled());- return true;- },- });-const botManagement = useChannelBotManagement({channelId,hotkeyScopeId: panel.splitHotkeyScope,@@ -426,104 +399,71 @@ function ChannelDetailContent(props: ChannelDetailProps) {<DebugSuspense name="ChannelDetail.call-event-sync"><CallEventSync /></DebugSuspense>- <ChannelThreadPanelContext.Provider value={threadPanel}>- <ChannelTabProvider activeTab={activeTab} setActiveTab={setActiveTab}>- <DebugSuspense name="ChannelDetail.auto-join">- <ChannelCallAutoJoin- canCall={canCall}- channelId={channelId}- pendingJoinCall={pendingJoinCall}- onHandled={() => setPendingJoinCall(false)}+ <ChannelTabProvider activeTab={activeTab} setActiveTab={setActiveTab}>+ <DebugSuspense name="ChannelDetail.auto-join">+ <ChannelCallAutoJoin+ canCall={canCall}+ channelId={channelId}+ pendingJoinCall={pendingJoinCall}+ onHandled={() => setPendingJoinCall(false)}+ />+ </DebugSuspense>+ <div class="flex size-full min-h-0 flex-col">+ <DebugSuspense name="ChannelDetail.header">+ <ChannelDetailHeader+ render={props.children}+ context={{+ channelId,+ name: () => channelName() ?? 'New Channel',+ }}/></DebugSuspense>- <div class="flex size-full min-h-0 flex-col">- <DebugSuspense name="ChannelDetail.header">- <ChannelDetailHeader- render={props.children}- context={{- channelId,- name: () => channelName() ?? 'New Channel',- }}- />- </DebugSuspense>- <div- class="flex min-h-0 flex-1 flex-col px-2"- data-channel-tab-content- >- <Switch>- <Match when={activeTab() === 'messages'}>- {/* A narrow pane gives the open thread the whole width.- Collapsed threads shrink message media to thumbnails. */}- <MediaDensityContext.Provider- value={() =>- threadPanel.enabled() ? 'compact' : 'regular'- }- >- <div class="@container/channel-body flex min-h-0 flex-1">- <div- class={cn(- 'flex min-h-0 min-w-0 flex-1 flex-col',- threadPanel.openThreadId() &&- '@max-[44rem]/channel-body:hidden'- )}- >- <DebugSuspense- name="ChannelDetail.messages"- fallback={<ChannelLoading />}- >- <ChannelMessages- autofocus={props.autofocus ?? false}- />- </DebugSuspense>- </div>- <Show when={threadPanel.openThreadId()}>- {(threadId) => (- <DebugSuspense name="ChannelDetail.thread-panel">- <ChannelThreadPanel- channelId={channelId}- threadId={threadId()}- panel={threadPanel}- />- </DebugSuspense>- )}- </Show>- </div>- </MediaDensityContext.Provider>- </Match>- <Match when={activeTab() === 'attachments'}>- <DebugSuspense name="ChannelDetail.attachments">- <ChannelAttachmentsTab channelId={channelId} />- </DebugSuspense>- </Match>- <Match when={activeTab() === 'calls' && ENABLE_CALLS}>- <DebugSuspense name="ChannelDetail.calls">- <ChannelCallsTab channelId={channelId} />- </DebugSuspense>- </Match>- <Match when={activeTab() === 'participants'}>- <DebugSuspense name="ChannelDetail.participants">- <ChannelParticipantsTab- channelId={channelId}- botManagementEnabled={botManagement.enabled()}- onCreateBot={botManagement.openCreateBot}- inviteBotFocusRequest={botManagement.inviteFocusRequest()}- onOpenBot={botManagement.openBot}- />- </DebugSuspense>- </Match>- <Match when={activeTab() === 'call' && canUseInlineCallTab()}>- <DebugSuspense name="ChannelDetail.call">- <ChannelCallTab- channelId={channelId}- pendingJoin={pendingJoinCall}- />- </DebugSuspense>- </Match>- </Switch>- </div>+ <div+ class="flex min-h-0 flex-1 flex-col px-2"+ data-channel-tab-content+ >+ <Switch>+ <Match when={activeTab() === 'messages'}>+ <DebugSuspense+ name="ChannelDetail.messages"+ fallback={<ChannelLoading />}+ >+ <ChannelMessages autofocus={props.autofocus ?? false} />+ </DebugSuspense>+ </Match>+ <Match when={activeTab() === 'attachments'}>+ <DebugSuspense name="ChannelDetail.attachments">+ <ChannelAttachmentsTab channelId={channelId} />+ </DebugSuspense>+ </Match>+ <Match when={activeTab() === 'calls' && ENABLE_CALLS}>+ <DebugSuspense name="ChannelDetail.calls">+ <ChannelCallsTab channelId={channelId} />+ </DebugSuspense>+ </Match>+ <Match when={activeTab() === 'participants'}>+ <DebugSuspense name="ChannelDetail.participants">+ <ChannelParticipantsTab+ channelId={channelId}+ botManagementEnabled={botManagement.enabled()}+ onCreateBot={botManagement.openCreateBot}+ inviteBotFocusRequest={botManagement.inviteFocusRequest()}+ onOpenBot={botManagement.openBot}+ />+ </DebugSuspense>+ </Match>+ <Match when={activeTab() === 'call' && canUseInlineCallTab()}>+ <DebugSuspense name="ChannelDetail.call">+ <ChannelCallTab+ channelId={channelId}+ pendingJoin={pendingJoinCall}+ />+ </DebugSuspense>+ </Match>+ </Switch></div>- </ChannelTabProvider>- </ChannelThreadPanelContext.Provider>+ </div>+ </ChannelTabProvider></ChannelSurface>);}diff --git a/apps/web/src/features/channel/Channel/ChannelThreadLayoutToggle.tsx b/apps/web/src/features/channel/Channel/ChannelThreadLayoutToggle.tsxdeleted file mode 100644index 758b6a22c6..0000000000--- a/apps/web/src/features/channel/Channel/ChannelThreadLayoutToggle.tsx+++ /dev/null@@ -1,43 +0,0 @@-import { TOKENS } from '@core/hotkey/tokens';-import { cn, ToggleSwitch, Tooltip } from '@ui';-import { Show } from 'solid-js';-import { useChannelThreadPanel } from './thread-panel';--/**- * Chooses whether threads collapse into a side panel or expand inline. Its- * own pill beside the channel tabs, matching their frame. Touch devices show- * one pane, so they keep threads inline and never offer it.- */-export function ChannelThreadLayoutToggle() {- const panel = useChannelThreadPanel();-- return (- <Show when={panel?.available() ? panel : undefined}>- {(panel) => (- <Tooltip- label={- panel().enabled()- ? 'Expand threads inline'- : 'Collapse threads into a side panel'- }- hotkey={TOKENS.channel.toggleThreadPanel}- class="shrink-0"- >- <div class="inline-flex min-h-8 items-stretch rounded-full border border-edge-button bg-control p-0.5">- <ToggleSwitch- label={panel().enabled() ? 'Collapse' : 'Expand'}- checked={panel().enabled()}- onChange={(checked) => panel().setEnabled(checked)}- // A view choice, not a setting: a neutral borderless track.- controlClass="border-transparent bg-ink/15 data-checked:border-transparent data-checked:bg-ink/60"- class={cn(- 'shrink-0 self-stretch rounded-full border border-transparent px-2 py-0 text-sm font-medium whitespace-nowrap text-ink-muted transition-colors duration-120 select-none motion-reduce:transition-none',- 'not-touch:not-data-checked:hover:overlay-hover not-touch:not-data-checked:hover:text-ink data-checked:overlay-active data-checked:text-ink'- )}- />- </div>- </Tooltip>- )}- </Show>- );-}diff --git a/apps/web/src/features/channel/Channel/ChannelThreadPanel.tsx b/apps/web/src/features/channel/Channel/ChannelThreadPanel.tsxdeleted file mode 100644index 23df8cb09a..0000000000--- a/apps/web/src/features/channel/Channel/ChannelThreadPanel.tsx+++ /dev/null@@ -1,66 +0,0 @@-import { DebugSuspense } from '@channel/DebugSuspense';-import { useChannelName } from '@core/context/channels';-import XIcon from '@icon/system/regular/x.svg';-import { Button, Scroll } from '@ui';-import { Show } from 'solid-js';-import { EditableThread } from '../StandaloneThread';-import type { ChannelThreadPanel as ThreadPanelState } from './thread-panel';--/**- * Thread pane beside the channel's messages: the root message,- * every reply, and a reply composer that stays open.- */-export function ChannelThreadPanel(props: {- channelId: string;- threadId: string;- panel: ThreadPanelState;-}) {- const channelName = useChannelName(props.channelId);-- return (- <aside- aria-label="Thread"- class="flex min-h-0 w-[26rem] shrink-0 flex-col border-l border-edge-muted @max-[44rem]/channel-body:w-full @max-[44rem]/channel-body:border-l-0"- data-channel-thread-panel- >- <div class="flex h-10 shrink-0 items-center gap-2 pr-2 pl-4">- <div class="flex min-w-0 flex-1 items-baseline gap-2">- <span class="text-sm font-semibold">Thread</span>- <Show when={channelName()}>- {(name) => (- <span class="ph-no-capture truncate text-xs text-ink-muted">- {name()}- </span>- )}- </Show>- </div>- <Button- aria-label="Close thread"- tooltip="Close thread"- variant="ghost"- size="icon-sm"- onClick={() => props.panel.close()}- >- <XIcon class="size-3.5 shrink-0 pointer-events-none" />- </Button>- </div>- <Scroll class="min-h-0 flex-1">- <div class="ph-no-capture px-2 pb-4">- <DebugSuspense name="ChannelThreadPanel.thread">- <Show when={props.threadId} keyed>- {(threadId) => (- <EditableThread- channelId={props.channelId}- messageId={threadId}- expanded- keepReplying- replyInputFocusRequest={props.panel.replyFocusRequest}- />- )}- </Show>- </DebugSuspense>- </div>- </Scroll>- </aside>- );-}diff --git a/apps/web/src/features/channel/Channel/tests/channel-detail-top-bar.test.tsx b/apps/web/src/features/channel/Channel/tests/channel-detail-top-bar.test.tsxindex e5f96e8de5..c7f3bef1e6 100644--- a/apps/web/src/features/channel/Channel/tests/channel-detail-top-bar.test.tsx+++ b/apps/web/src/features/channel/Channel/tests/channel-detail-top-bar.test.tsx@@ -1,5 +1,5 @@import type { ChannelEntity } from '@entity';-import { cleanup, fireEvent, render, screen } from '@solidjs/testing-library';+import { cleanup, render, screen } from '@solidjs/testing-library';import { createSignal, type JSX } from 'solid-js';import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest';@@ -124,11 +124,6 @@ vi.mock('../use-channel-tab-items', () => ({}));import { ChannelDetailTopBar } from '../ChannelDetail';-import {- type ChannelThreadPanel,- ChannelThreadPanelContext,- createChannelThreadPanel,-} from '../thread-panel';const CHANNEL: ChannelEntity = {id: 'channel-1',@@ -182,55 +177,3 @@ describe('channel top bar title menu', () => {expect(await screen.findByLabelText('Channel actions')).toBeTruthy();});});--describe('channel top bar thread layout toggle', () => {- beforeEach(() => localStorage.clear());-- function renderWithThreadPanel() {- let panel: ChannelThreadPanel | undefined;- render(() => {- panel = createChannelThreadPanel();- return (- <ChannelThreadPanelContext.Provider value={panel}>- <ChannelDetailTopBar channelId="channel-1" />- </ChannelThreadPanelContext.Provider>- );- });- return panel!;- }-- const toggle = () => screen.getByRole('switch') as HTMLInputElement;-- it('is offered only by hosts with a thread panel', () => {- render(() => <ChannelDetailTopBar channelId="channel-1" />);- expect(screen.queryByRole('switch')).toBeNull();- });-- it('collapses threads into the side panel and expands them back inline', () => {- const panel = renderWithThreadPanel();- expect(toggle().checked).toBe(false);- expect(screen.getByText('Expand')).toBeTruthy();-- panel.open('message-1');- expect(panel.openThreadId()).toBeUndefined();-- fireEvent.click(toggle());- expect(toggle().checked).toBe(true);- expect(screen.getByText('Collapse')).toBeTruthy();- panel.open('message-1');- expect(panel.openThreadId()).toBe('message-1');-- fireEvent.click(toggle());- expect(toggle().checked).toBe(false);- expect(panel.openThreadId()).toBeUndefined();- });-- it('remembers the choice for the next channel', () => {- renderWithThreadPanel();- fireEvent.click(toggle());- cleanup();-- renderWithThreadPanel();- expect(toggle().checked).toBe(true);- });-});diff --git a/apps/web/src/features/channel/Channel/thread-panel.ts b/apps/web/src/features/channel/Channel/thread-panel.tsdeleted file mode 100644index 76739f3e27..0000000000--- a/apps/web/src/features/channel/Channel/thread-panel.ts+++ /dev/null@@ -1,63 +0,0 @@-import { usePreference } from '@app/lib/preferences/use-preference';-import { isTouchDevice } from '@core/mobile/isTouchDevice';-import {- type Accessor,- createContext,- createSignal,- useContext,-} from 'solid-js';-import { createFocusRequest, type FocusRequest } from '../Thread/focus-request';--export type ChannelThreadPanel = {- /** Touch devices show one pane, so threads stay inline there. */- available: Accessor<boolean>;- /** Threads open in a side panel instead of expanding inline. */- enabled: Accessor<boolean>;- setEnabled: (enabled: boolean) => void;- /** The root message whose thread the panel shows, while it is open. */- openThreadId: Accessor<string | undefined>;- open: (threadId: string, options?: { reply?: boolean }) => void;- close: () => void;- /** Focus the panel's reply input once it mounts. */- replyFocusRequest: FocusRequest;-};--const THREAD_PANEL_PREFERENCE = 'macro:pref:channel:thread-panel';--/**- * Per-channel thread panel state. The layout choice is a user preference- * shared by every channel; touch devices show one pane, so they keep threads- * inline.- */-export function createChannelThreadPanel(): ChannelThreadPanel {- const [preferred, setPreferred] = usePreference(THREAD_PANEL_PREFERENCE, {- default: false,- });- const [threadId, setThreadId] = createSignal<string>();- const replyFocusRequest = createFocusRequest();- const available = () => !isTouchDevice();- const enabled = () => preferred() && available();-- return {- available,- enabled,- setEnabled: (next) => {- setPreferred(next);- if (!next) setThreadId(undefined);- },- openThreadId: () => (enabled() ? threadId() : undefined),- open: (id, options) => {- setThreadId(id);- if (options?.reply) replyFocusRequest.request();- },- close: () => setThreadId(undefined),- replyFocusRequest,- };-}--export const ChannelThreadPanelContext = createContext<ChannelThreadPanel>();--/** The enclosing channel's thread panel, when its host offers one. */-export function useChannelThreadPanel(): ChannelThreadPanel | undefined {- return useContext(ChannelThreadPanelContext);-}diff --git a/apps/web/src/features/channel/Media/MediaGrid.tsx b/apps/web/src/features/channel/Media/MediaGrid.tsxindex da1afcf4af..cca902591c 100644--- a/apps/web/src/features/channel/Media/MediaGrid.tsx+++ b/apps/web/src/features/channel/Media/MediaGrid.tsx@@ -11,8 +11,6 @@ import type { MediaItem } from './media-items';// Square tile size in px; keep in sync with the `size-25.5` class and THUMB_SIZE.const ATTACHMENT_TILE_SIZE = 102;-// Keep in sync with the `size-6.5` class.-const COMPACT_TILE_SIZE = 26;const SINGLE_IMAGE_MAX_WIDTH = 400;const SINGLE_IMAGE_MAX_HEIGHT = 400;const MESSAGE_GALLERY_IMAGE_MAX_WIDTH = 200;@@ -66,37 +64,23 @@ function MessageImageTile(props: {);}-function AttachmentImageTile(props: {- item: MediaItem;- onOpen?: () => void;- /** A small thumbnail beside a collapsed message. */- compact?: boolean;-}) {- const size = () => (props.compact ? COMPACT_TILE_SIZE : ATTACHMENT_TILE_SIZE);+function AttachmentImageTile(props: { item: MediaItem; onOpen?: () => void }) {return (// Root holds the fixed square; image and fallback both fill it (no reflow).- <MediaImage.Root- class={props.compact ? 'size-6.5 rounded-md' : 'size-25.5'}- >+ <MediaImage.Root class="size-25.5"><MediaImage.Image// Small thumbnail for these ~100px boxes; src is the fallback.src={props.item.thumbSrc ?? props.item.src}previewSrc={props.item.previewSrc}class={cn('size-full select-none rounded-2xl border border-edge object-cover',- props.compact && 'rounded-md',props.onOpen && 'hover:opacity-80')}onOpen={props.onOpen}- width={size()}- height={size()}+ width={ATTACHMENT_TILE_SIZE}+ height={ATTACHMENT_TILE_SIZE}loading="lazy"- fallback={- <MediaImage.Fallback- fill- class={props.compact ? 'rounded-md' : undefined}- />- }+ fallback={<MediaImage.Fallback fill />}/></MediaImage.Root>);@@ -184,35 +168,22 @@ function MessageVideoTile(props: {);}-function AttachmentVideoTile(props: {- item: MediaItem;- onOpen?: () => void;- compact?: boolean;-}) {+function AttachmentVideoTile(props: { item: MediaItem; onOpen?: () => void }) {return (- <MediaVideo.Root- class={cn(- 'size-25.5 group overflow-hidden border border-edge bg-surface',- props.compact && 'size-6.5 rounded-md'- )}- >+ <MediaVideo.Root class="size-25.5 group overflow-hidden border border-edge bg-surface"><MediaVideo.Previewsrc={props.item.src}class="size-full object-cover"onOpen={props.onOpen}/>- <MediaVideo.PlayOverlay- onOpen={props.onOpen}- class={props.compact ? '[&_svg]:size-3' : undefined}- />+ <MediaVideo.PlayOverlay onOpen={props.onOpen} /></MediaVideo.Root>);}export function MediaGrid(props: {items: MediaItem[];- /** `compact` shows every item as a small thumbnail. */- variant: 'message' | 'attachments' | 'compact';+ variant: 'message' | 'attachments';onOpen: (index: number) => void;/** An item whose file failed to load (message tiles only). */onError?: (id: string) => void;@@ -225,9 +196,9 @@ export function MediaGrid(props: {return (<divclass={cn(- props.variant === 'message'- ? 'flex flex-row flex-wrap gap-2'- : 'flex flex-row flex-wrap gap-1.5',+ props.variant === 'attachments'+ ? 'flex flex-row flex-wrap gap-1.5'+ : 'flex flex-row flex-wrap gap-2',props.class)}>@@ -242,10 +213,11 @@ export function MediaGrid(props: {onError={() => props.onError?.(item.id)}/></Match>- <Match when={item.kind === 'image'}>+ <Match+ when={item.kind === 'image' && props.variant === 'attachments'}+ ><AttachmentImageTileitem={item}- compact={props.variant === 'compact'}onOpen={() => props.onOpen(index())}/></Match>@@ -259,7 +231,6 @@ export function MediaGrid(props: {<Match when={true}><AttachmentVideoTileitem={item}- compact={props.variant === 'compact'}onOpen={() => props.onOpen(index())}/></Match>diff --git a/apps/web/src/features/channel/Media/MediaImage.tsx b/apps/web/src/features/channel/Media/MediaImage.tsxindex 48d4b203fb..9d3209cad0 100644--- a/apps/web/src/features/channel/Media/MediaImage.tsx+++ b/apps/web/src/features/channel/Media/MediaImage.tsx@@ -18,14 +18,12 @@ function ImagePlaceholder(props: {square?: boolean;/** Fill the parent's fixed box, so the placeholder matches the loaded image. */fill?: boolean;- class?: string;}) {return (<divclass={cn('flex items-center justify-center rounded-2xl border border-edge bg-surface',- props.fill && 'size-full',- props.class+ props.fill && 'size-full')}style={props.fill@@ -63,14 +61,12 @@ function Fallback(props: {dims?: { width: number; height: number };square?: boolean;fill?: boolean;- class?: string;}) {return (<ImagePlaceholderdims={props.dims}square={props.square}fill={props.fill}- class={props.class}/>);}diff --git a/apps/web/src/features/channel/Media/media-density.ts b/apps/web/src/features/channel/Media/media-density.tsdeleted file mode 100644index 01a5c49f73..0000000000--- a/apps/web/src/features/channel/Media/media-density.ts+++ /dev/null@@ -1,13 +0,0 @@-import { type Accessor, createContext, useContext } from 'solid-js';--/** `compact` shows message images and videos as small thumbnails. */-export type MediaDensity = 'regular' | 'compact';--const REGULAR: Accessor<MediaDensity> = () => 'regular';--export const MediaDensityContext =- createContext<Accessor<MediaDensity>>(REGULAR);--export function useMediaDensity(): Accessor<MediaDensity> {- return useContext(MediaDensityContext) ?? REGULAR;-}diff --git a/apps/web/src/features/channel/Message/MediaPreview.tsx b/apps/web/src/features/channel/Message/MediaPreview.tsxindex 7e4c95800b..c91de2b74c 100644--- a/apps/web/src/features/channel/Message/MediaPreview.tsx+++ b/apps/web/src/features/channel/Message/MediaPreview.tsx@@ -1,6 +1,5 @@import { MediaGrid } from '@channel/Media/MediaGrid';import { MediaViewerDialog } from '@channel/Media/MediaViewerDialog';-import { useMediaDensity } from '@channel/Media/media-density';import type { MediaItem } from '@channel/Media/media-items';import { createSignal } from 'solid-js';@@ -14,13 +13,12 @@ type MediaPreviewProps = {export function MediaPreview(props: MediaPreviewProps) {const [selectedIndex, setSelectedIndex] = createSignal(0);const [viewerOpen, setViewerOpen] = createSignal(false);- const density = useMediaDensity();return (<><MediaGriditems={props.items}- variant={density() === 'compact' ? 'compact' : 'message'}+ variant="message"class={props.class}onError={props.onError}onOpen={(index) => {diff --git a/apps/web/src/features/channel/StandaloneThread/EditableThread.tsx b/apps/web/src/features/channel/StandaloneThread/EditableThread.tsxindex dc11cef258..3c69a2d963 100644--- a/apps/web/src/features/channel/StandaloneThread/EditableThread.tsx+++ b/apps/web/src/features/channel/StandaloneThread/EditableThread.tsx@@ -10,7 +10,6 @@ import { createChannelMessageActions } from '../Channel/create-channel-message-aimport { createDeleteMessageConfirmation } from '../Channel/create-delete-message-confirmation';import type { InputHandle, InputSnapshot } from '../Input';import { Thread } from '../Thread';-import type { FocusRequest } from '../Thread/focus-request';import { buildReplyTargetValue } from '../Thread/utils/message-actions';import { channelReplyInputOffsetX } from '../Thread/utils/thread-rail-geometry';import { useStandaloneThread } from './context';@@ -20,9 +19,6 @@ type EditableThreadProps = {channelId: string;messageId: string;data?: MessageListItem;- expanded?: boolean;- keepReplying?: boolean;- replyInputFocusRequest?: FocusRequest;};function EditableThreadInner() {@@ -114,9 +110,6 @@ export function EditableThread(props: EditableThreadProps) {channelId={props.channelId}messageId={props.messageId}data={props.data}- expanded={props.expanded}- keepReplying={props.keepReplying}- replyInputFocusRequest={props.replyInputFocusRequest}><EditableThreadInner /></StandaloneThread.Root>diff --git a/apps/web/src/features/channel/StandaloneThread/Root.tsx b/apps/web/src/features/channel/StandaloneThread/Root.tsxindex 843c03154a..0aae26d634 100644--- a/apps/web/src/features/channel/StandaloneThread/Root.tsx+++ b/apps/web/src/features/channel/StandaloneThread/Root.tsx@@ -6,7 +6,7 @@ import type {MessageListItem,} from '@service-storage/messages';import { createSignal, type ParentProps } from 'solid-js';-import { createFocusRequest, type FocusRequest } from '../Thread/focus-request';+import { createFocusRequest } from '../Thread/focus-request';import { getVisibleReplyCount } from '../Thread/utils/thread-reply-indicator-helpers';import { StandaloneThreadContext } from './context';@@ -14,12 +14,6 @@ type RootProps = ParentProps<{channelId: string;messageId: string;data?: MessageListItem;- /** Show every reply instead of the latest few. */- expanded?: boolean;- /** Keep the reply input open, as a thread panel does. */- keepReplying?: boolean;- /** Shared with a host that asks for the reply input's focus. */- replyInputFocusRequest?: FocusRequest;}>;export function Root(props: RootProps) {@@ -31,11 +25,9 @@ export function Root(props: RootProps) {}function RootInner(props: RootProps) {- const [isExpanded, setIsExpanded] = createSignal(props.expanded ?? false);- const [replying, setIsReplying] = createSignal(false);- const isReplying = () => !!props.keepReplying || replying();- const replyInputFocusRequest =- props.replyInputFocusRequest ?? createFocusRequest();+ const [isExpanded, setIsExpanded] = createSignal(false);+ const [isReplying, setIsReplying] = createSignal(false);+ const replyInputFocusRequest = createFocusRequest();const parentQuery = useMessageTimelineByIdsQuery(() => ({ type: 'channel', id: (() => props.channelId)() }),diff --git a/apps/web/src/features/channel/Thread/ChannelThread.tsx b/apps/web/src/features/channel/Thread/ChannelThread.tsxindex 07cee9530d..ad66800696 100644--- a/apps/web/src/features/channel/Thread/ChannelThread.tsx+++ b/apps/web/src/features/channel/Thread/ChannelThread.tsx@@ -52,7 +52,6 @@ export function ChannelThread(props: ThreadProps) {});const isSelected = () => props.selectedMessageId?.() === props.data().id;- const repliesInPanel = () => !!props.onOpenThread;// The unified input's reply binding, resolved against this thread.// `undefined` unless the binding points into this thread; otherwise it is@@ -171,49 +170,38 @@ export function ChannelThread(props: ThreadProps) {collapseThread: () => props.setIsExpanded(false),isSelected,hasReplies,- expandThread: () =>- props.onOpenThread ? props.onOpenThread() : props.setIsExpanded(true),+ expandThread: () => props.setIsExpanded(true),isThreadExpanded: props.isExpanded,- setIsReplying: (v) =>- v && props.onOpenThread- ? props.onOpenThread({ reply: true })- : props.setIsReplying(v),+ setIsReplying: (v) => props.setIsReplying(v),});- // With replies in the panel, the summary stands for every reply.- const inlineReplyCount = () => (repliesInPanel() ? 0 : visibleReplyCount());const collapsedRepliesCount = () =>- getCollapsedRepliesCount(thread().reply_count, inlineReplyCount());+ getCollapsedRepliesCount(thread().reply_count, visibleReplyCount());const collapsedRepliesContainsNewMessages = () =>activeReplies()- .slice(inlineReplyCount())+ .slice(visibleReplyCount()).some((reply: EntityMessage) => props.isNewMessage?.(reply));const collapsedRepliesHaveUnreadNotifications = () =>props.unreadMessageIds?.some((id) =>id !== props.data().id &&- (repliesInPanel() || !displayReplies().some((reply) => reply.id === id))+ !displayReplies().some((reply) => reply.id === id)) ?? false;const collapsedReplyUsers = () =>- getUniqueReplyUserIds(activeReplies().slice(inlineReplyCount()));+ getUniqueReplyUserIds(activeReplies().slice(visibleReplyCount()));const collapsedLatestReplyAt = () =>getThreadLatestReplyAt(thread().latest_reply_at, activeReplies());// Replying to this thread — inline input open, or the unified input bound.const isReplyingToThread = () =>props.isReplying() || unifiedReplyBinding() !== undefined;const hasInlineReplyInput = () =>- !repliesInPanel() && props.isReplying() && props.inputMode !== 'unified';+ props.isReplying() && props.inputMode !== 'unified';const rootRailVisible = () =>!props.hideRail && (hasReplies() || hasInlineReplyInput());const shouldShowCollapsedIndicator = () =>- repliesInPanel()- ? collapsedRepliesCount() > 0- : !isReplyingToThread() &&- !props.isExpanded() &&- collapsedRepliesCount() > 0;+ !isReplyingToThread() && !props.isExpanded() && collapsedRepliesCount() > 0;const replyAction = () => props.getMessageActions?.(props.data())?.onReply;const shouldShowReplyButton = () =>- !repliesInPanel() &&hasReplies() &&!!replyAction() &&!isReplyingToThread() &&@@ -357,12 +345,9 @@ export function ChannelThread(props: ThreadProps) {onClick={selectThreadMessage}selected={isSelected() && !isThreadFocused()}targeted={- // The unified input's reply is bound to this root,- // channel navigation landed on it, or the thread panel- // shows its thread.- unifiedReplyBinding()?.boundToRoot ||- isRootNavTargeted() ||- props.openInPanel+ // The unified input's reply is bound to this root, or+ // channel navigation landed on it.+ unifiedReplyBinding()?.boundToRoot || isRootNavTargeted()}/></DebugSuspense>@@ -389,34 +374,32 @@ export function ChannelThread(props: ThreadProps) {<DebugSuspense name="ChannelThread.replies"><Thread.RepliesContainer flat={props.monorail}><DebugSuspense name="ChannelThread.ReplyList">- <Show when={!repliesInPanel()}>- <Thread.ReplyList- parent={props.parent()}- threadId={props.data().id}- replies={displayReplies()}- onMessageMount={props.onMessageMount}- getMessageActions={props.getMessageActions}- inputMode={props.inputMode}- messageEditor={props.messageEditor}- isNewMessage={props.isNewMessage}- onReady={setReplyListHandle}- positionTarget={props.targetNavigation?.positionTarget}- selectedReplyId={replySelection.selectedId}- targetedReplyId={() =>- props.targetNavigation?.activeTargetReplyId() ??- unifiedReplyBinding()?.boundReplyId- }- isThreadFocused={isThreadFocused}- onSelectReply={selectReply}- monorail={props.monorail}- hideRail={props.hideRail}- railContinues={- hasInlineReplyInput() ||- shouldShowCollapsedIndicator() ||- shouldShowReplyButton()- }- />- </Show>+ <Thread.ReplyList+ parent={props.parent()}+ threadId={props.data().id}+ replies={displayReplies()}+ onMessageMount={props.onMessageMount}+ getMessageActions={props.getMessageActions}+ inputMode={props.inputMode}+ messageEditor={props.messageEditor}+ isNewMessage={props.isNewMessage}+ onReady={setReplyListHandle}+ positionTarget={props.targetNavigation?.positionTarget}+ selectedReplyId={replySelection.selectedId}+ targetedReplyId={() =>+ props.targetNavigation?.activeTargetReplyId() ??+ unifiedReplyBinding()?.boundReplyId+ }+ isThreadFocused={isThreadFocused}+ onSelectReply={selectReply}+ monorail={props.monorail}+ hideRail={props.hideRail}+ railContinues={+ hasInlineReplyInput() ||+ shouldShowCollapsedIndicator() ||+ shouldShowReplyButton()+ }+ /></DebugSuspense><Show when={hasInlineReplyInput()}>@@ -488,15 +471,7 @@ export function ChannelThread(props: ThreadProps) {collapsedRepliesCount={collapsedRepliesCount()}participants={collapsedReplyUsers()}latestReplyAt={collapsedLatestReplyAt()}- title={- repliesInPanel() ? 'Open thread' : 'Expand thread'- }- allReplies={repliesInPanel()}- onClick={() =>- props.onOpenThread- ? props.onOpenThread()- : props.setIsExpanded(true)- }+ onClick={() => props.setIsExpanded(true)}hasNewMessages={collapsedRepliesContainsNewMessages()}/></Show>diff --git a/apps/web/src/features/channel/Thread/ThreadCollapsedIndicator.tsx b/apps/web/src/features/channel/Thread/ThreadCollapsedIndicator.tsxindex a1f3949c2d..577dd439b8 100644--- a/apps/web/src/features/channel/Thread/ThreadCollapsedIndicator.tsx+++ b/apps/web/src/features/channel/Thread/ThreadCollapsedIndicator.tsx@@ -12,8 +12,6 @@ type ThreadCollapsedIndicatorProps =latestReplyAt?: string;hasNewMessages?: boolean;hasUnreadNotifications?: boolean;- /** The count is every reply (the thread opens elsewhere), not a remainder. */- allReplies?: boolean;};const MAX_VISIBLE_PARTICIPANTS = 4;@@ -26,7 +24,6 @@ export function ThreadCollapsedIndicator(props: ThreadCollapsedIndicatorProps) {'latestReplyAt','hasNewMessages','hasUnreadNotifications',- 'allReplies',]);const visibleParticipants = () =>local.participants.slice(0, MAX_VISIBLE_PARTICIPANTS);@@ -79,9 +76,7 @@ export function ThreadCollapsedIndicator(props: ThreadCollapsedIndicatorProps) {/></Show><span class="text-accent font-medium whitespace-nowrap">- {getThreadReplyCountLabel(local.collapsedRepliesCount, {- all: local.allReplies,- })}+ {getThreadReplyCountLabel(local.collapsedRepliesCount)}</span><Show when={local.hasUnreadNotifications}><span class="sr-only">Unread</span>diff --git a/apps/web/src/features/channel/Thread/tests/thread-reply-indicator-helpers.test.ts b/apps/web/src/features/channel/Thread/tests/thread-reply-indicator-helpers.test.tsindex f63f59f4eb..118cb550cc 100644--- a/apps/web/src/features/channel/Thread/tests/thread-reply-indicator-helpers.test.ts+++ b/apps/web/src/features/channel/Thread/tests/thread-reply-indicator-helpers.test.ts@@ -23,8 +23,6 @@ describe('thread-reply-indicator-helpers', () => {it('formats collapsed reply labels', () => {expect(getThreadReplyCountLabel(1)).toBe('1 more reply');expect(getThreadReplyCountLabel(2)).toBe('2 more replies');- expect(getThreadReplyCountLabel(1, { all: true })).toBe('1 reply');- expect(getThreadReplyCountLabel(3, { all: true })).toBe('3 replies');});it('returns unique user ids in reply order', () => {diff --git a/apps/web/src/features/channel/Thread/types.ts b/apps/web/src/features/channel/Thread/types.tsindex 360b774844..7e27f464bf 100644--- a/apps/web/src/features/channel/Thread/types.ts+++ b/apps/web/src/features/channel/Thread/types.ts@@ -90,11 +90,4 @@ export type ThreadProps = {monorail?: boolean;/** Flat chat surfaces do not draw thread connector rails. */hideRail?: boolean;- /**- * Replies live in the channel's thread panel: the row shows only a reply- * summary that opens it, and replying opens the panel's composer.- */- onOpenThread?: (options?: { reply?: boolean }) => void;- /** This thread is the one open in the thread panel. */- openInPanel?: boolean;} & ThreadState;diff --git a/apps/web/src/features/channel/Thread/utils/thread-reply-indicator-helpers.ts b/apps/web/src/features/channel/Thread/utils/thread-reply-indicator-helpers.tsindex 00ff83c950..7bc426886d 100644--- a/apps/web/src/features/channel/Thread/utils/thread-reply-indicator-helpers.ts+++ b/apps/web/src/features/channel/Thread/utils/thread-reply-indicator-helpers.ts@@ -32,12 +32,10 @@ export function getCollapsedRepliesCount(return Math.max(totalReplies - visibleReplies, 0);}-/** `all` labels a summary that stands for the whole thread, not a remainder. */export function getThreadReplyCountLabel(- collapsedRepliesCount: number,- options?: { all?: boolean }+ collapsedRepliesCount: number): string {- return `${collapsedRepliesCount}${options?.all ? '' : ' more'} repl${+ return `${collapsedRepliesCount} more repl${collapsedRepliesCount === 1 ? 'y' : 'ies'}`;}diff --git a/apps/web/src/lib/core/hotkey/tokens.ts b/apps/web/src/lib/core/hotkey/tokens.tsindex 4aa82b0eda..3e7c6f4fd2 100644--- a/apps/web/src/lib/core/hotkey/tokens.ts+++ b/apps/web/src/lib/core/hotkey/tokens.ts@@ -364,7 +364,6 @@ export const TOKENS = {threadEditReply: 'channel.threadEditReply',threadDeleteReply: 'channel.threadDeleteReply',findInChannel: 'channel.findInChannel',- toggleThreadPanel: 'channel.toggleThreadPanel',},// drawerdiff --git a/docs/agent-guide/channels.md b/docs/agent-guide/channels.mdindex 1a2cfad32a..acdb40ff24 100644--- a/docs/agent-guide/channels.md+++ b/docs/agent-guide/channels.md@@ -264,22 +264,6 @@ and reload to verify that the system entry persists in chronological order.Also reload a short channel containing mostly system updates. Every entry shouldremain visible when the entire timeline fits without scrolling.-## Thread side panel--On desktop, a switch in its own pill right of a channel's tabs chooses the-thread layout. Its label names the current mode: **Collapse** (on) collapses-threads into a panel on the right, **Expand** (off) expands them inline. The-tooltip names the action and its shortcut, `Cmd/Ctrl+Shift+E`, which also-works from the composer. The choice persists across channels and sessions.-In collapsed mode a root shows only an `N replies` summary; clicking it,-`Reply`, or the reply and expand hotkeys opens the panel with every reply and-a composer that stays open, and the root stays highlighted. Message images and-videos shrink to small thumbnails that still open the viewer. A pane narrower-than 44rem gives the panel its full width. A notification jump to a reply-closes the panel and expands that thread inline so it can land on the reply.-Touch devices never offer the switch and keep threads inline. Check opening,-replying, switching threads, closing, the shortcut, and toggling back.-## Agent session entitiesThe Agents list includes owned and shared sessions. Rows show the shared agent