Skip to content

armgit / macro

Public Imported from GitHub
0

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

feat(channels): open a conversation's entity actions from its title (#7264)

Peter Chinman34c2b1ccbf4e
diff --git a/.cursor/frontend.sh b/.cursor/frontend.sh
index 859e24f1f1..40be7c606e 100755
--- a/.cursor/frontend.sh
+++ b/.cursor/frontend.sh
@@ -49,8 +49,8 @@ fi
: >"${DEV_LOG}"
\cd "${WORKSPACE_ROOT}"
BACKEND_ROUTES="$(cargo x frontend-proxy-routes)"
-just ensure-cache-wasm
-just ensure-agent-fold-wasm
+just apps/web/ensure-cache-wasm
+just apps/web/ensure-agent-fold-wasm
\cd "${WORKSPACE_ROOT}/apps/web"
setsid env \
PORT="${FRONTEND_PORT}" \
diff --git a/apps/web/src/features/channels-view/components/ChannelDetailView.test.tsx b/apps/web/src/features/channels-view/components/ChannelDetailView.test.tsx
index cfa34e2c1b..afe9a75f42 100644
--- a/apps/web/src/features/channels-view/components/ChannelDetailView.test.tsx
+++ b/apps/web/src/features/channels-view/components/ChannelDetailView.test.tsx
@@ -28,6 +28,7 @@ vi.mock('@channel/Channel/ChannelDetail', () => ({
),
ChannelDetailTopBar: () => null,
}));
+vi.mock('./ChannelTitleMenu', () => ({ ChannelTitleMenu: () => null }));
import { ChannelDetailView } from './ChannelDetailView';
diff --git a/apps/web/src/features/channels-view/components/ChannelDetailView.tsx b/apps/web/src/features/channels-view/components/ChannelDetailView.tsx
index abaff0c188..bdb005d5bd 100644
--- a/apps/web/src/features/channels-view/components/ChannelDetailView.tsx
+++ b/apps/web/src/features/channels-view/components/ChannelDetailView.tsx
@@ -8,6 +8,7 @@ import type { ChannelTargetRequest } from '@channel/Channel/ChannelSurface';
import { useSplitPanelOrThrow } from '@components/app/split-layout/layoutUtils';
import type { ChannelEntity } from '@entity';
import { channelsSearch } from '../channels-route';
+import { ChannelTitleMenu } from './ChannelTitleMenu';
/** Adapts a resolved conversation and navigation intent to the shared surface. */
export function ChannelDetailView(props: {
@@ -34,6 +35,7 @@ export function ChannelDetailView(props: {
<ChannelDetailTopBar
channelId={channel.channelId}
fallbackName={props.channel.name}
+ leading={<ChannelTitleMenu channel={props.channel} />}
/>
)}
</ChannelDetail>
diff --git a/apps/web/src/features/channels-view/components/ChannelTitleMenu.tsx b/apps/web/src/features/channels-view/components/ChannelTitleMenu.tsx
new file mode 100644
index 0000000000..e355e1de5d
--- /dev/null
+++ b/apps/web/src/features/channels-view/components/ChannelTitleMenu.tsx
@@ -0,0 +1,33 @@
+import { toSingleEntityActionListState } from '@app/features/next-soup/actions';
+import { SoupEntityActionsDropdown } from '@app/features/soup/SoupEntityActionsDropdown';
+import { ChannelDetailTitle } from '@channel/Channel/ChannelDetail';
+import type { ChannelEntity } from '@entity';
+import DotsThreeIcon from '@phosphor/dots-three.svg';
+import { CHANNEL_ACTION_VIEW_CONTEXT } from './rail/ChannelRailItems';
+
+/**
+ * The conversation's title followed by its entity actions, behind the same
+ * ellipsis a block's title menu uses. The actions match the channel's row in
+ * the rail, so favoriting, muting or renaming a conversation does not depend
+ * on finding that row.
+ */
+export function ChannelTitleMenu(props: { channel: ChannelEntity }) {
+ const list = toSingleEntityActionListState(() => props.channel);
+
+ return (
+ <div class="flex min-w-0 shrink items-center gap-1">
+ <ChannelDetailTitle
+ channelId={props.channel.id}
+ fallbackName={props.channel.name}
+ />
+ <SoupEntityActionsDropdown
+ entity={props.channel}
+ list={list}
+ viewContext={CHANNEL_ACTION_VIEW_CONTEXT}
+ triggerProps={{ size: 'icon-sm', label: 'Channel actions' }}
+ >
+ <DotsThreeIcon />
+ </SoupEntityActionsDropdown>
+ </div>
+ );
+}
diff --git a/apps/web/src/features/next-soup/actions/entity-action-context.test.ts b/apps/web/src/features/next-soup/actions/entity-action-context.test.ts
new file mode 100644
index 0000000000..4c4371ae18
--- /dev/null
+++ b/apps/web/src/features/next-soup/actions/entity-action-context.test.ts
@@ -0,0 +1,49 @@
+import type { EntityData } from '@entity';
+import { createRoot } from 'solid-js';
+import { describe, expect, it, vi } from 'vitest';
+
+// The real module reaches the query clients, which open websockets under jsdom.
+vi.mock('./make-mark-done-action', () => ({
+ canExecuteMarkDoneOnView: () => true,
+}));
+
+import { toSingleEntityActionListState } from './entity-action-context';
+
+const channel: EntityData = {
+ id: 'channel',
+ type: 'channel',
+ name: 'Design',
+ ownerId: 'owner',
+ channelType: 'private',
+};
+
+describe('toSingleEntityActionListState', () => {
+ it('holds the one entity and has nowhere to move on to', () => {
+ createRoot((dispose) => {
+ const list = toSingleEntityActionListState(() => channel);
+
+ expect(list.items.count()).toBe(1);
+ expect(list.items.at(0)?.original).toBe(channel);
+ expect(list.items.get('channel')?.original).toBe(channel);
+
+ list.focus.set('channel');
+ expect(list.focus.index()).toBe(0);
+ // Nothing to advance to: peeking either way stays on the entity.
+ expect(list.navigate.peekOffset(1)?.index).toBe(0);
+ expect(list.navigate.peekOffset(-1)?.index).toBe(0);
+
+ dispose();
+ });
+ });
+
+ it('is empty until the surface resolves its entity', () => {
+ createRoot((dispose) => {
+ const list = toSingleEntityActionListState(() => undefined);
+
+ expect(list.items.count()).toBe(0);
+ expect(list.navigate.peekOffset(1)).toBeUndefined();
+
+ dispose();
+ });
+ });
+});
diff --git a/apps/web/src/features/next-soup/actions/entity-action-context.ts b/apps/web/src/features/next-soup/actions/entity-action-context.ts
index 07d33854e4..9de691a72a 100644
--- a/apps/web/src/features/next-soup/actions/entity-action-context.ts
+++ b/apps/web/src/features/next-soup/actions/entity-action-context.ts
@@ -1,4 +1,7 @@
-import type { ListController } from '@app/components/list';
+import {
+ createListController,
+ type ListController,
+} from '@app/components/list';
import { isListViewID } from '@app/constants/list-views';
import type { EntityData } from '@entity';
import type { SoupRow, SoupState } from '../create-soup-state';
@@ -251,3 +254,23 @@ export function toEntityActionListState<TItem, TMetadata>(
},
};
}
+
+/**
+ * List state for a surface that shows a single entity rather than a list of
+ * them, such as a detail header's action menu. Actions that would advance or
+ * clear a list find only this entity, so they leave the surface as it is.
+ */
+export function toSingleEntityActionListState(
+ entity: () => EntityData | undefined
+): EntityActionListState {
+ const controller = createListController({
+ items: () => {
+ const only = entity();
+ return only ? [only] : [];
+ },
+ getKey: (item) => item.id,
+ isSelectable: () => false,
+ });
+
+ return toEntityActionListState({ controller, getEntity: (item) => item });
+}
diff --git a/apps/web/src/features/next-soup/actions/index.ts b/apps/web/src/features/next-soup/actions/index.ts
index bca3a2a69b..610a2712ab 100644
--- a/apps/web/src/features/next-soup/actions/index.ts
+++ b/apps/web/src/features/next-soup/actions/index.ts
@@ -8,6 +8,7 @@ export {
resolveEntityActionViewContext,
type ToEntityActionListStateOptions,
toEntityActionListState,
+ toSingleEntityActionListState,
} from './entity-action-context';
export { makeAddTagAction } from './make-add-tag-action';
export { makeBlockSenderAction } from './make-block-sender-action';
diff --git a/apps/web/src/features/soup/SoupEntityActionsDropdown.tsx b/apps/web/src/features/soup/SoupEntityActionsDropdown.tsx
new file mode 100644
index 0000000000..4890dbf829
--- /dev/null
+++ b/apps/web/src/features/soup/SoupEntityActionsDropdown.tsx
@@ -0,0 +1,76 @@
+import type {
+ EntityActionListState,
+ EntityActionViewContext,
+} from '@app/features/next-soup/actions';
+import type { EntityData } from '@entity';
+import { Dropdown } from '@ui';
+import { type ComponentProps, createSignal, type JSX } from 'solid-js';
+import { SoupEntityActionsMenu } from './SoupEntityActionsMenu';
+import { createSoupEntityMenuPickers } from './SoupEntityMenuPickers';
+
+type SoupEntityActionsDropdownProps = {
+ entity: EntityData;
+ list: EntityActionListState;
+ viewContext: EntityActionViewContext;
+ /** Host-specific items appended after the entity actions. */
+ extraItems?: JSX.Element;
+ placement?: ComponentProps<typeof Dropdown>['placement'];
+ triggerProps?: ComponentProps<typeof Dropdown.Trigger>;
+ contentClass?: string;
+ /** Trigger content. */
+ children: JSX.Element;
+};
+
+/**
+ * The entity actions of {@link SoupEntityContextMenu} behind a click, for
+ * surfaces that show one entity rather than a list of them (a detail header's
+ * title menu). Same items, same order, opened from a button instead of a
+ * right-click.
+ */
+export function SoupEntityActionsDropdown(
+ props: SoupEntityActionsDropdownProps
+) {
+ const [trigger, setTrigger] = createSignal<HTMLElement>();
+ const entities = () => [props.entity];
+
+ const pickers = createSoupEntityMenuPickers({
+ entity: () => props.entity,
+ entities,
+ // The menu is gone by the time a picker opens, so the pickers hang off
+ // the trigger, which is still on screen.
+ anchor: () => {
+ const rect = trigger()?.getBoundingClientRect();
+ return rect ? { x: rect.left, y: rect.bottom } : undefined;
+ },
+ });
+
+ return (
+ <>
+ <Dropdown placement={props.placement ?? 'bottom-start'}>
+ <Dropdown.Trigger
+ variant="ghost"
+ size="sm"
+ {...props.triggerProps}
+ ref={setTrigger}
+ >
+ {props.children}
+ </Dropdown.Trigger>
+ <Dropdown.Content
+ class={props.contentClass ?? 'w-64 text-xs text-ink-muted'}
+ >
+ <Dropdown.Group>
+ <SoupEntityActionsMenu
+ entities={entities()}
+ list={props.list}
+ viewContext={props.viewContext}
+ onSetProject={pickers.openProjectPicker}
+ onEditTags={pickers.openTagPicker()}
+ extraItems={props.extraItems}
+ />
+ </Dropdown.Group>
+ </Dropdown.Content>
+ </Dropdown>
+ <pickers.Pickers />
+ </>
+ );
+}
diff --git a/apps/web/src/features/soup/SoupEntityActionsMenu.test.tsx b/apps/web/src/features/soup/SoupEntityActionsMenu.test.tsx
new file mode 100644
index 0000000000..ee5488dd50
--- /dev/null
+++ b/apps/web/src/features/soup/SoupEntityActionsMenu.test.tsx
@@ -0,0 +1,96 @@
+import type {
+ EntityActionListState,
+ EntityActionViewContext,
+} from '@app/features/next-soup/actions';
+import { cleanup, render } from '@solidjs/testing-library';
+import { type JSX, Show } from 'solid-js';
+import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest';
+import { SoupEntityActionsMenu } from './SoupEntityActionsMenu';
+
+type TestGroup = {
+ items: { id: string; label: string; onClick: () => void }[];
+};
+
+const actions = vi.hoisted(() => ({
+ groups: [] as TestGroup[],
+}));
+
+vi.mock('@components/app/split-layout/layoutUtils', () => ({
+ useSplitPanelOrThrow: () => ({
+ handle: { content: () => ({ type: 'channels', id: 'chat' }) },
+ }),
+}));
+vi.mock('./createSoupEntityActions', () => ({
+ createSoupEntityActions: () => ({
+ buildActionGroups: () => actions.groups,
+ }),
+ viewedProjectIdFromContent: () => undefined,
+}));
+vi.mock('@core/component/ContextMenu', () => ({
+ MenuItem: (props: { text: string }) => (
+ <button type="button">{props.text}</button>
+ ),
+ MenuSeparator: () => <hr />,
+}));
+
+const group = (...labels: string[]): TestGroup => ({
+ items: labels.map((label) => ({ id: label, label, onClick: () => {} })),
+});
+
+const viewContext: EntityActionViewContext = {
+ supportsMarkDone: false,
+ senderBucket: undefined,
+};
+
+const renderMenu = (extraItems?: () => JSX.Element) =>
+ render(() => (
+ <SoupEntityActionsMenu
+ entities={[]}
+ list={{} as EntityActionListState}
+ viewContext={viewContext}
+ extraItems={extraItems?.()}
+ />
+ ));
+
+beforeEach(() => {
+ actions.groups = [group('Favorite'), group('Delete')];
+});
+afterEach(cleanup);
+
+describe('SoupEntityActionsMenu separators', () => {
+ it('separates action groups without trailing the last one', () => {
+ const view = renderMenu();
+
+ expect(view.container.querySelectorAll('hr')).toHaveLength(1);
+ });
+
+ it('omits the separator when a host\u2019s extra items render nothing', () => {
+ const view = renderMenu(() => (
+ <Show when={false}>
+ <button type="button">Move to label</button>
+ </Show>
+ ));
+
+ expect(view.container.querySelectorAll('hr')).toHaveLength(1);
+ expect(view.container.textContent).toBe('FavoriteDelete');
+ });
+
+ it('separates extra items that do render', () => {
+ const view = renderMenu(() => (
+ <Show when={true}>
+ <button type="button">Move to label</button>
+ </Show>
+ ));
+
+ expect(view.container.querySelectorAll('hr')).toHaveLength(2);
+ expect(view.container.textContent).toBe('FavoriteDeleteMove to label');
+ });
+
+ it('leads with extra items alone when the entity has no actions', () => {
+ actions.groups = [];
+ const view = renderMenu(() => <button type="button">Move to label</button>);
+
+ expect(view.container.querySelectorAll('hr')).toHaveLength(0);
+ expect(view.container.textContent).toBe('Move to label');
+ });
+});
diff --git a/apps/web/src/features/soup/SoupEntityActionsMenu.tsx b/apps/web/src/features/soup/SoupEntityActionsMenu.tsx
index 92a3ddc097..9fc2958b99 100644
--- a/apps/web/src/features/soup/SoupEntityActionsMenu.tsx
+++ b/apps/web/src/features/soup/SoupEntityActionsMenu.tsx
@@ -5,7 +5,7 @@ import type {
import { useSplitPanelOrThrow } from '@components/app/split-layout/layoutUtils';
import { MenuItem, MenuSeparator } from '@core/component/ContextMenu';
import type { EntityData } from '@entity';
-import { For, Show } from 'solid-js';
+import { children, For, type JSX, Show } from 'solid-js';
import {
createSoupEntityActions,
viewedProjectIdFromContent,
@@ -18,11 +18,18 @@ interface SoupEntityActionsMenuProps {
onActionComplete?: () => void;
onEditTags?: () => void;
onSetProject?: () => void;
+ /** Host-specific items shown after the entity actions. */
+ extraItems?: JSX.Element;
}
export const SoupEntityActionsMenu = (props: SoupEntityActionsMenuProps) => {
const panel = useSplitPanelOrThrow();
const { buildActionGroups } = createSoupEntityActions();
+ // Resolved rather than tested as JSX: a host whose items render nothing
+ // (label rows behind a flag, say) still passes a truthy element, and
+ // separating on that alone leaves a divider under the last action.
+ const extraItems = children(() => props.extraItems);
+ const hasExtraItems = () => extraItems.toArray().length > 0;
const groups = () => {
const content = panel.handle.content();
@@ -41,27 +48,35 @@ export const SoupEntityActionsMenu = (props: SoupEntityActionsMenuProps) => {
};
return (
- <For each={groups()}>
- {(group, groupIndex) => (
- <>
- <Show when={groupIndex() > 0}>
- <MenuSeparator />
- </Show>
- <For each={group.items}>
- {(action) => (
- <MenuItem
- text={action.label}
- icon={action.icon}
- hotkeyToken={action.hotkeyToken}
- shortcut={action.shortcut}
- disabled={action.disabled}
- onClick={() => handleAction(action.onClick)}
- class={action.destructive ? 'text-failure-ink' : undefined}
- />
- )}
- </For>
- </>
- )}
- </For>
+ <>
+ <For each={groups()}>
+ {(group, groupIndex) => (
+ <>
+ <Show when={groupIndex() > 0}>
+ <MenuSeparator />
+ </Show>
+ <For each={group.items}>
+ {(action) => (
+ <MenuItem
+ text={action.label}
+ icon={action.icon}
+ hotkeyToken={action.hotkeyToken}
+ shortcut={action.shortcut}
+ disabled={action.disabled}
+ onClick={() => handleAction(action.onClick)}
+ class={action.destructive ? 'text-failure-ink' : undefined}
+ />
+ )}
+ </For>
+ </>
+ )}
+ </For>
+ <Show when={hasExtraItems()}>
+ <Show when={groups().length > 0}>
+ <MenuSeparator />
+ </Show>
+ {extraItems()}
+ </Show>
+ </>
);
};
diff --git a/apps/web/src/features/soup/SoupEntityContextMenu.tsx b/apps/web/src/features/soup/SoupEntityContextMenu.tsx
index de848d3294..3c3ec794da 100644
--- a/apps/web/src/features/soup/SoupEntityContextMenu.tsx
+++ b/apps/web/src/features/soup/SoupEntityContextMenu.tsx
@@ -1,25 +1,15 @@
-import {
- type EntityActionListState,
- type EntityActionViewContext,
- makeAddTagAction,
+import type {
+ EntityActionListState,
+ EntityActionViewContext,
} from '@app/features/next-soup/actions';
-import { ProjectPickerPopover } from '@app/features/projects/project-property';
import {
ContextMenuContent,
ContextMenuTrigger,
- MenuSeparator,
} from '@core/component/ContextMenu';
import { touchHandler } from '@core/directive/touchHandler';
import { isMobile } from '@core/mobile/isMobile';
import type { EntityData } from '@entity';
import { ContextMenu } from '@kobalte/core/context-menu';
-import {
- TagPickerPopover,
- tagEntityType,
- useSoupDocTags,
-} from '@property/tags';
-import type { EntityType } from '@service-properties/generated/schemas/entityType';
-import type { SoupProperty } from '@service-storage/generated/schemas/soupProperty';
import { cn } from '@ui';
import {
type Accessor,
@@ -33,6 +23,10 @@ import {
import { getSoupMenuEntities } from './collection/rows';
import { useSoupEntityActionDrawer } from './SoupEntityActionDrawerContext';
import { SoupEntityActionsMenu } from './SoupEntityActionsMenu';
+import {
+ createSoupEntityMenuPickers,
+ type SoupEntityMenuAnchor,
+} from './SoupEntityMenuPickers';
interface SoupEntityContextMenuProps {
entity: EntityData;
@@ -50,48 +44,20 @@ interface SoupEntityContextMenuProps {
extraItems?: JSX.Element;
}
-function RowTagPicker(props: {
- entityId: string;
- entityType: EntityType;
- properties: Accessor<SoupProperty[] | undefined>;
- position: { x: number; y: number } | undefined;
- onClose: () => void;
-}) {
- const docTags = useSoupDocTags(
- props.entityId,
- props.entityType,
- props.properties
- );
-
- return (
- <TagPickerPopover
- docTags={docTags}
- open
- onOpenChange={(open) => {
- if (!open) props.onClose();
- }}
- getAnchorRect={() => props.position}
- />
- );
-}
-
export const SoupEntityContextMenu: FlowComponent<
SoupEntityContextMenuProps
> = (props) => {
const drawerManager = useSoupEntityActionDrawer();
- const addTagAction = makeAddTagAction();
-
- const [tagPickerOpen, setTagPickerOpen] = createSignal(false);
- const [projectTasks, setProjectTasks] = createSignal<string[]>();
- const [menuPosition, setMenuPosition] = createSignal<{
- x: number;
- y: number;
- }>();
+ const [menuPosition, setMenuPosition] = createSignal<SoupEntityMenuAnchor>();
const menuEntities = () =>
getSoupMenuEntities(props.entity, props.selectedEntities());
- const canEditTags = () => addTagAction.canExecute(props.entity);
+ const pickers = createSoupEntityMenuPickers({
+ entity: () => props.entity,
+ entities: menuEntities,
+ anchor: menuPosition,
+ });
return (
<Switch>
@@ -133,50 +99,15 @@ export const SoupEntityContextMenu: FlowComponent<
entities={menuEntities()}
list={props.list}
viewContext={props.viewContext}
- onSetProject={() => {
- const ids = menuEntities().map((entity) => entity.id);
- setTimeout(() => setProjectTasks(ids), 0);
- }}
- onEditTags={
- canEditTags()
- ? () => setTimeout(() => setTagPickerOpen(true), 0)
- : undefined
- }
+ onSetProject={pickers.openProjectPicker}
+ onEditTags={pickers.openTagPicker()}
+ extraItems={props.extraItems}
/>
- <Show when={props.extraItems}>
- <MenuSeparator />
- {props.extraItems}
- </Show>
</ContextMenuContent>
</Show>
</ContextMenu.Portal>
</ContextMenu>
- <Show when={projectTasks()}>
- {(ids) => (
- <ProjectPickerPopover
- taskIds={ids()}
- open
- onOpenChange={(open) => {
- if (!open) setProjectTasks(undefined);
- }}
- getAnchorRect={() => menuPosition()}
- />
- )}
- </Show>
- <Show when={tagPickerOpen() && tagEntityType(props.entity)}>
- {(entityType) => (
- <RowTagPicker
- entityId={props.entity.id}
- entityType={entityType()}
- properties={() => {
- const entity = props.entity;
- return 'properties' in entity ? entity.properties : undefined;
- }}
- position={menuPosition()}
- onClose={() => setTagPickerOpen(false)}
- />
- )}
- </Show>
+ <pickers.Pickers />
</Match>
</Switch>
);
diff --git a/apps/web/src/features/soup/SoupEntityMenuPickers.tsx b/apps/web/src/features/soup/SoupEntityMenuPickers.tsx
new file mode 100644
index 0000000000..978a284a78
--- /dev/null
+++ b/apps/web/src/features/soup/SoupEntityMenuPickers.tsx
@@ -0,0 +1,105 @@
+import { makeAddTagAction } from '@app/features/next-soup/actions';
+import { ProjectPickerPopover } from '@app/features/projects/project-property';
+import type { EntityData } from '@entity';
+import {
+ TagPickerPopover,
+ tagEntityType,
+ useSoupDocTags,
+} from '@property/tags';
+import type { EntityType } from '@service-properties/generated/schemas/entityType';
+import type { SoupProperty } from '@service-storage/generated/schemas/soupProperty';
+import { type Accessor, type Component, createSignal, Show } from 'solid-js';
+
+/** Viewport point a picker opens against. */
+export type SoupEntityMenuAnchor = { x: number; y: number };
+
+function EntityTagPicker(props: {
+ entityId: string;
+ entityType: EntityType;
+ properties: Accessor<SoupProperty[] | undefined>;
+ position: SoupEntityMenuAnchor | undefined;
+ onClose: () => void;
+}) {
+ const docTags = useSoupDocTags(
+ props.entityId,
+ props.entityType,
+ props.properties
+ );
+
+ return (
+ <TagPickerPopover
+ docTags={docTags}
+ open
+ onOpenChange={(open) => {
+ if (!open) props.onClose();
+ }}
+ getAnchorRect={() => props.position}
+ />
+ );
+}
+
+export type SoupEntityMenuPickers = {
+ /** Undefined when the entity can't be tagged, which drops the menu item. */
+ openTagPicker: Accessor<(() => void) | undefined>;
+ openProjectPicker: () => void;
+ /** Mount outside the menu: the pickers outlive the menu that opened them. */
+ Pickers: Component;
+};
+
+/**
+ * The tag and project pickers an entity menu hands off to. Both open a tick
+ * after their item runs so the menu's own dismissal cannot take back the
+ * focus the popover claims on mount.
+ */
+export function createSoupEntityMenuPickers(options: {
+ entity: Accessor<EntityData>;
+ entities: Accessor<EntityData[]>;
+ anchor: Accessor<SoupEntityMenuAnchor | undefined>;
+}): SoupEntityMenuPickers {
+ const addTagAction = makeAddTagAction();
+ const [tagPickerOpen, setTagPickerOpen] = createSignal(false);
+ const [projectTaskIds, setProjectTaskIds] = createSignal<string[]>();
+
+ const Pickers: Component = () => (
+ <>
+ <Show when={projectTaskIds()}>
+ {(ids) => (
+ <ProjectPickerPopover
+ taskIds={ids()}
+ open
+ onOpenChange={(open) => {
+ if (!open) setProjectTaskIds(undefined);
+ }}
+ getAnchorRect={options.anchor}
+ />
+ )}
+ </Show>
+ <Show when={tagPickerOpen() && tagEntityType(options.entity())}>
+ {(entityType) => (
+ <EntityTagPicker
+ entityId={options.entity().id}
+ entityType={entityType()}
+ properties={() => {
+ const entity = options.entity();
+ return 'properties' in entity ? entity.properties : undefined;
+ }}
+ position={options.anchor()}
+ onClose={() => setTagPickerOpen(false)}
+ />
+ )}
+ </Show>
+ </>
+ );
+
+ return {
+ openTagPicker: () =>
+ addTagAction.canExecute(options.entity())
+ ? () => setTimeout(() => setTagPickerOpen(true), 0)
+ : undefined,
+ openProjectPicker: () => {
+ const ids = options.entities().map((entity) => entity.id);
+ setTimeout(() => setProjectTaskIds(ids), 0);
+ },
+ Pickers,
+ };
+}
diff --git a/apps/web/src/features/soup/index.ts b/apps/web/src/features/soup/index.ts
index 6b27590c2f..cafc4ac12c 100644
--- a/apps/web/src/features/soup/index.ts
+++ b/apps/web/src/features/soup/index.ts
@@ -3,5 +3,6 @@ export * from './createSoupEntityActions';
export * from './filters';
export * from './SoupEntityActionDrawer';
export * from './SoupEntityActionDrawerManager';
+export * from './SoupEntityActionsDropdown';
export * from './SoupEntityContextMenu';
export * from './search';
diff --git a/docs/AGENT_GUIDE/channels.md b/docs/AGENT_GUIDE/channels.md
index cc5baf5ca4..19656c7fde 100644
--- a/docs/AGENT_GUIDE/channels.md
+++ b/docs/AGENT_GUIDE/channels.md
@@ -784,8 +784,14 @@ In the Chat workspace — and wherever a channel opens inline inside another
view's detail stack (a channel mention followed from the email view, say) — the
conversation renders an inline detail whose top bar holds the channel avatar
and name, the same tab strip, live viewer avatars, and the `Call` and
-`Ask Macro` buttons. The title `...` menu (rename, channel picture) is not
-offered there; open the channel as a split (shift-click a rail row) to use it.
+`Ask Macro` buttons. In Chat an ellipsis follows the name and opens the same
+entity actions as right-clicking the conversation's rail row — `Open in new
+split`, `Rename`, `Favorite`/`Unfavorite`, `Snooze notifications…`, `Mute
+notifications`, `Remind me`, `Copy Link`, `Copy ID` — so a channel can be
+favorited without finding its row. A channel inlined in another view's detail
+stack has no such menu. Channel-picture actions are in neither: they belong to
+the split's own title `...` menu, so open the channel as a split (shift-click a
+rail row) to reach them.
`Calls` tab: recordings, transcriptions, and summaries for this channel. Click a
row to open the call. The search field above the list matches call names and