Skip to content

Beautiful, AI-native markdown IDE and LLM wiki

Fix acp plus (#3111)

shagun-singh-inkeep99a5d9951f9b
diff --git a/.changeset/acp-composer-drop-add-context.md b/.changeset/acp-composer-drop-add-context.md
new file mode 100644
index 000000000..c18d6661e
--- /dev/null
+++ b/.changeset/acp-composer-drop-add-context.md
@@ -0,0 +1,5 @@
+---
+"@inkeep/open-knowledge": patch
+---
+
+The agent thread composer no longer carries an add-context `+`. It opened a one-row menu whose only row was the comment queue, and that row was inert unless the queue had already loaded and had something in it, so in practice the button opened a menu that could not do anything. Attaching a batch there was also the weaker of the two paths: it folded the comments into your next message but left every thread queued, while the Comments panel's own Send to chat dispatches to the open session and actually closes the review requests. That panel is now the single way to send queued comments to an agent, and the composer's bottom bar is just the agent settings on the left with the context ring and send button on the right.
diff --git a/packages/app/src/comments/queue-attachment.test.ts b/packages/app/src/comments/queue-attachment.test.ts
deleted file mode 100644
index 4b5f77143..000000000
--- a/packages/app/src/comments/queue-attachment.test.ts
+++ /dev/null
@@ -1,127 +0,0 @@
-/**
- * Capturing the queue for a composer that attaches it.
- *
- * The batch is captured when the `+` menu's Queue toggle goes ON, and composed
- * into the message at send. Two properties matter: every checked comment is in
- * the capture (a partial batch silently drops someone's review), and capturing
- * resolves nothing — attaching is not dispatching, and closing a request nobody
- * acted on is the failure the queue exists to prevent.
- */
-
-import { describe, expect, test, vi } from 'vitest';
-
-vi.mock('sonner', () => ({ toast: { error: vi.fn(), success: vi.fn(), info: vi.fn() } }));
-
-vi.mock('./comments-client', () => {
- const metas = [
- {
- threadId: 't1',
- docName: 'recipes/one',
- anchor: { exact: 'Heat oven to 425F', prefix: '', suffix: '', start: 0, end: 17 },
- state: 'anchored',
- queued: true,
- latestComment: 'too hot?',
- createdBy: 'principal-abc',
- createdAt: 800,
- },
- {
- threadId: 't2',
- docName: 'recipes/two',
- anchor: { exact: 'Whisk the peanut sauce', prefix: '', suffix: '', start: 0, end: 22 },
- state: 'anchored',
- queued: true,
- latestComment: 'which peanut butter?',
- createdBy: 'principal-abc',
- createdAt: 900,
- },
- ];
- return {
- __metas: metas,
- listThreads: vi.fn(async () => metas),
- createThread: vi.fn(),
- reply: vi.fn(),
- resolveThread: vi.fn(),
- reopenThread: vi.fn(),
- replaceAnchor: vi.fn(),
- queueThread: vi.fn(),
- unqueueThread: vi.fn(),
- deleteThread: vi.fn(),
- prepareDispatchBatch: vi.fn(async (ids: readonly string[]) => ({
- results: ids.map((id) => {
- const m = metas.find((entry) => entry.threadId === id);
- if (!m) return { threadId: id, ok: false, error: 'not-found' };
- return {
- threadId: id,
- ok: true,
- meta: m,
- payload: {
- docName: m.docName,
- instruction: m.latestComment,
- passage: { exact: m.anchor.exact, prefix: '', suffix: '' },
- anchorLost: false,
- passageRepeats: false,
- },
- };
- }),
- })),
- completeDispatchBatch: vi.fn(async () => ({ results: [] })),
- };
-});
-
-describe('prepareQueuedComments', () => {
- test('captures every checked comment with its doc and passage', async () => {
- vi.resetModules();
- const store = await import('./store');
- await store.refresh();
- expect(store.getSelectedQueue()).toHaveLength(2);
-
- const { prepareQueuedComments } = await import('./queue-attachment');
- const items = await prepareQueuedComments();
-
- expect(items).toHaveLength(2);
- expect(items?.map((i) => i.body)).toEqual(['too hot?', 'which peanut butter?']);
- // A batch spans documents, so each item names its own — attributing a
- // comment to the wrong file is what the per-item `docName` prevents.
- expect(items?.map((i) => i.docName)).toEqual(['recipes/one', 'recipes/two']);
- expect(items?.map((i) => i.quote)).toEqual(['Heat oven to 425F', 'Whisk the peanut sauce']);
- });
-
- test('composes into a message with the draft leading', async () => {
- // The typed words frame the comments; the composer holds only those words
- // while you write, and this is where the two are joined.
- vi.resetModules();
- const store = await import('./store');
- await store.refresh();
-
- const { prepareQueuedComments } = await import('./queue-attachment');
- const { composeCommentBatchInstruction } = await import('./comment-chips');
- const items = await prepareQueuedComments();
- const text = composeCommentBatchInstruction(items ?? [], 'Keep the voice consistent.');
-
- expect(text.startsWith('Keep the voice consistent.')).toBe(true);
- expect(text).toContain('too hot?');
- expect(text).toContain('which peanut butter?');
- });
-
- test('resolves nothing — attaching is not dispatching', async () => {
- vi.resetModules();
- const store = await import('./store');
- await store.refresh();
-
- const { prepareQueuedComments } = await import('./queue-attachment');
- await prepareQueuedComments();
-
- const api = await import('./comments-client');
- expect(api.completeDispatchBatch).not.toHaveBeenCalled();
- // Still queued and still checked — nothing has been sent yet, and the Ask
- // AI composer's Send must still be able to carry them.
- expect(store.getSelectedQueue()).toHaveLength(2);
- });
-
- test('an empty queue captures nothing, so the toggle stays off', async () => {
- vi.resetModules();
- const { prepareQueuedComments } = await import('./queue-attachment');
- // No `refresh()`, so the store's queue is empty.
- expect(await prepareQueuedComments()).toBeNull();
- });
-});
diff --git a/packages/app/src/comments/queue-attachment.ts b/packages/app/src/comments/queue-attachment.ts
deleted file mode 100644
index d2d2a5337..000000000
--- a/packages/app/src/comments/queue-attachment.ts
+++ /dev/null
@@ -1,54 +0,0 @@
-/**
- * Attaching the comment queue to a composer that has no context-chip row.
- *
- * The Ask AI composer attaches the queue as context and composes it into the
- * prompt at send. An agent thread's composer is a plain string field, so this
- * gives it the same shape with the pieces it lacks: `prepareQueuedComments`
- * captures the batch when you switch it ON, and the composer folds it into the
- * message at send time with the draft as its leading instruction.
- *
- * Capturing at attach rather than at send is what keeps `submit` synchronous —
- * the composer's send is fire-and-forget today, and making it await a server
- * round-trip would open a double-send window it has no guard for. The cost is
- * that a comment queued AFTER you attach is not in the captured batch; toggle
- * off and on to re-capture.
- *
- * **Nothing resolves.** Attaching, and even sending, leaves every thread queued:
- * only a real dispatch may close a review request, and a thread's send does not
- * report whether the prompt landed.
- */
-
-import { t } from '@lingui/core/macro';
-import { toast } from 'sonner';
-import { type CommentBatchItem, toCommentBatchItem } from './comment-chips';
-import * as api from './comments-client';
-import { getSelectedQueue, refresh } from './store';
-
-/**
- * Capture the checked queue as batch items, ready to compose into a message.
- * `null` when there is nothing to attach, so the caller stays detached.
- *
- * Goes through `prepareDispatchBatch` rather than reading the local store: the
- * server re-anchors on prepare, so a passage that moved is reported as lost
- * HERE, and it is the only side that knows whether a quote repeats in its
- * document — the two facts that stop an agent editing the wrong passage.
- */
-export async function prepareQueuedComments(): Promise<CommentBatchItem[] | null> {
- const ids = getSelectedQueue();
- if (ids.length === 0) return null;
-
- let prepared: Awaited<ReturnType<typeof api.prepareDispatchBatch>>;
- try {
- prepared = await api.prepareDispatchBatch(ids);
- } catch {
- toast.error(t`Couldn't read the queued comments.`);
- return null;
- }
-
- const payloads = prepared.results.flatMap((item) => (item.ok ? [item.payload] : []));
- // Prepare re-anchors, which can flip a thread to orphaned; pull that in so the
- // queue reflects what was just captured.
- await refresh().catch(() => undefined);
- if (payloads.length === 0) return null;
- return payloads.map(toCommentBatchItem);
-}
diff --git a/packages/app/src/components/ComposerAddContextMenu.dom.test.tsx b/packages/app/src/components/ComposerAddContextMenu.dom.test.tsx
deleted file mode 100644
index eacf06a7b..000000000
--- a/packages/app/src/components/ComposerAddContextMenu.dom.test.tsx
+++ /dev/null
@@ -1,205 +0,0 @@
-/**
- * The composer's `+` menu.
- *
- * What it exists to fix: dismissing the queued-comments chip had no inverse, so
- * "not part of this message" was a one-way door until you happened to queue
- * another comment. These pin the door open in both directions, and pin the two
- * states where the row must NOT act — nothing queued, and already attached —
- * since both would otherwise read as a button that silently does nothing.
- */
-
-import { cleanup, render, screen } from '@testing-library/react';
-import userEvent from '@testing-library/user-event';
-import { afterEach, describe, expect, test } from 'vitest';
-import { ComposerAddContextMenu } from './ComposerAddContextMenu';
-
-afterEach(() => cleanup());
-
-function renderMenu(
- props: Partial<{
- queueCount: number;
- queueAttached: boolean;
- compact: boolean;
- onAddQueue: () => void;
- onRemoveQueue: () => void;
- }> = {},
-) {
- return render(
- <ComposerAddContextMenu
- queueCount={props.queueCount ?? 3}
- queueAttached={props.queueAttached ?? false}
- compact={props.compact ?? false}
- onAddQueue={props.onAddQueue ?? (() => {})}
- onRemoveQueue={props.onRemoveQueue ?? (() => {})}
- />,
- );
-}
-
-describe('the composer + menu', () => {
- test('is present with nothing attached — it is how you attach', async () => {
- // Gating the `+` on there being something to add would hide it exactly when
- // someone goes looking for it.
- renderMenu({ queueCount: 0 });
- expect(screen.getByTestId('composer-add-context')).toBeTruthy();
- });
-
- test('opens to a Queue row that reports the count', async () => {
- const user = userEvent.setup();
- renderMenu({ queueCount: 3 });
-
- await user.click(screen.getByTestId('composer-add-context'));
- const row = await screen.findByTestId('composer-add-context-queue');
- expect(row.textContent).toMatch(/3 comments/);
- });
-
- test('clicking Queue attaches it', async () => {
- const user = userEvent.setup();
- let added = 0;
- renderMenu({
- onAddQueue: () => {
- added += 1;
- },
- });
-
- await user.click(screen.getByTestId('composer-add-context'));
- await user.click(await screen.findByTestId('composer-add-context-queue'));
- expect(added).toBe(1);
- });
-
- test('an empty queue leaves the row inert and says why', async () => {
- const user = userEvent.setup();
- let added = 0;
- renderMenu({
- queueCount: 0,
- onAddQueue: () => {
- added += 1;
- },
- });
-
- await user.click(screen.getByTestId('composer-add-context'));
- const row = await screen.findByTestId('composer-add-context-queue');
- // Visible but disabled: a missing row reads as a broken menu to someone who
- // opened it specifically to add comments.
- expect(row.getAttribute('data-disabled')).not.toBeNull();
- expect(row.textContent).toMatch(/nothing queued/i);
- await user.click(row);
- expect(added).toBe(0);
- });
-
- test('the menu is wide enough that a row does not wrap', async () => {
- // `DropdownMenuContent` sizes to `--radix-dropdown-menu-trigger-width` with
- // a `min-w-32` floor. Against this icon trigger that is 8rem, which wrapped
- // "Queue (5 comments)" onto two lines. `w-60` also matches the agent
- // settings menu sharing that action bar.
- const user = userEvent.setup();
- renderMenu({ queueCount: 5 });
-
- await user.click(screen.getByTestId('composer-add-context'));
- const content = await screen.findByTestId('composer-add-context-menu');
- expect(content.className).toContain('w-60');
- // The bug was the trigger-width sizing, and that is what must be gone. The
- // `min-w-32` floor survives (different tailwind-merge group) and is inert
- // at 15rem — leaving it in place is correct, not a missed override.
- expect(content.className).not.toContain('--radix-dropdown-menu-trigger-width');
- });
-
- test('compact sizes the trigger to a dense action bar', async () => {
- // The agent thread's bar is `h-6` controls; the default `size-8` button
- // towered over the settings trigger beside it.
- const { rerender } = renderMenu({ compact: true });
- expect(screen.getByTestId('composer-add-context').className).toContain('h-6');
-
- rerender(
- <ComposerAddContextMenu
- queueCount={3}
- queueAttached={false}
- compact={false}
- onAddQueue={() => {}}
- />,
- );
- // The composer row is sized to a full-height input — not h-6 there.
- expect(screen.getByTestId('composer-add-context').className).toContain('size-8');
- });
-
- test('a detach handler turns the row into a real checkbox', async () => {
- // `menuitemcheckbox` + `aria-checked` is what makes the state reachable to
- // a screen reader — the Switch beside it is decorative and aria-hidden, so
- // the role is the whole accessibility story here.
- const user = userEvent.setup();
- renderMenu({ queueAttached: true, onRemoveQueue: () => {} });
-
- await user.click(screen.getByTestId('composer-add-context'));
- const row = await screen.findByTestId('composer-add-context-queue');
- expect(row.getAttribute('role')).toBe('menuitemcheckbox');
- expect(row.getAttribute('aria-checked')).toBe('true');
- });
-
- test('toggling off detaches, toggling on re-attaches', async () => {
- const user = userEvent.setup();
- let added = 0;
- let removed = 0;
- const { rerender } = renderMenu({
- queueAttached: true,
- onAddQueue: () => {
- added += 1;
- },
- onRemoveQueue: () => {
- removed += 1;
- },
- });
-
- await user.click(screen.getByTestId('composer-add-context'));
- await user.click(await screen.findByTestId('composer-add-context-queue'));
- expect(removed).toBe(1);
- expect(added).toBe(0);
-
- rerender(
- <ComposerAddContextMenu
- queueCount={3}
- queueAttached={false}
- compact={false}
- onAddQueue={() => {
- added += 1;
- }}
- onRemoveQueue={() => {
- removed += 1;
- }}
- />,
- );
- // The menu stays open through a toggle (settings-menu parity), so the row
- // is still reachable without reopening.
- await user.click(await screen.findByTestId('composer-add-context-queue'));
- expect(added).toBe(1);
- expect(removed).toBe(1);
- });
-
- test('an empty queue cannot be toggled on', async () => {
- const user = userEvent.setup();
- let added = 0;
- renderMenu({
- queueCount: 0,
- queueAttached: true,
- onAddQueue: () => {
- added += 1;
- },
- onRemoveQueue: () => {},
- });
-
- await user.click(screen.getByTestId('composer-add-context'));
- const row = await screen.findByTestId('composer-add-context-queue');
- // Attached-but-empty must read as OFF: a switch promising an attachment
- // that carries nothing is worse than no switch.
- expect(row.getAttribute('aria-checked')).toBe('false');
- expect(row.getAttribute('data-disabled')).not.toBeNull();
- await user.click(row);
- expect(added).toBe(0);
- });
-
- test('the trigger says what it does, not what it looks like', async () => {
- // "Plus" / "Add" alone leaves a screen-reader user guessing what is added.
- renderMenu();
- expect(screen.getByTestId('composer-add-context').getAttribute('aria-label')).toMatch(
- /add context to this message/i,
- );
- });
-});
diff --git a/packages/app/src/components/ComposerAddContextMenu.tsx b/packages/app/src/components/ComposerAddContextMenu.tsx
deleted file mode 100644
index 9f7741acc..000000000
--- a/packages/app/src/components/ComposerAddContextMenu.tsx
+++ /dev/null
@@ -1,138 +0,0 @@
-/**
- * The composer's `+` — add context to this message.
- *
- * For composers with NO context-chip row. Where a row exists (the Ask AI
- * composer), the chip itself is the toggle: it already has to render to say a
- * queue exists, so a second control behind a menu was one click deep, invisible
- * until opened, and a duplicate of the ✕ it sat above. An agent thread's
- * composer is a plain text field with nowhere to put a chip, which is what this
- * menu is for.
- *
- * Opened as a menu rather than a bare button because context sources will grow
- * past the comment queue, and a row of one button per possible source stops
- * being a summary of what IS attached.
- *
- * Attaching is deliberately NOT sending: the item puts the batch on the message
- * so the composer's own send carries it.
- *
- * The row is a toggle. It once had a second, action-only variant for a host
- * that could not undo the add; nothing ever rendered it, so it is gone rather
- * than kept warm for a caller that may never arrive.
- */
-
-import { Plural, useLingui } from '@lingui/react/macro';
-import { Plus } from 'lucide-react';
-import { Button } from '@/components/ui/button';
-import {
- DropdownMenu,
- DropdownMenuCheckboxItem,
- DropdownMenuContent,
- DropdownMenuTrigger,
-} from '@/components/ui/dropdown-menu';
-import { Switch } from '@/components/ui/switch';
-import { cn } from '@/lib/utils';
-
-export function ComposerAddContextMenu({
- queueCount,
- queueAttached,
- compact = false,
- onAddQueue,
- onRemoveQueue,
-}: {
- /** Comments waiting in the dispatch queue, attached or not. `0` → the row is disabled. */
- queueCount: number;
- /** The queue is riding this message — the toggle's state. */
- queueAttached: boolean;
- /** Take the queue back off this message. */
- onRemoveQueue: () => void;
- /**
- * Size the trigger for a dense action bar rather than a composer row.
- *
- * The agent thread's bar is a row of `h-6` / `text-xs` controls (the settings
- * trigger beside this one); the Ask AI composer's row is sized to a
- * full-height input and its send button. One fixed size cannot sit right in
- * both, so the host says which bar it is — rather than the control guessing
- * from context or every caller passing raw classes.
- */
- compact?: boolean;
- onAddQueue: () => void;
-}) {
- const { t } = useLingui();
- return (
- <DropdownMenu>
- <DropdownMenuTrigger asChild>
- <Button
- type="button"
- // Compact rides `icon-xs` so the trigger is square, matching the
- // settings trigger beside it; the class below only restates the height
- // and swaps the radius.
- size={compact ? 'icon-xs' : undefined}
- variant="ghost"
- aria-label={t`Add context to this message`}
- data-testid="composer-add-context"
- // `shrink-0` either way, so the row's layout is identical whether or
- // not anything is attached — the input keeps every remaining pixel.
- className={cn(
- 'shrink-0 text-muted-foreground hover:text-foreground',
- compact ? 'h-6 rounded-md' : 'size-8',
- )}
- >
- <Plus className={compact ? 'size-3.5' : 'size-4'} />
- </Button>
- </DropdownMenuTrigger>
- {/* `align="start"` so the menu grows from the `+` rather than the far side
- of the composer, and `side="top"` because the composer is docked at the
- bottom of the column — a downward menu would open off-screen.
- The width override is required, not cosmetic: DropdownMenuContent
- sizes itself to `--radix-dropdown-menu-trigger-width` with a `min-w-32`
- floor, which is 8rem against a 2rem icon trigger — narrow enough to
- wrap a row like "Queue (5 comments)" onto two lines. `w-60` is the
- agent-settings menu's width, so the two menus in that action bar are
- the same size rather than nearly. */}
- <DropdownMenuContent
- align="start"
- side="top"
- className="w-60"
- data-testid="composer-add-context-menu"
- >
- {/* An empty queue leaves the row visible but inert: hiding it would make
- the menu look broken to someone who opened it specifically to add
- comments, and the secondary line says why.
-
- The agent-settings menu's own on/off row shape (`Fast mode`): a real
- `menuitemcheckbox` owns the state, its default checkmark is hidden,
- and a decorative Switch stands in on the right. The Switch is
- aria-hidden + pointer-events-none so it never becomes a second,
- invalid menu control. */}
- <DropdownMenuCheckboxItem
- checked={queueCount > 0 && queueAttached}
- onCheckedChange={(next) => (next ? onAddQueue() : onRemoveQueue())}
- disabled={queueCount === 0}
- // Keep the menu open on toggle, matching the settings menu — you can
- // see the chip row change behind it without reopening.
- onSelect={(event) => event.preventDefault()}
- className="items-start justify-between gap-4 pr-2 [&_[data-slot=dropdown-menu-checkbox-item-indicator]]:hidden"
- data-testid="composer-add-context-queue"
- >
- <div className="flex min-w-0 flex-col">
- <span>{t`Queue`}</span>
- <span className="text-1sm text-muted-foreground">
- {queueCount === 0 ? (
- t`Nothing queued`
- ) : (
- <Plural value={queueCount} one="# comment" other="# comments" />
- )}
- </span>
- </div>
- <Switch
- checked={queueCount > 0 && queueAttached}
- size="sm"
- aria-hidden="true"
- tabIndex={-1}
- className="pointer-events-none mt-0.5"
- />
- </DropdownMenuCheckboxItem>
- </DropdownMenuContent>
- </DropdownMenu>
- );
-}
diff --git a/packages/app/src/components/acp/ThreadView.dom.test.tsx b/packages/app/src/components/acp/ThreadView.dom.test.tsx
index 867e14c04..7fdafaf69 100644
--- a/packages/app/src/components/acp/ThreadView.dom.test.tsx
+++ b/packages/app/src/components/acp/ThreadView.dom.test.tsx
@@ -85,23 +85,6 @@ vi.doMock('@/components/acp/AgentMarkdown', () => ({
AgentMarkdown: ({ text }: { text: string }) => <div>{text}</div>,
}));
-// The comment-queue surface the composer's `+` drives. Stubbed to a single
-// always-available item so a test can attach a batch and assert how the action
-// slot reacts; the real store needs a loaded project.
-vi.doMock('@/comments/comment-chips', () => ({
- useQueuedComments: () => [{ id: 'c1' }],
- composeCommentBatchInstruction: (_items: unknown, typed: string) =>
- typed === '' ? 'batch instruction' : typed,
-}));
-
-vi.doMock('@/comments/queue-attachment', () => ({
- prepareQueuedComments: async () => [{ id: 'c1' }],
-}));
-
-vi.doMock('@/comments/store', () => ({
- refresh: async () => undefined,
-}));
-
const { ThreadView } = await import('./ThreadView');
// Not mocked — the settings popover writes real remembered picks through it.
const { agentSettingsKey, getRememberedAgentConfig, getRememberedAgentMode } = await import(
@@ -1138,29 +1121,14 @@ describe('ThreadView message queue', () => {
expect(cancel).toHaveBeenCalledWith('thread-1');
});
- test('an attached comment batch counts as sendable, so the slot yields Stop', async () => {
- const user = userEvent.setup();
+ test('the composer carries no add-context control', () => {
model = makeModel({ turnActive: true });
render(<ThreadView info={makeInfo({ status: 'running' })} />);
- // Empty draft mid-turn: Stop owns the slot.
- expect(screen.getByTestId('agent-thread-cancel')).toBeTruthy();
-
- await user.click(screen.getByTestId('composer-add-context'));
- await user.click(screen.getByTestId('composer-add-context-queue'));
-
- // The batch is a message on its own, so the slot must offer to send it even
- // though the draft is still empty. Keying the slot on the draft alone left
- // Stop mounted with a sendable batch attached and no way to dispatch it.
- expect(await screen.findByTestId('agent-thread-send')).toBeTruthy();
- expect(screen.queryByTestId('agent-thread-cancel')).toBeNull();
- expect((screen.getByTestId('agent-thread-send') as HTMLButtonElement).disabled).toBe(false);
-
- // And the slot's Send actually dispatches the batch: `submit` folds the
- // attached items through `composeCommentBatchInstruction` rather than
- // sending the empty draft it can see.
- fireEvent.click(screen.getByTestId('agent-thread-send'));
- expect(prompt).toHaveBeenCalledWith('thread-1', 'batch instruction');
+ // The `+` opened a one-row menu whose only row was inert without a loaded
+ // comment queue, and the queue panel's own Send already dispatches to this
+ // thread. Pinned so it does not drift back in as decoration.
+ expect(screen.queryByTestId('composer-add-context')).toBeNull();
});
test('Escape cancels with an empty draft too, while Stop is also on screen', () => {
diff --git a/packages/app/src/components/acp/ThreadView.tsx b/packages/app/src/components/acp/ThreadView.tsx
index 9dd205d2b..e3c0216fb 100644
--- a/packages/app/src/components/acp/ThreadView.tsx
+++ b/packages/app/src/components/acp/ThreadView.tsx
@@ -41,14 +41,6 @@ import {
useRef,
useState,
} from 'react';
-import {
- type CommentBatchItem,
- composeCommentBatchInstruction,
- useQueuedComments,
-} from '@/comments/comment-chips';
-import { prepareQueuedComments } from '@/comments/queue-attachment';
-import { refresh as refreshComments } from '@/comments/store';
-import { ComposerAddContextMenu } from '@/components/ComposerAddContextMenu';
import { focusComposerInputOnCardPointer } from '@/components/focus-composer-on-card-pointer';
import { useOptionalPageList } from '@/components/PageListContext';
import { Badge } from '@/components/ui/badge';
@@ -150,11 +142,6 @@ export function ThreadView({ info }: { info: ThreadInfo }): ReactNode {
const client = getAgentThreadClient();
const workspace = useWorkspace();
const [draft, setDraft] = useState('');
- // The comment batch riding the next message, captured when the composer's `+`
- // switched Queue on. Held here rather than in the composer because `submit`
- // lives here and is what folds it into the prompt — and cleared on send with
- // the draft, so the batch never silently rides a second message.
- const [attachedComments, setAttachedComments] = useState<CommentBatchItem[] | null>(null);
const [followFile, setFollowFile] = useState(loadFollowFilePref);
// Captured by ScrollToEndBridge (a child of the scroller Provider) so send/
// resume can imperatively jump to the live edge; null until the bridge mounts.
@@ -299,15 +286,9 @@ export function ThreadView({ info }: { info: ThreadInfo }): ReactNode {
const [failedPrompt, setFailedPrompt] = useState<string | null>(null);
const submit = (): void => {
- // The attached batch is composed in at SEND, with the draft as its leading
- // instruction — so the textarea holds only the user's own words while they
- // write, and toggling Queue off leaves nothing behind to clean up.
- const typed = draft.trim();
- const text =
- attachedComments !== null ? composeCommentBatchInstruction(attachedComments, typed) : typed;
- // An attached batch is a message on its own; only a bare draft needs words.
- // `canQueue` rides alongside `canPrompt` (from main): a busy thread accepts a
- // queued message, and a comment batch is as queueable as typed prose.
+ const text = draft.trim();
+ // `canQueue` rides alongside `canPrompt`: a busy thread accepts a queued
+ // message rather than refusing the send.
if (text === '' || !(canPrompt || canQueue)) return;
if (archived) {
// Type-to-resume: the send respawns the agent and reconnects the
@@ -328,14 +309,12 @@ export function ThreadView({ info }: { info: ThreadInfo }): ReactNode {
})
.finally(() => setResumePending(false));
setDraft('');
- setAttachedComments(null);
// Sending re-engages the live edge even if the reader had scrolled up.
scrollApiRef.current?.scrollToEnd();
return;
}
client.prompt(info.threadId, text);
setDraft('');
- setAttachedComments(null);
scrollApiRef.current?.scrollToEnd();
};
@@ -503,8 +482,6 @@ export function ThreadView({ info }: { info: ThreadInfo }): ReactNode {
info={info}
draft={draft}
onDraftChange={setDraft}
- commentsAttached={attachedComments !== null}
- onAttachComments={setAttachedComments}
onSubmit={submit}
canPrompt={canPrompt}
canQueue={canQueue}
@@ -2006,8 +1983,6 @@ function ThreadComposer({
info,
draft,
onDraftChange,
- commentsAttached,
- onAttachComments,
onSubmit,
canPrompt,
canQueue,
@@ -2022,10 +1997,6 @@ function ThreadComposer({
info: ThreadInfo;
draft: string;
onDraftChange: (value: string) => void;
- /** The comment queue is riding the next message — the `+` menu's toggle state. */
- commentsAttached: boolean;
- /** Capture the batch (`CommentBatchItem[]`) or detach it (`null`). */
- onAttachComments: (items: CommentBatchItem[] | null) => void;
onSubmit: () => void;
canPrompt: boolean;
/** A turn is running — sends queue behind it instead of dispatching. */
@@ -2046,14 +2017,6 @@ function ThreadComposer({
// Naming the agent in the placeholder ("Message Claude") beats a generic
// "Message the agent"; strip the "Agent" suffix so it reads as the brand.
const agentName = agentDisplayName(info.agent.name);
- const queuedComments = useQueuedComments();
- // The queue is project-wide state that only gets loaded when something asks
- // for it — an editor mounting a doc, or the Comments panel opening. A thread
- // can be the first surface you open, so pull once on mount or the `+` reports
- // an empty queue that isn't.
- useEffect(() => {
- void refreshComments().catch(() => undefined);
- }, []);
// Grow with content up to a cap. `draft` is the trigger, not read in the
// body (the element's own scrollHeight is), so the analyzer sees it as
@@ -2073,12 +2036,9 @@ function ThreadComposer({
const queue = info.queue ?? [];
- // What the action slot keys off. An attached comment batch is a message on its
- // own — the comments carry their own requests — so an empty draft beside one
- // still has something to send. Both the Stop/Send choice and Send's disabled
- // state read this, or the two disagree and the slot offers Stop while a
- // sendable batch sits attached.
- const hasSendableContent = draft.trim() !== '' || commentsAttached;
+ // What the action slot keys off. Both the Stop/Send choice and Send's disabled
+ // state read this, or the two disagree.
+ const hasSendableContent = draft.trim() !== '';
return (
<div className="p-2">
@@ -2147,35 +2107,7 @@ function ThreadComposer({
it exposes no config options, and justify-between would then float the
lone send button to the left. */}
<div className="flex items-center gap-2 px-1.5 pt-1 pb-1.5">
- {/* Settings + `+` are one cluster of ghost controls, tightened to
- `gap-0.5`: the row's `gap-2` is spacing between GROUPS, and at that
- width the two read as unrelated buttons that happen to be near each
- other. The right cluster keeps its own spacing via `ml-auto`, so
- this doesn't move it. */}
- <div className="flex items-center gap-0.5">
- {/* The same `+` the Ask AI composer carries, so "add context" is one
- gesture wherever you are talking to an agent — and the same
- toggle, so it is also one gesture to take it back off. The batch
- is folded into the prompt at send, not pasted into the draft, so
- the textarea holds only what you typed. Still NOT a dispatch:
- nothing resolves. */}
- <ComposerAddContextMenu
- // This bar is `h-6` / `text-xs` controls (the settings trigger to
- // its right); a composer-sized button would tower over them.
- compact
- queueCount={queuedComments.length}
- queueAttached={commentsAttached}
- onAddQueue={() => {
- void prepareQueuedComments().then((items) => {
- if (items === null) return;
- onAttachComments(items);
- ref.current?.focus();
- });
- }}
- onRemoveQueue={() => onAttachComments(null)}
- />
- <AgentSettingsPopover info={info} />
- </div>
+ <AgentSettingsPopover info={info} />
<div className="ml-auto flex items-center gap-1.5">
{usagePercent !== null && usage?.used !== undefined && usage?.size !== undefined ? (
<ContextUsageRing used={usage.used} size={usage.size} percent={usagePercent} />
diff --git a/packages/app/src/locales/en/messages.json b/packages/app/src/locales/en/messages.json
index 19b61c82f..058dfdc5c 100644
--- a/packages/app/src/locales/en/messages.json
+++ b/packages/app/src/locales/en/messages.json
@@ -433,7 +433,6 @@
"6hfDJr": ["Server error: ", ["status"]],
"6iDEWA": ["Show panel"],
"6ibbCg": ["Create your first file"],
- "6kVJ0m": ["Couldn't read the queued comments."],
"6ki7F2": [["0", "plural", { "one": ["#", " item"], "other": ["#", " items"] }]],
"6lGV3K": ["Show less"],
"6m_7We": ["Open this settings dialog."],
@@ -495,7 +494,6 @@
"7d1a0d": ["Public"],
"7dZnmw": ["Relevance"],
"7hctf2": ["Describe the project you want to create"],
- "7iTyyh": [["queueCount", "plural", { "one": ["#", " comment"], "other": ["#", " comments"] }]],
"7jIIFX": ["You're all set up!"],
"7kb4LU": ["Approved"],
"7l15X4": ["failed"],
@@ -1996,7 +1994,6 @@
],
"XklovM": ["Working…"],
"Xl-UUg": ["guides/install or https://example.com"],
- "Xm5tCT": ["Add context to this message"],
"XmJfZT": ["name"],
"XnlF3W": ["Add the next matching source selection."],
"XopE_I": ["Failed to parse backlinks error response (HTTP ", ["status"], ")"],
@@ -2396,7 +2393,6 @@
"dXCi3J": ["Something broke"],
"dXOolp": ["Syncing your changes"],
"dXWMFn": ["Removes this skill from your editors."],
- "dXooEp": ["Nothing queued"],
"dYCvMf": ["Couldn't resume this conversation: ", ["0"]],
"darW93": [
[
diff --git a/packages/app/src/locales/en/messages.po b/packages/app/src/locales/en/messages.po
index e344eb96c..a15fc285a 100644
--- a/packages/app/src/locales/en/messages.po
+++ b/packages/app/src/locales/en/messages.po
@@ -645,10 +645,6 @@ msgstr "{phase} — {pct}%"
msgid "{propPanelDescriptorLabel} Properties"
msgstr "{propPanelDescriptorLabel} Properties"
-#: src/components/ComposerAddContextMenu.tsx
-msgid "{queueCount, plural, one {# comment} other {# comments}}"
-msgstr "{queueCount, plural, one {# comment} other {# comments}}"
-
#: src/components/ActivityModeContent.tsx
#: src/components/ActivityPanelBurstRow.tsx
#: src/components/ActivityPanelFileRow.tsx
@@ -1081,10 +1077,6 @@ msgstr "Add at least one letter or number."
msgid "Add Comment"
msgstr "Add Comment"
-#: src/components/ComposerAddContextMenu.tsx
-msgid "Add context to this message"
-msgstr "Add context to this message"
-
#: src/lib/keyboard-shortcuts.ts
msgid "Add cursors or select matching occurrences through CodeMirror."
msgstr "Add cursors or select matching occurrences through CodeMirror."
@@ -3098,10 +3090,6 @@ msgstr "Couldn't read the queued comments — nothing was sent."
msgid "Couldn't read the queued comments: {0}"
msgstr "Couldn't read the queued comments: {0}"
-#: src/comments/queue-attachment.ts
-msgid "Couldn't read the queued comments."
-msgstr "Couldn't read the queued comments."
-
#: src/components/EditorActivityPool.tsx
msgid "Couldn't reconnect after server restart"
msgstr "Couldn't reconnect after server restart"
@@ -7170,10 +7158,6 @@ msgstr "nothing ({0} cannot match a doc)"
msgid "nothing ({0} is not a valid pattern)"
msgstr "nothing ({0} is not a valid pattern)"
-#: src/components/ComposerAddContextMenu.tsx
-msgid "Nothing queued"
-msgstr "Nothing queued"
-
#: src/comments/CommentQueuePanel.tsx
msgid "Nothing queued. Comment on a passage to add it here."
msgstr "Nothing queued. Comment on a passage to add it here."
@@ -8252,7 +8236,6 @@ msgstr "Pushing"
#: src/comments/CommentQueuePanel.tsx
#: src/comments/CommentsPanel.tsx
#: src/comments/CommentsTab.tsx
-#: src/components/ComposerAddContextMenu.tsx
msgid "Queue"
msgstr "Queue"
diff --git a/packages/app/src/locales/pseudo/messages.json b/packages/app/src/locales/pseudo/messages.json
index d31fa9e77..a06d199f6 100644
--- a/packages/app/src/locales/pseudo/messages.json
+++ b/packages/app/src/locales/pseudo/messages.json
@@ -433,7 +433,6 @@
"6hfDJr": ["Śēŕvēŕ ēŕŕōŕ: ", ["status"]],
"6iDEWA": ["Śĥōŵ ƥàńēĺ"],
"6ibbCg": ["Ćŕēàţē ŷōũŕ ƒĩŕśţ ƒĩĺē"],
- "6kVJ0m": ["Ćōũĺďń'ţ ŕēàď ţĥē ǫũēũēď ćōḿḿēńţś."],
"6ki7F2": [["0", "plural", { "one": ["#", " ĩţēḿ"], "other": ["#", " ĩţēḿś"] }]],
"6lGV3K": ["Śĥōŵ ĺēśś"],
"6m_7We": ["Ōƥēń ţĥĩś śēţţĩńĝś ďĩàĺōĝ."],
@@ -495,7 +494,6 @@
"7d1a0d": ["Ƥũƀĺĩć"],
"7dZnmw": ["Ŕēĺēvàńćē"],
"7hctf2": ["Ďēśćŕĩƀē ţĥē ƥŕōĴēćţ ŷōũ ŵàńţ ţō ćŕēàţē"],
- "7iTyyh": [["queueCount", "plural", { "one": ["#", " ćōḿḿēńţ"], "other": ["#", " ćōḿḿēńţś"] }]],
"7jIIFX": ["Ŷōũ'ŕē àĺĺ śēţ ũƥ!"],
"7kb4LU": ["Àƥƥŕōvēď"],
"7l15X4": ["ƒàĩĺēď"],
@@ -1996,7 +1994,6 @@
],
"XklovM": ["Ŵōŕķĩńĝ…"],
"Xl-UUg": ["ĝũĩďēś/ĩńśţàĺĺ ōŕ ĥţţƥś://ēxàḿƥĺē.ćōḿ"],
- "Xm5tCT": ["Àďď ćōńţēxţ ţō ţĥĩś ḿēśśàĝē"],
"XmJfZT": ["ńàḿē"],
"XnlF3W": ["Àďď ţĥē ńēxţ ḿàţćĥĩńĝ śōũŕćē śēĺēćţĩōń."],
"XopE_I": ["Ƒàĩĺēď ţō ƥàŕśē ƀàćķĺĩńķś ēŕŕōŕ ŕēśƥōńśē (ĤŢŢƤ ", ["status"], ")"],
@@ -2396,7 +2393,6 @@
"dXCi3J": ["Śōḿēţĥĩńĝ ƀŕōķē"],
"dXOolp": ["Śŷńćĩńĝ ŷōũŕ ćĥàńĝēś"],
"dXWMFn": ["Ŕēḿōvēś ţĥĩś śķĩĺĺ ƒŕōḿ ŷōũŕ ēďĩţōŕś."],
- "dXooEp": ["Ńōţĥĩńĝ ǫũēũēď"],
"dYCvMf": ["Ćōũĺďń'ţ ŕēśũḿē ţĥĩś ćōńvēŕśàţĩōń: ", ["0"]],
"darW93": [
[
diff --git a/packages/app/src/locales/pseudo/messages.po b/packages/app/src/locales/pseudo/messages.po
index 776fade64..f984eb6f8 100644
--- a/packages/app/src/locales/pseudo/messages.po
+++ b/packages/app/src/locales/pseudo/messages.po
@@ -645,10 +645,6 @@ msgstr ""
msgid "{propPanelDescriptorLabel} Properties"
msgstr ""
-#: src/components/ComposerAddContextMenu.tsx
-msgid "{queueCount, plural, one {# comment} other {# comments}}"
-msgstr ""
-
#: src/components/ActivityModeContent.tsx
#: src/components/ActivityPanelBurstRow.tsx
#: src/components/ActivityPanelFileRow.tsx
@@ -1077,10 +1073,6 @@ msgstr ""
msgid "Add Comment"
msgstr ""
-#: src/components/ComposerAddContextMenu.tsx
-msgid "Add context to this message"
-msgstr ""
-
#: src/lib/keyboard-shortcuts.ts
msgid "Add cursors or select matching occurrences through CodeMirror."
msgstr ""
@@ -3094,10 +3086,6 @@ msgstr ""
msgid "Couldn't read the queued comments: {0}"
msgstr ""
-#: src/comments/queue-attachment.ts
-msgid "Couldn't read the queued comments."
-msgstr ""
-
#: src/components/EditorActivityPool.tsx
msgid "Couldn't reconnect after server restart"
msgstr ""
@@ -7166,10 +7154,6 @@ msgstr ""
msgid "nothing ({0} is not a valid pattern)"
msgstr ""
-#: src/components/ComposerAddContextMenu.tsx
-msgid "Nothing queued"
-msgstr ""
-
#: src/comments/CommentQueuePanel.tsx
msgid "Nothing queued. Comment on a passage to add it here."
msgstr ""
@@ -8248,7 +8232,6 @@ msgstr ""
#: src/comments/CommentQueuePanel.tsx
#: src/comments/CommentsPanel.tsx
#: src/comments/CommentsTab.tsx
-#: src/components/ComposerAddContextMenu.tsx
msgid "Queue"
msgstr ""