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
feat(composer): refine controls and expand plus menu (#8377)
Jacob Beckermanb1a6fe7e0c59
diff --git a/apps/web/AGENTS.md b/apps/web/AGENTS.mdindex fdc9f583cf..b2b109fd36 100644--- a/apps/web/AGENTS.md+++ b/apps/web/AGENTS.md@@ -106,6 +106,7 @@ ownership. Cancel, logout, and the ten-minute timeout retire pending callbacks.- Preserve focused chrome editors during deferred split insertion/removal autofocus; explicit return-focus commands may still focus the pane.- Reconcile global focus when focused DOM subtrees are removed; iOS can omit blur events, otherwise floating creation actions stay hidden after search or editor teardown.- Mount the floating mobile AI composer only on the Agents view; other views keep their New action or their own reply/comment composer.+- Keep desktop model and effort controls separate: the model selector opens the catalog and the speedometer opens the runtime's advertised slider stops; retain the mobile effort sheet.- Passive PR mentions must not retry initial GitHub status failures on remount; preserve confirmed status through refetch errors and keep pending data reads out of their parent Suspense boundary.- Keep native booking exit navigation in the route shell, outside page loading boundaries, and use the router so the native hash route stays intact.- Diagnose native full reloads with `native_webview_started` and native launch/termination/update counters; termination coverage is iOS/macOS only, and a pageview alone also includes SPA navigation. See `tauri/src-tauri/README.md`.diff --git a/apps/web/src/components/icon/macro-logo-wireframe.svg b/apps/web/src/components/icon/macro-logo-wireframe.svgnew file mode 100644index 0000000000..7fb462bb64--- /dev/null+++ b/apps/web/src/components/icon/macro-logo-wireframe.svg@@ -0,0 +1,15 @@+<svg width="100%" height="100%" viewBox="-0.5 -3 37.5 37.5" fill="none" stroke="currentColor" stroke-width="0.6" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg">+ <!-- Resting block geometry from macro-brand-loader-2.svg. -->+ <g>+ <path d="m3.7971 11.0984-3.3805 1.3255v10.673l4.6538 4.4021 3.3834-1.33v-10.673z"/>+ <path d="m0.4166 12.4239 4.6538 4.4021 3.3834-1.33m-3.3834 1.33v10.673"/>+ </g>+ <g>+ <path d="m9.8207 3.50169-3.3805 1.3255v10.674l12.696 11.999 3.378-1.3278-0.000058-10.674z"/>+ <path d="m6.4402 4.82719 12.696 11.999 3.3779-1.3279m-3.3779 1.3279v10.673"/>+ </g>+ <g>+ <path d="m23.89 3.5019-3.3805 1.3255v10.674l12.696 11.999 3.378-1.3278-0.0001-10.674z"/>+ <path d="m20.5095 4.8274 12.696 11.999 3.3779-1.3278m-3.3779 1.3278v10.673"/>+ </g>+</svg>diff --git a/apps/web/src/components/ui/components/ComposerSurface.tsx b/apps/web/src/components/ui/components/ComposerSurface.tsxindex a25b225029..fffcd10bf1 100644--- a/apps/web/src/components/ui/components/ComposerSurface.tsx+++ b/apps/web/src/components/ui/components/ComposerSurface.tsx@@ -37,7 +37,7 @@ export function ComposerSurface({...rest}class={cn(!isTouchDevice() &&- 'rounded-[26.25px] border-0 bg-composer text-composer-ink dark-mode:glass-input backdrop-filter-none light-mode:after:hidden light-mode:shadow-[0_0_0_0.9375px_var(--color-drop-shadow),0_1.875px_7.5px_0_var(--color-drop-shadow),0_3.75px_75px_7.5px_color-mix(in_srgb,var(--color-drop-shadow)_60%,transparent)]',+ 'rounded-[28px] border-0 bg-composer text-composer-ink dark-mode:glass-input backdrop-filter-none light-mode:after:hidden light-mode:shadow-[0_0_0_1px_var(--color-drop-shadow),0_2px_8px_0_var(--color-drop-shadow),0_4px_80px_8px_color-mix(in_srgb,var(--color-drop-shadow)_60%,transparent)]',local.class)}/>diff --git a/apps/web/src/features/agents-view/agents-view.css b/apps/web/src/features/agents-view/agents-view.cssindex 13e678d6ff..df8d421ca7 100644--- a/apps/web/src/features/agents-view/agents-view.css+++ b/apps/web/src/features/agents-view/agents-view.css@@ -331,36 +331,66 @@margin-bottom: 12px;}- :where(.agents-view, .agents-view-portal) .greeting h2 {- margin: 0;- font-size: 28px;- font-weight: 500;- letter-spacing: -0.03em;- line-height: 1.2;- text-wrap: balance;+ :where(.agents-view, .agents-view-portal) .greeting-text {+ display: inline-block;+ transform-origin: center 60%;+ backface-visibility: hidden;+ animation: greeting-flip 250ms cubic-bezier(0.22, 1, 0.36, 1);+ }++ @keyframes greeting-flip {+ from {+ transform: perspective(600px) rotateX(-70deg);+ }+ to {+ transform: perspective(600px) rotateX(0);+ }+ }++ :where(.agents-view, .agents-view-portal) .greeting-mark[data-active="true"] > :is(path, g) {+ transform-box: fill-box;+ transform-origin: center;+ animation: greeting-mark-wave 380ms cubic-bezier(0.22, 1, 0.36, 1) both;+ }++ :where(.agents-view, .agents-view-portal) .greeting-mark[data-active="true"] > :is(path, g):nth-child(2) {+ animation-delay: 45ms;+ }++ :where(.agents-view, .agents-view-portal) .greeting-mark[data-active="true"] > :is(path, g):nth-child(3) {+ animation-delay: 90ms;+ }++ @keyframes greeting-mark-wave {+ 0%, 100% {+ transform: translateY(0) rotate(0);+ }+ 35% {+ transform: translateY(-2.5px) rotate(-4deg);+ }+ 65% {+ transform: translateY(0.6px) rotate(1deg);+ }}:where(.agents-view, .agents-view-portal) .composer-drawer {position: relative;display: grid;grid-template-rows: 0fr;- border-radius: 0 0 20px 20px;- background: color-mix(in oklch, var(--surface-1) 40%, var(--surface-2));+ margin-inline: 12px;+ border-radius: 0 0 26px 26px;+ background: color-mix(in srgb, var(--panel) 95%, var(--ink));+ &:where([data-theme-light="false"] *) {+ background: rgb(20 20 20);+ }+ &:where([data-theme-light="true"] *) {+ background: rgb(250 250 250);+ }opacity: 0;visibility: hidden;transition: grid-template-rows 100ms cubic-bezier(0.77, 0, 0.175, 1), opacity 100ms cubic-bezier(0.23, 1, 0.32, 1), visibility 100ms;}- :where(.agents-view, .agents-view-portal) .composer-drawer::before {- content: '';- position: absolute;- inset: 0;- border: 1px solid var(--edge-muted);- border-top: 0;- border-radius: inherit;- pointer-events: none;- }-/* Continue the repository bar behind the input's adjacent rounded corners. */:where(.agents-view, .agents-view-portal) .composer-drawer::after {content: '';@@ -368,9 +398,8 @@bottom: 100%;left: 0;right: 0;- height: 32px;+ height: 28px;background: inherit;- border-inline: 1px solid var(--edge-muted);pointer-events: none;}@@ -388,13 +417,14 @@:where(.agents-view, .agents-view-portal) .composer-drawer-content {display: flex;align-items: center;- min-height: 44px;- padding: 4px 10px;+ min-height: 52px;+ padding: 8px;transform: translateY(-12px);transition: transform 100ms cubic-bezier(0.77, 0, 0.175, 1);}:where(.agents-view, .agents-view-portal) .composer-drawer[data-placement="top"] {+ margin-inline: 0;border-radius: 0;background: transparent;}diff --git a/apps/web/src/features/agents-view/components/ChatComposer.test.tsx b/apps/web/src/features/agents-view/components/ChatComposer.test.tsxindex 41e80b9432..ea4927f8bf 100644--- a/apps/web/src/features/agents-view/components/ChatComposer.test.tsx+++ b/apps/web/src/features/agents-view/components/ChatComposer.test.tsx@@ -167,6 +167,35 @@ function type(text: string) {}describe('Chat session input', () => {+ it.each([false, true])(+ 'shows the complete static hint immediately and keeps it unchanged (session=%s)',+ (session) => {+ vi.useFakeTimers();+ const view = render(() =>+ session ? (+ <ChatSessionInput onSend={vi.fn()} />+ ) : (+ <ChatComposer+ draft=""+ onDraftChange={vi.fn()}+ onSend={vi.fn()}+ selector={null}+ />+ )+ );+ try {+ const hint =+ 'Type @ to mention docs, people, or channels, / for skills';+ expect(screen.getByTestId('editor').textContent).toBe(hint);+ vi.advanceTimersByTime(30000);+ expect(screen.getByTestId('editor').textContent).toBe(hint);+ } finally {+ view.unmount();+ vi.useRealTimers();+ }+ }+ );+it('preloads the fold only when focused without sending or changing the draft', () => {const send = vi.fn();const change = vi.fn();diff --git a/apps/web/src/features/agents-view/components/ChatComposer.tsx b/apps/web/src/features/agents-view/components/ChatComposer.tsxindex 8f1ffede7c..c20d219b44 100644--- a/apps/web/src/features/agents-view/components/ChatComposer.tsx+++ b/apps/web/src/features/agents-view/components/ChatComposer.tsx@@ -13,6 +13,11 @@ import { useMacroMentionLinkResolver } from '@components/app/split-layout/split-import { preloadAgentFold } from '@core/agent-fold/client';import { buildConfig } from '@core/component/LexicalMarkdown/builder/MarkdownConfigBuilder';import { MarkdownShell } from '@core/component/LexicalMarkdown/builder/MarkdownShell';+import {+ TYPE_AGENT_COMMAND_SYMBOL_COMMAND,+ TYPE_AT_SYMBOL_COMMAND,+ TYPE_SKILL_SYMBOL_COMMAND,+} from '@core/component/LexicalMarkdown/plugins';import { createComposerLayout } from '@core/component/LexicalMarkdown/utils/create-composer-layout';import { toast } from '@core/component/Toast/Toast';import { hapticImpact } from '@core/mobile/haptics';@@ -21,10 +26,15 @@ import { useTouchOutsideToDismissKeyboard } from '@core/mobile/useTouchOutsideToimport { fireAndForget } from '@core/util/fireAndForget';import { handleFileFolderDrop } from '@core/util/upload';import { $insertReferencedPaste } from '@macro-inc/lexical-core';-import PlusIcon from '@phosphor/plus.svg';import { makeEventListener } from '@solid-primitives/event-listener';import { createResizeObserver } from '@solid-primitives/resize-observer';import { Button, ComposerSurface, SendButton } from '@ui';+import {+ $getRoot,+ $getSelection,+ $isRangeSelection,+ $isTextNode,+} from 'lexical';import {createEffect,createSignal,@@ -34,7 +44,7 @@ import {Show,} from 'solid-js';import { IMAGE_INPUT_WARNING } from '../../block-agent/state/image-input';-import { createChatComposerTip } from '../primitives/chat-composer-tip';+import { AgentComposerAddMenu } from '../views/ComposerAddMenu';/** Shared input that starts on one line and grows with the draft. */export function ChatComposer(props: {@@ -57,11 +67,6 @@ export function ChatComposer(props: {drawerOpen?: boolean;placeholder?: string;}) {- const tip = createChatComposerTip(- () =>- props.draft.trim().length === 0 && !isTouchDevice() && !props.placeholder,- !props.session- );const attachments = () => props.attachments ?? [];const hasContent = () => !!props.draft.trim() || attachments().length > 0;const hasPendingAttachments = () =>@@ -234,13 +239,44 @@ export function ChatComposer(props: {if (event.type === 'pointerdown') editor.controls.focus();};+ const openTypeahead = (kind: 'library' | 'skills') => {+ editor.lexical.focus(() => {+ editor.lexical.update(+ () => {+ if (!$isRangeSelection($getSelection())) $getRoot().selectEnd();+ const selection = $getSelection();+ if (!$isRangeSelection(selection)) return;+ const node = selection.anchor.getNode();+ const preceding = $isTextNode(node)+ ? node+ .getTextContent()+ .slice(selection.anchor.offset - 1, selection.anchor.offset)+ : '';+ if (preceding && !/\s/.test(preceding)) selection.insertText(' ');+ },+ {+ discrete: true,+ onUpdate: () =>+ editor.lexical.dispatchCommand(+ kind === 'library'+ ? TYPE_AT_SYMBOL_COMMAND+ : props.session+ ? TYPE_AGENT_COMMAND_SYMBOL_COMMAND+ : TYPE_SKILL_SYMBOL_COMMAND,+ undefined+ ),+ }+ );+ });+ };+const editorRow = () => (<divclassList={{'max-h-6 overflow-hidden': !!collapsed(),'max-h-[min(15rem,30dvh)]': !collapsed(),}}- class="min-w-0 flex-1 self-center overflow-y-auto px-[9.375px] group-data-[composer-compact=true]/composer:px-0 group-data-[composer-coding=true]/composer:min-h-[58px] touch:group-data-[composer-compact=false]/composer:min-h-18 group-data-[composer-compact=false]/composer:flex-none group-data-[composer-compact=false]/composer:basis-full"+ class="min-w-0 flex-1 self-center overflow-y-auto px-[9.375px] not-touch:group-data-[composer-compact=false]/composer:px-1.5 group-data-[composer-compact=true]/composer:px-0 group-data-[composer-coding=true]/composer:min-h-[58px] touch:group-data-[composer-compact=false]/composer:min-h-18 group-data-[composer-compact=false]/composer:flex-none group-data-[composer-compact=false]/composer:basis-full"><MarkdownShellclass="h-auto min-h-6 text-base leading-6 [&_[data-markdown-editable]]:min-h-6 [&_[data-markdown-editable]]:outline-none [&_[data-markdown-editable]>.md-p]:my-0 [&_[data-markdown-placeholder]]:max-w-full [&_[data-markdown-placeholder]>p]:m-0 [&_[data-markdown-placeholder]>p]:truncate"@@ -248,9 +284,10 @@ export function ChatComposer(props: {initialValue={props.draft}placeholder={isTouchDevice()- ? // Phones are too narrow for the longer prompts and rotating tips.+ ? // Phones are too narrow for the full mention and skills hint.'Message Macro AI'- : (props.placeholder ?? tip())+ : (props.placeholder ??+ 'Type @ to mention docs, people, or channels, / for skills')}ariaLabel="Message the agent"autofocus={@@ -330,7 +367,7 @@ export function ChatComposer(props: {data-composer-expanded={(isTouchDevice() && !collapsed()) || undefined}- class="relative z-10 min-w-0 rounded-[32px] transition-[height] duration-200 ease-[cubic-bezier(0.77,0,0.175,1)] motion-reduce:transition-none"+ class="relative z-10 min-w-0 rounded-[28px] touch:rounded-[32px] transition-[height] duration-200 ease-[cubic-bezier(0.77,0,0.175,1)] motion-reduce:transition-none"style={{height: height() === undefined ? undefined : `${height()}px`,}}@@ -343,7 +380,7 @@ export function ChatComposer(props: {><Show when={canAttach()}><Input.DropOverlay- class="rounded-[32px]"+ class="rounded-[28px] touch:rounded-[32px]"hint="Drop files here to send them to the agent"/></Show>@@ -355,14 +392,14 @@ export function ChatComposer(props: {><Input.Attachments kind="media" class="pb-0" /><Input.Attachments kind="document" class="pb-0" />- {/* Expanded text keeps the compact row's vertical inset:- 7.5px padding + half the button/line-height difference. */}+ {/* Desktop expanded text uses an 18px horizontal inset and 16px+ top padding; touch keeps the compact row's vertical inset. */}<divref={setLayout}data-composer-compact={!drawerOpen() && isCompact()}data-composer-coding={drawerOpen() || undefined}data-composer-collapsed={collapsed() || undefined}- class="group/composer flex min-w-0 data-[composer-compact=false]:flex-wrap items-end gap-2 p-[7.5px] pl-3 data-[composer-compact=false]:pb-2.5 data-[composer-compact=false]:px-3 data-[composer-compact=false]:pt-[calc(7.5px_+_(33.75px_-_1.5rem)/2)] data-[composer-collapsed=true]:h-(--mobile-chrome-button-size) data-[composer-collapsed=true]:items-center data-[composer-collapsed=true]:py-0 data-[composer-collapsed=true]:pl-3.5 data-[composer-collapsed=true]:pr-[9.5px]"+ class="group/composer flex min-w-0 data-[composer-compact=false]:flex-wrap items-end gap-2 p-[7.5px] pl-3 data-[composer-compact=false]:pb-2.5 data-[composer-compact=false]:px-3 data-[composer-compact=false]:pt-[calc(7.5px_+_(33.75px_-_1.5rem)/2)] not-touch:data-[composer-compact=false]:pt-4 data-[composer-collapsed=true]:h-(--mobile-chrome-button-size) data-[composer-collapsed=true]:items-center data-[composer-collapsed=true]:py-0 data-[composer-collapsed=true]:pl-3.5 data-[composer-collapsed=true]:pr-[9.5px]"><Show when={props.onAttachFiles}><div@@ -373,9 +410,17 @@ export function ChatComposer(props: {<Input.AttachFilesActionaccept={null}disabled={disabled()}- >- <PlusIcon />- </Input.AttachFilesAction>+ trigger={(openFiles) => (+ <AgentComposerAddMenu+ openFiles={openFiles}+ openLibrary={() => openTypeahead('library')}+ openSkills={() => openTypeahead('skills')}+ getEditor={() => editor.lexical.getRootElement()}+ session={!!props.session}+ disabled={disabled()}+ />+ )}+ /></div></Show>{editorRow()}diff --git a/apps/web/src/features/agents-view/components/ModelSelector.tsx b/apps/web/src/features/agents-view/components/ModelSelector.tsxindex 07918777a8..1c2bebd75a 100644--- a/apps/web/src/features/agents-view/components/ModelSelector.tsx+++ b/apps/web/src/features/agents-view/components/ModelSelector.tsx@@ -8,6 +8,7 @@ import {} from '@core/component/AI/component/input/ModelCatalogPicker';import { modelLabel } from '@core/component/AI/constant/model-label';import { isTouchDevice } from '@core/mobile/isTouchDevice';+import { composerMenuAnchorRect } from '@core/util/composerMenuAnchor';import type { Component, JSX } from 'solid-js';import { Show } from 'solid-js';@@ -44,8 +45,11 @@ export function ModelSelector(props: {triggerLabel={props.label}placeholder={modelLabel(props.model)}triggerClass="h-[33.75px] min-w-0 max-w-full gap-[5.625px] rounded-full border-0 bg-transparent hover:bg-hover px-[7.5px] text-base font-normal text-ink-muted light-mode:text-composer-placeholder [&_svg]:size-[15px]"+ contentClass="w-[min(42rem,calc(100vw-2rem))] rounded-2xl border-0"ariaLabel="Model"- placement="top-end"+ placement="bottom-start"+ getAnchorRect={composerMenuAnchorRect}+ gutter={8}disabled={props.disabled}pending={props.pending}onSelect={props.onSelect}@@ -67,15 +71,10 @@ export function SessionModelSelector(props: AgentModelSelectorProps) {<ModelSelectoronCloseAutoFocus={props.onCloseAutoFocus}model={shown()}- label={[- modelLabel(- shown(),- props.options.find((option) => option.id === shown())?.name- ),- props.effortLabel,- ]- .filter(Boolean)- .join(' · ')}+ label={modelLabel(+ shown(),+ props.options.find((option) => option.id === shown())?.name+ )}modelRow={props.modelRow}options={props.options.map((option) => ({id: option.id,diff --git a/apps/web/src/features/agents-view/primitives/chat-composer-tip.test.ts b/apps/web/src/features/agents-view/primitives/chat-composer-tip.test.tsdeleted file mode 100644index f6c674b9dc..0000000000--- a/apps/web/src/features/agents-view/primitives/chat-composer-tip.test.ts+++ /dev/null@@ -1,95 +0,0 @@-import { cleanup, renderHook } from '@solidjs/testing-library';-import { type Accessor, createSignal } from 'solid-js';-import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest';-import { createChatComposerTip } from './chat-composer-tip';--beforeEach(() => {- vi.useFakeTimers();-});-afterEach(() => {- cleanup();- vi.useRealTimers();-});--/** Follow timer-driven text until a complete hint is visible. */-function readHint(tip: Accessor<string>, expected: string) {- for (let step = 0; step < 300 && tip() !== expected; step++)- vi.advanceTimersToNextTimer();- expect(tip()).toBe(expected);-}--const CONNECT = 'Connect your apps in Agents → Connections';--describe('Chat composer tips', () => {- it('types progressively, pauses, quickly erases and types the next hint', () => {- const { result: tip } = renderHook(() => createChatComposerTip(() => true));- expect(tip()).toBe('');- vi.advanceTimersToNextTimer();- expect(tip()).toBe('C');- const typedAt = Date.now();- vi.advanceTimersToNextTimer();- expect(tip()).toBe('Co');- const typingTime = Date.now() - typedAt;- readHint(tip, CONNECT);- vi.advanceTimersByTime(2000);- expect(tip()).toBe(CONNECT);- vi.advanceTimersToNextTimer();- expect(CONNECT.startsWith(tip())).toBe(true);- expect(tip().length).toBeLessThan(CONNECT.length);- const deletingAt = Date.now();- vi.advanceTimersToNextTimer();- expect(Date.now() - deletingAt).toBeLessThan(typingTime);- readHint(tip, '');- vi.advanceTimersToNextTimer();- expect(tip()).toBe('T');- readHint(tip, 'Type / to add a skill');- });-- it('cycles through connectors, skills, mentions and agents, then repeats', () => {- const { result: tip } = renderHook(() => createChatComposerTip(() => true));- for (const hint of [- CONNECT,- 'Type / to add a skill',- 'Type @ to mention docs, people, or channels',- 'Choose an agent to change who helps',- CONNECT,- ])- readHint(tip, hint);- });-- it('omits the agent-selection tip inside a session', () => {- const { result: tip } = renderHook(() =>- createChatComposerTip(() => true, false)- );- for (const hint of [- CONNECT,- 'Use @ to reference a skill document',- 'Type @ to mention docs, people, or channels',- CONNECT,- ])- readHint(tip, hint);- });-- it('stops while writing and resumes the same hint when the draft is cleared', () => {- const [empty, setEmpty] = createSignal(true);- const { result: tip } = renderHook(() => createChatComposerTip(empty));- vi.advanceTimersToNextTimer();- expect(tip()).toBe('C');- setEmpty(false);- expect(vi.getTimerCount()).toBe(0);- vi.advanceTimersByTime(18000);- expect(tip()).toBe('C');- setEmpty(true);- vi.advanceTimersToNextTimer();- expect(tip()).toBe('Co');- });-- it('stops its timer when the composer is removed', () => {- const { cleanup: dispose } = renderHook(() =>- createChatComposerTip(() => true)- );- expect(vi.getTimerCount()).toBe(1);- dispose();- expect(vi.getTimerCount()).toBe(0);- });-});diff --git a/apps/web/src/features/agents-view/primitives/chat-composer-tip.ts b/apps/web/src/features/agents-view/primitives/chat-composer-tip.tsdeleted file mode 100644index 1b74124367..0000000000--- a/apps/web/src/features/agents-view/primitives/chat-composer-tip.ts+++ /dev/null@@ -1,63 +0,0 @@-import {- type Accessor,- createEffect,- createSignal,- on,- onCleanup,-} from 'solid-js';--const TIPS = [- 'Connect your apps in Agents → Connections',- 'Type / to add a skill',- 'Type @ to mention docs, people, or channels',- 'Choose an agent to change who helps',-];--/** Type each hint, pause to read it, then erase quickly before the next hint. */-export function createChatComposerTip(- empty: Accessor<boolean>,- canChooseAgent = true-) {- const tips = canChooseAgent- ? TIPS- : [TIPS[0], 'Use @ to reference a skill document', TIPS[2]];- const [text, setText] = createSignal('');- let index = 0;- let length = 0;- let deleting = false;- let delay = 300;-- // A timer is external state: start and stop it with the visible empty input.- createEffect(- on(empty, (isEmpty) => {- if (!isEmpty) return;- let timer: ReturnType<typeof setTimeout>;- const schedule = (nextDelay: number) => {- delay = nextDelay;- timer = setTimeout(advance, delay);- };- const advance = () => {- const tip = tips[index];- if (deleting) {- length = Math.max(0, length - 2);- setText(tip.slice(0, length));- if (length === 0) {- index = (index + 1) % tips.length;- deleting = false;- schedule(300);- } else schedule(12);- } else {- length += 1;- setText(tip.slice(0, length));- if (length === tip.length) {- deleting = true;- schedule(2200);- } else schedule(32);- }- };- schedule(delay);- onCleanup(() => clearTimeout(timer));- })- );- return text;-}diff --git a/apps/web/src/features/agents-view/views/AgentPicker.tsx b/apps/web/src/features/agents-view/views/AgentPicker.tsxindex 84d9af7cd5..2882a5cc42 100644--- a/apps/web/src/features/agents-view/views/AgentPicker.tsx+++ b/apps/web/src/features/agents-view/views/AgentPicker.tsx@@ -2,6 +2,7 @@ import { ModelCatalogMenu } from '@core/component/AI/component/input/ModelCataloimport { ModelIcon } from '@core/component/AI/component/ProviderIcon';import { modelLabel } from '@core/component/AI/constant/model-label';import { isTouchDevice } from '@core/mobile/isTouchDevice';+import { composerMenuAnchorRect } from '@core/util/composerMenuAnchor';import CaretDownIcon from '@phosphor/caret-down.svg';import CaretRightIcon from '@phosphor/caret-right.svg';import PlusIcon from '@phosphor/plus.svg';@@ -69,8 +70,7 @@ function DesktopAgentPicker(props: AgentPickerProps) {model(),catalog.models().find((option) => option.id === model())?.name);- const label = () =>- [baseLabel(), props.effortLabel].filter(Boolean).join(' · ');+ const label = baseLabel;const choose = (agent: RosterAgent, model?: string) => {props.onSelect(agent, model);setOpen(false);@@ -84,7 +84,13 @@ function DesktopAgentPicker(props: AgentPickerProps) {setOpen(false);};return (- <Dropdown open={open()} onOpenChange={setOpen} placement="top-end">+ <Dropdown+ open={open()}+ onOpenChange={setOpen}+ placement={macro() ? 'bottom-start' : 'top-end'}+ gutter={macro() ? 8 : 4}+ getAnchorRect={macro() ? composerMenuAnchorRect : undefined}+ ><Dropdown.Triggervariant="ghost"aria-label="Agent"@@ -121,62 +127,99 @@ function DesktopAgentPicker(props: AgentPickerProps) {<Show when={rawModel()}><ModelIcon model={model()} class="size-[15px] shrink-0" /></Show>- <span class="min-w-0 truncate text-left leading-5">{label()}</span>- <CaretDownIcon class="size-[15px] shrink-0" />+ <span class="min-w-0 truncate text-left leading-5">{baseLabel()}</span>+ <CaretDownIcon class="size-4 shrink-0 text-ink-muted" /></Dropdown.Trigger><Dropdown.Content- class="w-88 max-w-[calc(100vw-1rem)] overflow-hidden"+ class={cn(+ macro()+ ? 'w-[min(42rem,calc(100vw-2rem))]'+ : 'w-70 max-w-[calc(100vw-1rem)]',+ 'overflow-hidden rounded-2xl border-0'+ )}+ onCloseAutoFocus={props.onCloseAutoFocus}onPointerDown={(event: PointerEvent) => event.stopPropagation()}onMouseDown={(event: MouseEvent) => event.stopPropagation()}>- <div class="flex min-h-0 max-h-[min(28rem,var(--kb-popper-content-available-height))] flex-col">+ <div class="grid max-h-[min(24rem,var(--kb-popper-content-available-height))] min-h-0 grid-cols-1 sm:grid-cols-[minmax(0,0.9fr)_minmax(0,1.1fr)]">+ <Show when={macro()}>+ <div+ role="group"+ aria-label="Models"+ class="order-2 min-h-0 max-h-[min(24rem,var(--kb-popper-content-available-height))] min-w-0 overflow-y-auto overscroll-contain px-2 pb-2 sm:border-l sm:border-edge-divider"+ >+ <div class="px-3 pt-3 pb-1 text-xs font-medium text-ink-extra-muted">+ Models+ </div>+ <Show when={macro()}>+ {(agent) => (+ <ModelCatalogMenu+ fullCatalog+ suggestedFirst+ searchable={false}+ value={+ props.selected?.id === agent().id+ ? (model() ?? null)+ : null+ }+ disabled={Boolean(agent().unavailableReason)}+ options={macroCatalog.models().map((option) => ({+ id: option.id,+ label: modelLabel(option.id, option.name),+ description: option.description ?? undefined,+ group: option.group ?? undefined,+ }))}+ onSelect={(id) => choose(agent(), id)}+ modelRow={+ props.onSelectEffort+ ? (row) => (+ <AgentModelMenuItem+ {...row}+ harness={agent().harness}+ effortValue={+ row.selected+ ? props.effortSelection?.value+ : undefined+ }+ onSelectEffort={(effort) =>+ chooseEffort(agent(), row.option.id, effort)+ }+ />+ )+ : undefined+ }+ emptyMessage={macroCatalog.message()}+ />+ )}+ </Show>+ </div>+ </Show><div- class="min-h-0 space-y-1 overflow-y-auto overscroll-contain px-2 pb-2"- classList={{ 'pt-2': !macro() }}+ role="group"+ aria-label="Agents"+ class="order-1 min-h-0 max-h-[min(24rem,var(--kb-popper-content-available-height))] min-w-0 space-y-1 overflow-y-auto overscroll-contain px-2 pb-2 pt-3"+ classList={{ 'sm:col-span-2': !macro() }}><Show when={macro()}>- {(agent) => (- <ModelCatalogMenu- autoFocusSearch- value={- props.selected?.id === agent().id ? (model() ?? null) : null- }- disabled={Boolean(agent().unavailableReason)}- options={macroCatalog.models().map((option) => ({- id: option.id,- label: modelLabel(option.id, option.name),- description: option.description ?? undefined,- group: option.group ?? undefined,- }))}- onSelect={(id) => choose(agent(), id)}- modelRow={- props.onSelectEffort- ? (row) => (- <AgentModelMenuItem- {...row}- harness={agent().harness}- effortValue={- row.selected- ? props.effortSelection?.value- : undefined- }- onSelectEffort={(effort) =>- chooseEffort(agent(), row.option.id, effort)- }- />- )- : undefined- }- emptyMessage={macroCatalog.message()}- />- )}+ <div class="px-3 pb-1 text-xs font-medium text-ink-extra-muted">+ Agents+ </div></Show><For each={groups()}>{(group) => (- <Dropdown.Group class="bg-transparent py-0">- <Dropdown.GroupLabel class="h-6 font-medium text-ink-muted">- {group.label}- </Dropdown.GroupLabel>+ <Dropdown.Group+ class="bg-transparent py-0"+ aria-label={+ macro() && group.label === 'Your agents'+ ? group.label+ : undefined+ }+ >+ <Show when={!macro() || group.label !== 'Your agents'}>+ <Dropdown.GroupLabel class="h-6 font-medium text-ink-muted">+ {group.label}+ </Dropdown.GroupLabel>+ </Show><For each={group.agents}>{(agent) => (<AgentPickerRowdiff --git a/apps/web/src/features/agents-view/views/AgentsView.tsx b/apps/web/src/features/agents-view/views/AgentsView.tsxindex 6074ba5f27..175726c01c 100644--- a/apps/web/src/features/agents-view/views/AgentsView.tsx+++ b/apps/web/src/features/agents-view/views/AgentsView.tsx@@ -38,6 +38,7 @@ import {import { routineContent } from '../../routines/routine-navigation';import { RoutinesPage } from '../../routines/routines-page';import '../agents-view.css';+import { ComposerGreeting } from '@core/component/ComposerGreeting';import { fireAndForget } from '@core/util/fireAndForget';import { AgentSessionPane } from '../components/AgentSessionPane';import { AgentsSidebar } from '../components/AgentsSidebar';@@ -435,9 +436,9 @@ function AgentsWorkspace(props: { initialRoute?: AgentsRoute }) {<ChatEmptyStateContext.Providervalue={() => (<div class="px-4 py-16 text-center">- <h2 class="text-[28px] font-medium tracking-[-0.03em] text-ink">+ <ComposerGreeting>What should we work on?- </h2>+ </ComposerGreeting></div>)}>diff --git a/apps/web/src/features/agents-view/views/ComposerAddMenu.test.tsx b/apps/web/src/features/agents-view/views/ComposerAddMenu.test.tsxnew file mode 100644index 0000000000..a68223f678--- /dev/null+++ b/apps/web/src/features/agents-view/views/ComposerAddMenu.test.tsx@@ -0,0 +1,210 @@+/** @vitest-environment jsdom */+import {+ cleanup,+ fireEvent,+ render,+ screen,+ waitFor,+} from '@solidjs/testing-library';+import { createSignal } from 'solid-js';+import { afterEach, beforeEach, expect, it, vi } from 'vitest';+import type { Leftover } from '../../settings/connections/model';+import { AgentComposerAddMenu } from './ComposerAddMenu';++const [savedConnection, setSavedConnection] = createSignal<Leftover>({+ kind: 'pipedream',+ id: 'pd-slack',+ title: 'Slack workspace',+ subtitle: 'Slack',+ appSlug: 'slack_v2',+ enabled: false,+});++const state = vi.hoisted(() => ({+ mobile: false,+ ready: true,+ failed: false,+ retry: vi.fn(),+}));+vi.mock('@core/mobile/isMobile', () => ({ isMobile: () => state.mobile }));+vi.mock('@core/constant/SettingsState', () => ({+ useSettingsState: () => ({ openSettings: vi.fn() }),+}));+vi.mock('../../settings/connections/use-connections-model', () => ({+ useConnectionsModel: () => ({+ ready: () => state.ready,+ partialError: () => state.failed,+ retry: state.retry,+ model: () => ({+ capabilities: [+ {+ id: 'github-ai',+ provider: 'github',+ title: 'GitHub',+ status: 'connected',+ account: 'My account',+ },+ ],+ leftovers: [savedConnection()],+ }),+ }),+}));+vi.mock('../../settings/connections/ConnectionsPage', () => ({+ ConnectionsPage: (props: {+ initialMode?: string;+ initialProvider?: string;+ }) => (+ <p>+ {props.initialProvider+ ? `Settings for ${props.initialProvider}`+ : `${props.initialMode} connections`}+ </p>+ ),+}));+vi.mock('../../settings/connections/leftover-row', () => ({+ LeftoverRow: (props: { leftover: Leftover }) => (+ <p>+ Saved Slack connection settings:{' '}+ {props.leftover.enabled ? 'enabled' : 'disabled'}+ </p>+ ),+}));++const originalScrollTo = Object.getOwnPropertyDescriptor(+ HTMLElement.prototype,+ 'scrollTo'+);+beforeEach(() => {+ setSavedConnection({+ kind: 'pipedream',+ id: 'pd-slack',+ title: 'Slack workspace',+ subtitle: 'Slack',+ appSlug: 'slack_v2',+ enabled: false,+ });+ state.mobile = false;+ state.ready = true;+ state.failed = false;+ vi.clearAllMocks();+ vi.stubGlobal(+ 'ResizeObserver',+ class {+ observe() {}+ unobserve() {}+ disconnect() {}+ }+ );+ vi.stubGlobal('scrollTo', vi.fn());+ Object.defineProperty(HTMLElement.prototype, 'scrollTo', {+ configurable: true,+ value: vi.fn(),+ });+});+afterEach(() => {+ cleanup();+ if (originalScrollTo)+ Object.defineProperty(HTMLElement.prototype, 'scrollTo', originalScrollTo);+ else delete (HTMLElement.prototype as Partial<HTMLElement>).scrollTo;+ vi.unstubAllGlobals();+});+function setup() {+ const actions = {+ openFiles: vi.fn(),+ openLibrary: vi.fn(),+ openSkills: vi.fn(),+ };+ render(() => (+ <>+ <style>+ {'[role="menu"] {animation-name:none;transition-duration:0s}'}+ </style>+ <AgentComposerAddMenu {...actions} getEditor={() => null} />+ </>+ ));+ const trigger = screen.getByRole('button', { name: /^Add$/ });+ if (state.mobile) fireEvent.click(trigger);+ else fireEvent.keyDown(trigger, { key: 'Enter' });+ return actions;+}++it('keeps uploads available through the richer menu', () => {+ const actions = setup();+ fireEvent.keyDown(+ screen.getByRole('menuitem', { name: /Add photos & files/ }),+ { key: 'Enter' }+ );+ expect(actions.openFiles).toHaveBeenCalledOnce();+});+it.each([+ ['Add from library', 'openLibrary'],+ ['Use a skill', 'openSkills'],+] as const)('returns focus before running %s', async (label, action) => {+ const actions = setup();+ fireEvent.keyDown(screen.getByRole('menuitem', { name: new RegExp(label) }), {+ key: 'Enter',+ });+ await waitFor(() => expect(actions[action]).toHaveBeenCalledOnce());+ expect(screen.queryByRole('menu')).toBeNull();+});+it('opens the selected provider settings without inserting a prompt', async () => {+ const actions = setup();+ fireEvent.keyDown(screen.getByRole('menuitem', { name: /GitHub/ }), {+ key: 'Enter',+ });+ expect(await screen.findByText('Settings for github')).toBeTruthy();+ expect(actions.openLibrary).not.toHaveBeenCalled();+ expect(actions.openSkills).not.toHaveBeenCalled();+});+it('opens a disabled connection for management', async () => {+ setup();+ fireEvent.keyDown(screen.getByRole('menuitem', { name: /Slack workspace/ }), {+ key: 'Enter',+ });+ expect(+ await screen.findByText('Saved Slack connection settings: disabled')+ ).toBeTruthy();+});+it('opens discovery for Add connections', async () => {+ setup();+ fireEvent.keyDown(screen.getByRole('menuitem', { name: /Add connections/ }), {+ key: 'Enter',+ });+ expect(await screen.findByText('discover connections')).toBeTruthy();+});+it('offers retry without hiding the main actions when a source fails', () => {+ state.failed = true;+ setup();+ fireEvent.keyDown(+ screen.getByRole('menuitem', { name: /Retry connections/ }),+ { key: 'Enter' }+ );+ expect(state.retry).toHaveBeenCalledOnce();+});+it('offers the same actions in the mobile sheet', async () => {+ state.mobile = true;+ const actions = setup();+ fireEvent.click(+ await screen.findByRole('button', { name: /Add from library/ })+ );+ expect(actions.openLibrary).toHaveBeenCalledOnce();+});++it('refreshes an open connection when the query returns its updated state', async () => {+ setup();+ fireEvent.keyDown(screen.getByRole('menuitem', { name: /Slack workspace/ }), {+ key: 'Enter',+ });+ await screen.findByText('Saved Slack connection settings: disabled');+ setSavedConnection((connection) => ({ ...connection, enabled: true }));+ expect(+ await screen.findByText('Saved Slack connection settings: enabled')+ ).toBeTruthy();+});++it('hands the mobile sheet off to connection settings', async () => {+ state.mobile = true;+ setup();+ fireEvent.click(await screen.findByRole('button', { name: /GitHub/ }));+ expect(await screen.findByText('Settings for github')).toBeTruthy();+});diff --git a/apps/web/src/features/agents-view/views/ComposerAddMenu.tsx b/apps/web/src/features/agents-view/views/ComposerAddMenu.tsxnew file mode 100644index 0000000000..c9a2702515--- /dev/null+++ b/apps/web/src/features/agents-view/views/ComposerAddMenu.tsx@@ -0,0 +1,247 @@+import {+ ComposerAddDrawer,+ ComposerAddMenu,+ type ComposerAddMenuGroup,+} from '@channel/Input/ComposerAddMenu';+import { useSettingsState } from '@core/constant/SettingsState';+import { isMobile } from '@core/mobile/isMobile';+import { PipedreamConnectorIcon } from '@core/pipedream/ConnectorIcon';+import BooksIcon from '@phosphor/books.svg';+import LightningIcon from '@phosphor/lightning.svg';+import PaperclipIcon from '@phosphor/paperclip.svg';+import PlugsIcon from '@phosphor/plugs.svg';+import PlusIcon from '@phosphor/plus.svg';+import { Button, Dialog } from '@ui';+import { createSignal, lazy, Show, Suspense } from 'solid-js';+import type { ProviderId } from '../../settings/connections/model';+import { providerIcon } from '../../settings/connections/provider-meta';+import { useConnectionsModel } from '../../settings/connections/use-connections-model';++const ConnectionsPage = lazy(async () => ({+ default: (await import('../../settings/connections/ConnectionsPage'))+ .ConnectionsPage,+}));+const LeftoverRow = lazy(async () => ({+ default: (await import('../../settings/connections/leftover-row'))+ .LeftoverRow,+}));++type Target =+ | { kind: 'overview'; mode: 'connected' | 'discover' }+ | { kind: 'provider'; provider: ProviderId; title: string }+ | { kind: 'other'; connectionId: string; title: string };++/** Shared composer actions plus the owner's existing connection settings. */+export function AgentComposerAddMenu(props: {+ openFiles: () => void;+ openLibrary: () => void;+ openSkills: () => void;+ getEditor: () => HTMLElement | null | undefined;+ session?: boolean;+ disabled?: boolean;+}) {+ const connections = useConnectionsModel();+ const settings = useSettingsState();+ const [drawerOpen, setDrawerOpen] = createSignal(false);+ const [target, setTarget] = createSignal<Target>();+ const openTarget = (next: Target) => {+ // Release the mobile add sheet before opening the next focus trap.+ if (isMobile()) queueMicrotask(() => setTarget(next));+ else setTarget(next);+ };+ const groups = (): ComposerAddMenuGroup[] => [+ {+ items: [+ {+ id: 'upload',+ label: 'Add photos & files',+ description: 'Upload from your device',+ icon: <PaperclipIcon />,+ onSelect: props.openFiles,+ },+ {+ id: 'library',+ label: 'Add from library',+ description: 'Reference docs, people, or channels',+ icon: <BooksIcon />,+ hint: '@',+ onSelect: props.openLibrary,+ focusesEditor: true,+ },+ {+ id: 'skills',+ label: props.session ? 'Skills & commands' : 'Use a skill',+ description: 'Browse available skills',+ icon: <LightningIcon />,+ hint: '/',+ onSelect: props.openSkills,+ focusesEditor: true,+ },+ ],+ },+ {+ label: 'Connections',+ items: [+ ...connections.model().capabilities.map((connection) => ({+ id: connection.id,+ label: connection.title,+ description:+ connection.status === 'connected'+ ? (connection.account !== connection.title &&+ connection.account) ||+ 'Open connection settings'+ : connection.status === 'off'+ ? 'Disabled · Open settings'+ : 'Needs attention · Open settings',+ icon: providerIcon(connection.provider),+ onSelect: () =>+ openTarget({+ kind: 'provider',+ provider: connection.provider,+ title: connection.title,+ }),+ })),+ ...connections.model().leftovers.map((connection) => ({+ id: connection.id,+ label: connection.title,+ description: connection.enabled+ ? 'Open connection settings'+ : 'Disabled · Open settings',+ icon:+ connection.kind === 'pipedream' ? (+ <PipedreamConnectorIcon appSlug={connection.appSlug} />+ ) : (+ <PlugsIcon />+ ),+ onSelect: () =>+ openTarget({+ kind: 'other',+ connectionId: connection.id,+ title: connection.title,+ }),+ })),+ ...(!connections.ready()+ ? [+ {+ id: 'loading',+ label: 'Loading connections…',+ icon: <PlugsIcon />,+ disabled: true,+ onSelect: () => {},+ },+ ]+ : []),+ ...(connections.partialError()+ ? [+ {+ id: 'retry',+ label: 'Retry connections',+ description: 'Some connections could not be loaded',+ icon: <PlugsIcon />,+ onSelect: connections.retry,+ },+ ]+ : []),+ {+ id: 'connect',+ label: 'Add connections',+ description: 'Connect more apps to Macro',+ icon: <PlusIcon />,+ onSelect: () => openTarget({ kind: 'overview', mode: 'discover' }),+ },+ {+ id: 'manage',+ label: 'Manage connections',+ description: 'Accounts, permissions, and settings',+ icon: <PlugsIcon />,+ onSelect: () => openTarget({ kind: 'overview', mode: 'connected' }),+ },+ ],+ },+ ];+ return (+ <>+ <ComposerAddMenu+ groups={groups()}+ disabled={props.disabled}+ onOpenDrawer={() => setDrawerOpen(true)}+ placement="bottom-start"+ contentClass="w-[min(42rem,calc(100vw-2rem))] max-h-[min(32rem,var(--kb-popper-content-available-height))] overflow-y-auto rounded-2xl"+ />+ <ComposerAddDrawer+ groups={groups()}+ getEditor={props.getEditor}+ open={drawerOpen()}+ onOpenChange={setDrawerOpen}+ />+ <Show when={target()} keyed>+ {(selected) => (+ <Dialog+ open+ onOpenChange={(open) => {+ if (!open) setTarget(undefined);+ }}+ position="center"+ visibleScrim+ class="w-[min(46rem,calc(100vw-2rem))] max-h-[85dvh] overflow-y-auto rounded-2xl bg-panel"+ >+ <div class="flex items-center justify-between gap-3 border-b border-edge-muted px-5 py-3">+ <Dialog.Title class="text-base font-medium">+ {selected.kind === 'overview' ? 'Connections' : selected.title}+ </Dialog.Title>+ <Dialog.CloseButton as={Button} variant="ghost" size="sm">+ Done+ </Dialog.CloseButton>+ </div>+ <Suspense+ fallback={+ <p role="status" class="p-5 text-sm text-ink-muted">+ Loading connection settings…+ </p>+ }+ >+ <Show+ when={selected.kind === 'other' ? selected : undefined}+ fallback={+ <ConnectionsPage+ initialMode={+ selected.kind === 'overview' ? selected.mode : undefined+ }+ initialProvider={+ selected.kind === 'provider'+ ? selected.provider+ : undefined+ }+ onOpenMacroMcp={() => {+ setTarget(undefined);+ settings.openSettings('Agent');+ }}+ />+ }+ >+ {(other) => (+ <div class="p-5">+ <Show+ when={connections+ .model()+ .leftovers.find(+ (connection) => connection.id === other().connectionId+ )}+ fallback={+ <p class="text-sm text-ink-muted">+ This connection is no longer available.+ </p>+ }+ >+ {(connection) => <LeftoverRow leftover={connection()} />}+ </Show>+ </div>+ )}+ </Show>+ </Suspense>+ </Dialog>+ )}+ </Show>+ </>+ );+}diff --git a/apps/web/src/features/agents-view/views/NewChatPage.test.tsx b/apps/web/src/features/agents-view/views/NewChatPage.test.tsxindex e989e1f829..8b187ff886 100644--- a/apps/web/src/features/agents-view/views/NewChatPage.test.tsx+++ b/apps/web/src/features/agents-view/views/NewChatPage.test.tsx@@ -262,6 +262,8 @@ function page(function openAgents() {const trigger = screen.getByRole('button', { name: 'Agent' });fireEvent.keyDown(trigger, { key: 'Enter' });+ const overview = screen.queryByRole('menuitem', { name: 'Choose model' });+ if (overview) fireEvent.keyDown(overview, { key: 'Enter' });return trigger;}async function selectAgent(name: RegExp) {@@ -337,6 +339,26 @@ describe('agent-led new conversation', () => {motionStyles.remove();vi.unstubAllGlobals();});+ it.each([390, 1024])(+ 'keeps the touch picker as a single sheet at %ipx',+ async (width) => {+ vi.stubGlobal('innerWidth', width);+ mocks.touch = true;+ page();+ fireEvent.click(screen.getByRole('button', { name: 'Agent' }));+ const sheet = await screen.findByRole('dialog');+ expect(+ within(sheet).getByRole('textbox', { name: 'Search agents and models' })+ ).toBeTruthy();+ expect(screen.queryByRole('menu')).toBeNull();+ expect(screen.queryByRole('group', { name: 'Agents' })).toBeNull();+ expect(screen.queryByRole('group', { name: 'Models' })).toBeNull();+ fireEvent.click(+ within(sheet).getByRole('button', { name: 'Sonnet 5.5' })+ );+ await waitFor(() => expect(screen.queryByRole('dialog')).toBeNull());+ }+ );it('selects a coding model from the phone sheet without hover and preserves the draft', async () => {mocks.touch = true;const send = page(true, [], false, [], 'code');@@ -410,18 +432,52 @@ describe('agent-led new conversation', () => {});await waitFor(() => expect(document.activeElement).toBe(search));});- it('focuses desktop search on opening and reopening the model selector', async () => {+ it('opens the full desktop catalog without search or a More step', async () => {page();for (let attempt = 0; attempt < 2; attempt++) {openAgents();- const search = screen.getByRole('textbox', { name: 'Search models' });- await waitFor(() => expect(document.activeElement).toBe(search));- fireEvent.input(search, { target: { value: 'Sonnet' } });- expect(screen.getByTitle('Sonnet 5.5')).toBeTruthy();- fireEvent.keyDown(search, { key: 'Escape' });+ expect(+ screen.queryByRole('textbox', { name: 'Search models' })+ ).toBeNull();+ expect(+ screen.queryByRole('menuitem', { name: 'More models' })+ ).toBeNull();+ expect(+ within(screen.getByRole('group', { name: 'Suggested' })).getByTitle(+ 'Sonnet 5.5'+ )+ ).toBeTruthy();+ expect(screen.getByTitle('GLM 5.3 Flash')).toBeTruthy();+ fireEvent.keyDown(screen.getByRole('menu'), { key: 'Escape' });await waitFor(() => expect(screen.queryByRole('menu')).toBeNull());}});+ it('separates the desktop agent and model choices into named groups', () => {+ page();+ openAgents();+ const agents = screen.getByRole('group', { name: 'Agents' });+ const models = screen.getByRole('group', { name: 'Models' });+ expect(screen.queryByText('Your agents')).toBeNull();+ expect(screen.queryByText('Suggested')).toBeNull();+ const suggested = within(models).getByRole('group', { name: 'Suggested' });+ const anthropic = within(models).getByRole('group', { name: 'Anthropic' });+ expect(+ suggested.compareDocumentPosition(anthropic) &+ Node.DOCUMENT_POSITION_FOLLOWING+ ).toBe(Node.DOCUMENT_POSITION_FOLLOWING);++ expect(+ within(agents).getByRole('menuitem', { name: 'Create agent' })+ ).toBeTruthy();+ expect(+ within(models).queryByRole('textbox', { name: 'Search models' })+ ).toBeNull();+ expect(+ within(+ within(models).getByRole('group', { name: 'Suggested' })+ ).getByRole('menuitem', { name: 'Opus 5.5' })+ ).toBeTruthy();+ });it('starts in Chat and switches to Code from the composer', async () => {const send = page();expect(@@ -519,7 +575,7 @@ describe('agent-led new conversation', () => {).toBeTruthy();expect(screen.queryByRole('button', { name: 'Repository' })).toBeNull();openAgents();- expect(screen.getByRole('group', { name: 'Suggested' })).toBeTruthy();+ expect(screen.getByRole('group', { name: 'Models' })).toBeTruthy();expect(screen.queryByRole('menuitem', { name: /Cursor/ })).toBeNull();fireEvent.keyDown(document, { key: 'Escape' });await waitFor(() => expect(screen.queryByRole('menu')).toBeNull());@@ -561,13 +617,13 @@ describe('agent-led new conversation', () => {(screen.getByRole('textbox', { name: 'Draft' }) as HTMLInputElement).value).toBe('Keep this prompt');});- it('starts a new conversation on Choose repository, not the last used one', async () => {+ it('starts a new conversation on Choose automatically, not the last used one', async () => {mocks.recentIds = [CURSOR_BOT_ID];mocks.recentUrls = ['https://github.com/macro-inc/macro'];const send = page(true, [], false, [], 'code');expect(screen.getByRole('button', { name: 'Repository' }).textContent- ).toContain('Choose repository');+ ).toContain('Choose automatically');expect(screen.getByRole('button', { name: 'Repository' }).textContent).not.toContain('macro-inc/macro');@@ -894,7 +950,9 @@ describe('agent-led new conversation', () => {it('clears a temporary model choice when switching to Code', async () => {page();openAgents();- const model = screen.getByTitle('Sonnet 5.5');+ const model = within(+ screen.getByRole('group', { name: 'Suggested' })+ ).getByTitle('Sonnet 5.5');model.focus();fireEvent.keyDown(model, { key: 'Enter' });await waitFor(() => expect(screen.queryByRole('menu')).toBeNull());@@ -915,34 +973,19 @@ describe('agent-led new conversation', () => {},]);openAgents();- const modelsGroup = screen.getByRole('group', { name: 'Suggested' });- const agentsGroup = screen.getByRole('group', { name: 'Your agents' });- expect(- modelsGroup.compareDocumentPosition(agentsGroup) &- Node.DOCUMENT_POSITION_FOLLOWING- ).toBe(Node.DOCUMENT_POSITION_FOLLOWING);+ const models = within(screen.getByRole('group', { name: 'Models' }));+ expect(screen.getByRole('group', { name: 'Your agents' })).toBeTruthy();expect(screen.queryByRole('group', { name: 'Coding agents' })).toBeNull();- const search = screen.getByRole('textbox', { name: 'Search models' });- expect(screen.getByRole('menuitem', { name: /More models/ })).toBeTruthy();- expect(screen.queryByRole('group', { name: 'Z.ai' })).toBeNull();- fireEvent.input(search, { target: { value: 'GLM' } });- expect(screen.getByTitle('GLM 5.3')).toBeTruthy();- expect(screen.getByTitle('GLM 5.3 Flash')).toBeTruthy();- fireEvent.input(search, { target: { value: '' } });+ expect(screen.queryByRole('textbox', { name: 'Search models' })).toBeNull();+ expect(screen.queryByRole('menuitem', { name: /More models/ })).toBeNull();+ expect(models.getByRole('group', { name: 'Z.ai' })).toBeTruthy();+ expect(models.getByTitle('GLM 5.3')).toBeTruthy();+ expect(models.getByTitle('GLM 5.3 Flash')).toBeTruthy();expect(screen.queryByRole('menuitem', { name: /Cursor/ })).toBeNull();expect(screen.queryByRole('menuitem', { name: /^Macro/ })).toBeNull();- const models = within(screen.getByRole('group', { name: 'Suggested' }));- expect(- models.queryByRole('menuitem', { name: /Cursor default/ })- ).toBeNull();- expect(models.getAllByRole('menuitem').map((item) => item.title)).toEqual([- 'Opus 5.5',- 'Sonnet 5.5',- 'GPT-5.6',- 'GPT-6 Astra',- 'Gemini 3.8 Flash',- ]);- const sonnet = models.getByTitle('Sonnet 5.5');+ const sonnet = within(+ models.getByRole('group', { name: 'Suggested' })+ ).getByTitle('Sonnet 5.5');expect(sonnet.querySelector('[data-ai-provider="anthropic"] svg')).toBeTruthy();@@ -1003,24 +1046,17 @@ describe('agent-led new conversation', () => {/>));openAgents();- const sonnet = screen.getByTitle('Sonnet 5.5');+ const sonnet = within(+ screen.getByRole('group', { name: 'Suggested' })+ ).getByTitle('Sonnet 5.5');expect(sonnet.getAttribute('aria-disabled')).toBe('true');fireEvent.click(sonnet);fireEvent.keyDown(sonnet, { key: 'Enter' });- const search = screen.getByRole('textbox', { name: 'Search models' });- fireEvent.input(search, { target: { value: 'GLM' } });const flash = screen.getByTitle('GLM 5.3 Flash');expect(flash.getAttribute('aria-disabled')).toBe('true');fireEvent.click(flash);- fireEvent.input(search, { target: { value: '' } });-- const more = screen.getByRole('menuitem', { name: 'More models' });- more.focus();- fireEvent.keyDown(more, { key: 'ArrowRight' });- const extra = await screen.findByTitle('GLM 5.3 Flash');- expect(extra.getAttribute('aria-disabled')).toBe('true');- fireEvent.click(extra);+ fireEvent.keyDown(flash, { key: 'Enter' });expect(onSelect).not.toHaveBeenCalled();});it('restores a preferred Macro model on a fresh composer', () => {@@ -1041,7 +1077,9 @@ describe('agent-led new conversation', () => {await waitFor(() => expect(screen.getByRole('menu')).toBeTruthy());expect(screen.queryByTitle('Sonnet 5.5')).toBeNull();expect(- within(screen.getByRole('menu')).getByTitle('Gemini 3.8 Flash')+ within(screen.getByRole('group', { name: 'Suggested' })).getByTitle(+ 'Gemini 3.8 Flash'+ )).toBeTruthy();fireEvent.keyDown(screen.getByRole('menu'), { key: 'Escape' });fireEvent.click(screen.getByRole('button', { name: 'Send' }));@@ -1096,6 +1134,29 @@ describe('agent-led new conversation', () => {);});+ it('sends the effort chosen with the separate speedometer slider', async () => {+ const send = page(true, [], false, [], 'code');+ const models = await hoverAgent('Cursor');+ fireEvent.keyDown(models.getByRole('menuitem', { name: /^GPT-5/ }), {+ key: 'Enter',+ });+ await waitFor(() => expect(screen.queryByRole('menu')).toBeNull());+ fireEvent.keyDown(screen.getByRole('button', { name: /^Effort:/ }), {+ key: 'Enter',+ });+ const slider = screen.getByRole('slider', { name: 'Reasoning effort' });+ fireEvent.keyDown(slider, { key: 'ArrowRight' });+ expect(slider.getAttribute('aria-valuetext')).toBe('Ultra');+ fireEvent.keyDown(slider, { key: 'Escape' });+ await waitFor(() => expect(screen.queryByRole('menu')).toBeNull());+ fireEvent.click(screen.getByRole('button', { name: 'Send' }));+ expect(send).toHaveBeenLastCalledWith(+ expect.objectContaining({+ modelOverride: 'gpt-5',+ effortOverride: { configId: 'cursor_effort', value: 'ultra' },+ })+ );+ });it('passes opaque effort and clears it with the model override after sending', async () => {const send = page(true, [], false, [], 'code');const models = await hoverAgent('Cursor');@@ -1109,8 +1170,9 @@ describe('agent-led new conversation', () => {await waitFor(() => expect(screen.queryByRole('menu')).toBeNull());mocks.capabilitiesPending = true;expect(screen.getByRole('button', { name: 'Agent' }).title).toContain(- 'GPT-5 · Ultra'+ 'GPT-5');+ expect(screen.getByRole('button', { name: 'Effort: Ultra' })).toBeTruthy();fireEvent.click(screen.getByRole('button', { name: 'Send' }));expect(send).toHaveBeenLastCalledWith(expect.objectContaining({diff --git a/apps/web/src/features/agents-view/views/NewChatPage.tsx b/apps/web/src/features/agents-view/views/NewChatPage.tsxindex 55d52b9284..6b234e0067 100644--- a/apps/web/src/features/agents-view/views/NewChatPage.tsx+++ b/apps/web/src/features/agents-view/views/NewChatPage.tsx@@ -12,6 +12,7 @@ import {speedForModel,} from '@core/component/AI/constant/speed';import { fastModeEnabled } from '@core/component/AI/signal/speed';+import { ComposerGreeting } from '@core/component/ComposerGreeting';import { useSettingsState } from '@core/constant/SettingsState';import { useUserId } from '@core/context/user';import { fireAndForget } from '@core/util/fireAndForget';@@ -364,6 +365,7 @@ export function NewChatPage(props: {<div ref={tourTarget(AGENTS_TOUR.modeSwitch)} class="shrink-0"><Tabsaria-label="Conversation mode"+ fullWidthlist={(['chat', 'code'] as const).map((mode) => ({value: mode,label: () => (@@ -380,7 +382,8 @@ export function NewChatPage(props: {}))}value={mode()}onChange={(value) => setMode(value === 'code' ? 'code' : 'chat')}- labelClass="px-3 touch:px-2.5"+ class="h-9 w-56 touch:w-24 rounded-full bg-ink/3 light-mode:bg-[rgb(246_246_246)] dark-mode:bg-[rgb(24_24_24)] shadow-none [&>[role=presentation]]:shadow-none [&>[role=presentation]]:duration-250 [&>[role=presentation]]:ease-[cubic-bezier(0.22,1,0.36,1)] motion-reduce:[&>[role=presentation]]:duration-0 [&>[role=presentation]]:border-0 [&>[role=presentation]]:bg-panel dark-mode:[&>[role=presentation]]:bg-[rgb(32_32_32)] [&>[role=presentation]]:bg-[linear-gradient(to_bottom,color-mix(in_srgb,var(--color-ink)_2%,transparent),transparent)] light-mode:[&>[role=presentation]]:border light-mode:[&>[role=presentation]]:border-ink/7 light-mode:[&>[role=presentation]]:[background-image:none] light-mode:[&>[role=presentation]]:shadow-[0_1px_6px_0_color-mix(in_srgb,var(--color-ink)_5%,transparent)] light-mode:[&>[role=presentation]]:bg-[rgb(250_250_250)]"+ labelClass="h-9 px-4 text-sm touch:px-2.5"/></div>);@@ -474,9 +477,17 @@ export function NewChatPage(props: {<section class="page newchat" data-active aria-label="New conversation"><div ref={tourTarget(AGENTS_TOUR.composer)} class="col"><div class="greeting">- <h2>- {coding() ? 'What should we build?' : 'What should we work on?'}- </h2>+ <ComposerGreeting wireframe={coding()}>+ <Show when={mode()} keyed>+ {(currentMode) => (+ <span class="greeting-text">+ {currentMode === 'code'+ ? 'What should we build?'+ : 'What should we work on?'}+ </span>+ )}+ </Show>+ </ComposerGreeting></div><FloatRegionOrInlineregion="accessory"diff --git a/apps/web/src/features/agents-view/views/RepositoryPicker.tsx b/apps/web/src/features/agents-view/views/RepositoryPicker.tsxindex 1f55114f6a..baef82f13d 100644--- a/apps/web/src/features/agents-view/views/RepositoryPicker.tsx+++ b/apps/web/src/features/agents-view/views/RepositoryPicker.tsx@@ -3,7 +3,6 @@ import { isTouchDevice } from '@core/mobile/isTouchDevice';import { Popover } from '@kobalte/core/popover';import CaretDownIcon from '@phosphor/caret-down.svg';import CheckIcon from '@phosphor/check.svg';-import FolderIcon from '@phosphor/folder-simple.svg';import GitBranchIcon from '@phosphor/git-branch.svg';import GithubIcon from '@phosphor/github-logo.svg';import { Button, createCommandListController } from '@ui';@@ -198,11 +197,11 @@ export function RepositoryPicker(props: {triggerClass="pill min-w-0 max-w-full text-ink"trigger={<>- <FolderIcon class="size-4 shrink-0" />+ <GithubIcon class="size-4 shrink-0" /><span class="truncate">{props.repoUrl? repositoryLabel(props.repoUrl)- : 'Choose repository'}+ : 'Choose automatically'}</span><CaretDownIcon class="size-3 shrink-0" /></>diff --git a/apps/web/src/features/block-agent/component/EffortSelector.test.tsx b/apps/web/src/features/block-agent/component/EffortSelector.test.tsxindex 13f7c710fe..d6f3c65b50 100644--- a/apps/web/src/features/block-agent/component/EffortSelector.test.tsx+++ b/apps/web/src/features/block-agent/component/EffortSelector.test.tsx@@ -46,43 +46,42 @@ afterEach(() => {HTMLElement.prototype.scrollTo = originalScrollTo;vi.unstubAllGlobals();});-it.each([false, true])(- 'selects a named effort option and closes (touch=%s)',- async (touch) => {- vi.mocked(isTouchDevice).mockReturnValue(touch);- const change = vi.fn();- const openChange = vi.fn();- render(() => (- <EffortSelector- config={config}- onChange={change}- onOpenChange={openChange}- />- ));- const trigger = screen.getByRole('button', { name: 'Effort: Low' });- if (touch) fireEvent.click(trigger);- else fireEvent.keyDown(trigger, { key: 'ArrowDown' });- const high = await screen.findByRole(touch ? 'button' : 'menuitem', {- name: 'High',- });- if (touch) {- expect(- screen.getByRole('button', { name: 'Low' }).getAttribute('aria-pressed')- ).toBe('true');- expect(high.getAttribute('aria-pressed')).toBe('false');- fireEvent.click(high);- } else {- high.focus();- fireEvent.keyDown(high, { key: 'Enter' });- }- expect(openChange).toHaveBeenLastCalledWith(false);- expect(change).toHaveBeenCalledExactlyOnceWith({- configId: 'effort',- value: 'high',- name: 'High',- });+it('selects a named effort option and closes on touch', async () => {+ const touch = true;+ vi.mocked(isTouchDevice).mockReturnValue(touch);+ const change = vi.fn();+ const openChange = vi.fn();+ render(() => (+ <EffortSelector+ config={config}+ onChange={change}+ onOpenChange={openChange}+ />+ ));+ const trigger = screen.getByRole('button', { name: 'Effort: Low' });+ if (touch) fireEvent.click(trigger);+ else fireEvent.keyDown(trigger, { key: 'ArrowDown' });+ expect(screen.queryByRole('slider')).toBeNull();+ const high = await screen.findByRole(touch ? 'button' : 'menuitem', {+ name: 'High',+ });+ if (touch) {+ expect(+ screen.getByRole('button', { name: 'Low' }).getAttribute('aria-pressed')+ ).toBe('true');+ expect(high.getAttribute('aria-pressed')).toBe('false');+ fireEvent.click(high);+ } else {+ high.focus();+ fireEvent.keyDown(high, { key: 'Enter' });}-);+ expect(openChange).toHaveBeenLastCalledWith(false);+ expect(change).toHaveBeenCalledExactlyOnceWith({+ configId: 'effort',+ value: 'high',+ name: 'High',+ });+});it('hides unsupported effort', () => {render(() => <EffortSelector onChange={vi.fn()} />);expect(screen.queryByRole('button')).toBeNull();@@ -116,3 +115,24 @@ it('returns focus to the composer when the mobile chooser closes', async () => {fireEvent.keyDown(low, { key: 'Escape' });await waitFor(() => expect(document.activeElement).toBe(input));});++it('adjusts desktop effort with the speedometer slider and retains the popup', async () => {+ vi.mocked(isTouchDevice).mockReturnValue(false);+ const change = vi.fn();+ render(() => <EffortSelector config={config} onChange={change} />);+ fireEvent.keyDown(screen.getByRole('button', { name: 'Effort: Low' }), {+ key: 'Enter',+ });+ const slider = await screen.findByRole('slider', {+ name: 'Reasoning effort',+ });+ await waitFor(() => expect(document.activeElement).toBe(slider));+ expect(screen.queryByRole('menuitem', { name: 'Choose model' })).toBeNull();+ fireEvent.keyDown(slider, { key: 'ArrowRight' });+ expect(change).toHaveBeenCalledExactlyOnceWith({+ configId: 'effort',+ value: 'high',+ name: 'High',+ });+ expect(screen.getByRole('menu')).toBeTruthy();+});diff --git a/apps/web/src/features/block-agent/component/EffortSelector.tsx b/apps/web/src/features/block-agent/component/EffortSelector.tsxindex 7fd5e39a12..18c5ed4289 100644--- a/apps/web/src/features/block-agent/component/EffortSelector.tsx+++ b/apps/web/src/features/block-agent/component/EffortSelector.tsx@@ -1,4 +1,5 @@import { MobileDrawer } from '@components/app/mobile/MobileDrawer';+import { ModelEffortMenu } from '@core/component/AI/component/input/ModelEffortMenu';import { isTouchDevice } from '@core/mobile/isTouchDevice';import Check from '@phosphor/check.svg';import { Button, Dropdown, Tooltip } from '@ui';@@ -18,6 +19,7 @@ export function EffortSelector(props: {onCloseAutoFocus?: (event: Event) => void;}) {const [open, setOpen] = createSignal(false);+ let content: HTMLElement | undefined;const changeOpen = (value: boolean) => {setOpen(value);props.onOpenChange?.(value);@@ -89,19 +91,35 @@ export function EffortSelector(props: {{contents()}</Dropdown.Trigger></Tooltip>- <Dropdown.Content class="w-48" aria-label="Reasoning effort">- <Dropdown.Group>- <For each={choices()}>- {(choice) => (- <Dropdown.Item- disabled={props.disabled}- onSelect={() => choose(choice)}- >- {optionLabel(choice)}- </Dropdown.Item>- )}- </For>- </Dropdown.Group>+ <Dropdown.Content+ ref={content}+ onOpenAutoFocus={(event) => {+ // This menu contains a slider rather than roving menu items.+ event.preventDefault();+ content?.querySelector<HTMLElement>('[role="slider"]')?.focus();+ }}+ class="w-64 rounded-2xl"+ aria-label="Reasoning effort"+ onCloseAutoFocus={props.onCloseAutoFocus}+ >+ <ModelEffortMenu+ effortOnly+ label="Reasoning effort"+ config={props.config}+ value={value()}+ disabled={props.disabled}+ onChange={(next) => {+ const choice = choices().find(+ (choice) => choice.value === next+ );+ if (props.config && choice)+ props.onChange({+ configId: props.config.id,+ value: choice.value,+ name: choice.name,+ });+ }}+ /></Dropdown.Content></Dropdown>}diff --git a/apps/web/src/features/block-agent/state/session-config.test.ts b/apps/web/src/features/block-agent/state/session-config.test.tsnew file mode 100644index 0000000000..28e72e5c58--- /dev/null+++ b/apps/web/src/features/block-agent/state/session-config.test.ts@@ -0,0 +1,42 @@+import { describe, expect, it } from 'vitest';+import {+ effortConfigOption,+ effortLabel,+ type SelectSessionConfigOption,+} from './session-config';++const config: SelectSessionConfigOption = {+ id: 'reasoning_effort',+ name: 'Reasoning effort',+ category: 'thought_level',+ type: 'select',+ description: null,+ currentValue: 'default',+ options: ['default', 'low', 'medium', 'high'].map((value) => ({+ value,+ name: value[0].toUpperCase() + value.slice(1),+ group: null,+ description: null,+ })),+};++describe('native effort presentation', () => {+ it('preserves the runtime default without assuming a reasoning level', () => {+ const option = effortConfigOption([config]);+ expect(option?.options.map((choice) => choice.value)).toEqual([+ 'default',+ 'low',+ 'medium',+ 'high',+ ]);+ expect(effortLabel(option)).toBe('Default');+ expect(effortLabel(option, 'default')).toBe('Default');+ expect(effortLabel(option, 'low')).toBe('Low');+ });++ it('preserves external harness choices', () => {+ const external = { ...config, id: 'external-effort' };+ expect(effortConfigOption([external])).toBe(external);+ expect(effortLabel(external)).toBe('Default');+ });+});diff --git a/apps/web/src/features/block-agent/ui/AgentModelSelector.test.tsx b/apps/web/src/features/block-agent/ui/AgentModelSelector.test.tsxindex ebf08ee2c0..41f60fb897 100644--- a/apps/web/src/features/block-agent/ui/AgentModelSelector.test.tsx+++ b/apps/web/src/features/block-agent/ui/AgentModelSelector.test.tsx@@ -184,3 +184,19 @@ it('keeps the touch picker visible while models load', async () => {expect(status.textContent).toContain('Waiting for the agent');expect(screen.getByRole('textbox', { name: 'Search models' })).toBeTruthy();});++it('preserves the current effort label in the mobile model trigger', () => {+ device.touch = true;+ render(() => (+ <AgentModelSelector+ model="gpt-5"+ options={[{ id: 'gpt-5', name: 'GPT-5', group: null, description: null }]}+ effortLabel="High"+ onSelect={vi.fn()}+ />+ ));+ expect(+ screen.getByRole('button', { name: 'Agent model' }).textContent+ ).toContain('GPT-5 · High');+ expect(screen.queryByRole('slider')).toBeNull();+});diff --git a/apps/web/src/features/block-agent/ui/AgentModelSelector.tsx b/apps/web/src/features/block-agent/ui/AgentModelSelector.tsxindex 82bc3ab0af..e91dee3035 100644--- a/apps/web/src/features/block-agent/ui/AgentModelSelector.tsx+++ b/apps/web/src/features/block-agent/ui/AgentModelSelector.tsx@@ -99,7 +99,9 @@ export function AgentModelSelector(props: AgentModelSelectorProps) {props.options.find((option) => option.id === shown())?.name);const label = () =>- [baseLabel(), props.effortLabel].filter(Boolean).join(' · ');+ isTouchDevice()+ ? [baseLabel(), props.effortLabel].filter(Boolean).join(' · ')+ : baseLabel();const options = createMemo(() => withoutRedundantGroups(props.options));const toCatalogOption = (option: ModelOption): CatalogModelOption => ({id: option.id,diff --git a/apps/web/src/features/channel/Input/ComposerAddMenu.tsx b/apps/web/src/features/channel/Input/ComposerAddMenu.tsxindex adce1370f7..bddd5a74bc 100644--- a/apps/web/src/features/channel/Input/ComposerAddMenu.tsx+++ b/apps/web/src/features/channel/Input/ComposerAddMenu.tsx@@ -8,10 +8,12 @@ import { For, type JSX, Show } from 'solid-js';export type ComposerAddMenuItem = {id: string;label: string;+ description?: string;icon: JSX.Element;/** A typed shortcut that does the same thing, e.g. `@`. */hint?: string;onSelect: () => void;+ disabled?: boolean;/*** The item puts the caret in the editor (a mention, an inserted card), so* the editor takes focus as the menu closes instead of the +.@@ -36,12 +38,21 @@ export function ComposerAddMenu(props: {groups: ComposerAddMenuGroup[];onOpenDrawer: () => void;class?: string;+ contentClass?: string;+ placement?: 'top-start' | 'bottom-start';+ disabled?: boolean;}) {return (<Showwhen={isMobile()}fallback={- <AddDropdown groups={nonEmpty(props.groups)} class={props.class} />+ <AddDropdown+ groups={nonEmpty(props.groups)}+ class={props.class}+ contentClass={props.contentClass}+ placement={props.placement}+ disabled={props.disabled}+ />}><Button@@ -50,6 +61,7 @@ export function ComposerAddMenu(props: {class={cn('touch:size-6', props.class)}aria-label="Add"aria-haspopup="dialog"+ disabled={props.disabled}// Keep compatibility mouse focus from blurring the editor before the// tap's click; pointerdown stays uncancelled so WebKit emits it.onMouseDown={(event: MouseEvent) => {@@ -66,6 +78,9 @@ export function ComposerAddMenu(props: {function AddDropdown(props: {groups: ComposerAddMenuGroup[];class?: string;+ contentClass?: string;+ placement?: 'top-start' | 'bottom-start';+ disabled?: boolean;}) {// An item that moves focus into the editor runs once the menu has closed,// in place of the menu's return of focus to the +; otherwise that return@@ -77,18 +92,20 @@ function AddDropdown(props: {};return (- <Dropdown placement="top-start" gutter={8}>+ <Dropdown placement={props.placement ?? 'top-start'} gutter={8}><Dropdown.Trigger+ data-composer-menu-anchorvariant="ghost"size="icon-composer"class={cn('touch:size-6', props.class)}aria-label="Add"label="Add"+ disabled={props.disabled}><PlusIcon /></Dropdown.Trigger><Dropdown.Content- class="min-w-56"+ class={cn('min-w-56', props.contentClass)}onCloseAutoFocus={(event: Event) => {const run = pending;pending = undefined;@@ -105,11 +122,26 @@ function AddDropdown(props: {</Show><For each={group.items}>{(item) => (- <Dropdown.Item onSelect={() => select(item)}>+ <Dropdown.Item+ disabled={item.disabled}+ onSelect={() => select(item)}+ class={+ item.description+ ? 'min-h-10 h-auto py-2 gap-3'+ : undefined+ }+ ><span class="flex size-3.5 shrink-0 items-center justify-center text-ink-muted">{item.icon}</span>- <span class="flex-1 truncate">{item.label}</span>+ <span class="min-w-0 flex-1 flex flex-wrap items-baseline gap-x-3">+ <span class="block truncate">{item.label}</span>+ <Show when={item.description}>+ <span class="block truncate text-sm text-ink-muted font-normal">+ {item.description}+ </span>+ </Show>+ </span><Show when={item.hint}><span class="shrink-0 pl-4 font-mono text-xs text-ink-extra-muted">{item.hint}@@ -138,11 +170,16 @@ export function ComposerAddDrawer(props: {open: boolean;onOpenChange: (open: boolean) => void;}) {+ let selectedAction = false;return (<MobileDrawerside="bottom"open={props.open}onOpenChange={props.onOpenChange}+ onFinalFocus={(event) => {+ if (selectedAction) event.preventDefault();+ selectedAction = false;+ }}preventScroll={false}preventScrollbarShift={false}>@@ -159,6 +196,7 @@ export function ComposerAddDrawer(props: {<For each={group.items}>{(item) => (<MobileDrawer.Item+ disabled={item.disabled}data-composer-add-item={item.id}ref={(el) => {if (item.focusesEditor)@@ -167,14 +205,22 @@ export function ComposerAddDrawer(props: {}));}}onClick={() => {- props.onOpenChange(false);+ selectedAction = true;item.onSelect();+ props.onOpenChange(false);}}><span class="flex size-5 shrink-0 items-center justify-center text-ink-muted [&_svg]:size-5">{item.icon}</span>- <span class="flex-1">{item.label}</span>+ <span class="min-w-0 flex-1">+ <span class="block">{item.label}</span>+ <Show when={item.description}>+ <span class="block text-xs text-ink-muted font-normal">+ {item.description}+ </span>+ </Show>+ </span></MobileDrawer.Item>)}</For>diff --git a/apps/web/src/features/channel/Input/InputActions.tsx b/apps/web/src/features/channel/Input/InputActions.tsxindex b162ee8e0d..de9e5c4c37 100644--- a/apps/web/src/features/channel/Input/InputActions.tsx+++ b/apps/web/src/features/channel/Input/InputActions.tsx@@ -22,6 +22,7 @@ export function AttachFilesAction(accept?: string | null;disabled?: boolean;children?: JSX.Element;+ trigger?: (openPicker: () => void) => JSX.Element;} = {}) {const commands = useInputCommands();@@ -54,13 +55,17 @@ export function AttachFilesAction(disabled={props.disabled}data-input-attach-file-picker/>- <InputActionButton- label="Attach files"- disabled={props.disabled}- onClick={() => fileInputRef?.click()}- >- {props.children ?? <PaperclipIcon />}- </InputActionButton>+ {props.trigger ? (+ props.trigger(() => fileInputRef?.click())+ ) : (+ <InputActionButton+ label="Attach files"+ disabled={props.disabled}+ onClick={() => fileInputRef?.click()}+ >+ {props.children ?? <PaperclipIcon />}+ </InputActionButton>+ )}</>);}diff --git a/apps/web/src/features/channel/Input/tests/attach-files-action.test.tsx b/apps/web/src/features/channel/Input/tests/attach-files-action.test.tsxnew file mode 100644index 0000000000..5d3d727685--- /dev/null+++ b/apps/web/src/features/channel/Input/tests/attach-files-action.test.tsx@@ -0,0 +1,39 @@+/** @vitest-environment jsdom */+import { fireEvent, render, screen } from '@solidjs/testing-library';+import { expect, it, vi } from 'vitest';+import { InputProvider } from '../context';+import { AttachFilesAction } from '../InputActions';++it('routes a custom trigger through the existing picker and attachment command', () => {+ const attachFiles = vi.fn(async () => {});+ const view = render(() => (+ <InputProvider+ value={{+ view: () => ({ mode: 'channel' }),+ commands: {+ attachFiles,+ send: async () => false,+ toggleFormatRibbon() {},+ close() {},+ removeAttachment() {},+ },+ }}+ >+ <AttachFilesAction+ accept={null}+ trigger={(open) => <button onClick={open}>Upload</button>}+ />+ </InputProvider>+ ));+ const picker =+ view.container.querySelector<HTMLInputElement>('input[type="file"]')!;+ const click = vi.spyOn(picker, 'click');+ fireEvent.click(screen.getByRole('button', { name: 'Upload' }));+ expect(click).toHaveBeenCalledOnce();+ expect(picker.hasAttribute('accept')).toBe(false);+ const file = new File(['example'], 'example.txt');+ fireEvent.change(picker, { target: { files: [file] } });+ expect(attachFiles).toHaveBeenCalledWith([file]);+ expect(picker.value).toBe('');+ view.unmount();+});diff --git a/apps/web/src/features/home/components/HomeChatStart.tsx b/apps/web/src/features/home/components/HomeChatStart.tsxindex dc833d3669..99addf2774 100644--- a/apps/web/src/features/home/components/HomeChatStart.tsx+++ b/apps/web/src/features/home/components/HomeChatStart.tsx@@ -6,6 +6,7 @@ import {import { useFeatureFlag } from '@app/lib/analytics/posthog';import { DragDropWrapper } from '@core/component/AI/component/DragDrop';import { ChatInputProvider } from '@core/component/AI/context';+import { ComposerGreeting } from '@core/component/ComposerGreeting';import { enableChatV3Agents } from '@core/constant/featureFlags';import { Show } from 'solid-js';import { HomeChatInput } from '../home-chat-input';@@ -54,9 +55,11 @@ export function HomeChatStart() {><div class="self-end"><Show when={!agents().enabled}>- <h1 class="mb-6 min-h-0 min-w-0 self-end text-center text-2xl font-normal leading-[42px] text-ink">- What should we get done in Macro?- </h1>+ <div class="mb-6 min-h-0 min-w-0">+ <ComposerGreeting as="h1">+ What should we get done in Macro?+ </ComposerGreeting>+ </div></Show></div><HomeChatInputdiff --git a/apps/web/src/features/onboarding/components/onboarding.css b/apps/web/src/features/onboarding/components/onboarding.cssindex 2afc1eaa6e..e94859362a 100644--- a/apps/web/src/features/onboarding/components/onboarding.css+++ b/apps/web/src/features/onboarding/components/onboarding.css@@ -1,11 +1,3 @@-@font-face {- font-family: 'Roboto Slab Variable';- font-style: normal;- font-weight: 100 900;- font-display: swap;- src: url('../assets/roboto-slab-variable.woff2') format('woff2');-}-/* Keep the onboarding palette local; the app's theme selection owns light/dark. */.onboarding-flow {color-scheme: dark;diff --git a/apps/web/src/features/settings/connections/ConnectionsPage.tsx b/apps/web/src/features/settings/connections/ConnectionsPage.tsxindex 89d25a15b9..bc5dfdd594 100644--- a/apps/web/src/features/settings/connections/ConnectionsPage.tsx+++ b/apps/web/src/features/settings/connections/ConnectionsPage.tsx@@ -11,11 +11,16 @@ import { createEffect, createSignal, on, Show, Suspense } from 'solid-js';import { SettingsPage } from '../primitives';import { ConnectedView } from './ConnectedView';import { DiscoverView } from './DiscoverView';-import { capabilitiesFor } from './model';+import { capabilitiesFor, type ProviderId } from './model';import { PipedreamAiProvider } from './PipedreamAiProvider';import { SlackChannelImportFlow } from './slack-channel-import/SlackChannelImportFlow';import { useConnectionsModel } from './use-connections-model';-import { ConnectionsViewProvider, useConnectionsView } from './view-state';+import {+ type ConnectionsMode,+ ConnectionsViewProvider,+ createConnectionsViewState,+ useConnectionsView,+} from './view-state';function MacroMcpSignpost(props: { onOpen: () => void }) {return (@@ -32,9 +37,17 @@ function MacroMcpSignpost(props: { onOpen: () => void }) {);}-export function ConnectionsPage(props: { onOpenMacroMcp: () => void }) {+export function ConnectionsPage(props: {+ onOpenMacroMcp: () => void;+ initialMode?: ConnectionsMode;+ initialProvider?: ProviderId;+}) {+ const view = createConnectionsViewState({+ mode: props.initialMode,+ provider: props.initialProvider,+ });return (- <ConnectionsViewProvider>+ <ConnectionsViewProvider value={view}><ConnectionsContent onOpenMacroMcp={props.onOpenMacroMcp} /></ConnectionsViewProvider>);diff --git a/apps/web/src/features/settings/connections/view-state.test.ts b/apps/web/src/features/settings/connections/view-state.test.tsnew file mode 100644index 0000000000..9ae850a230--- /dev/null+++ b/apps/web/src/features/settings/connections/view-state.test.ts@@ -0,0 +1,25 @@+import { createRoot } from 'solid-js';+import { expect, it } from 'vitest';+import { createConnectionsViewState } from './view-state';++it('opens a selected provider and returns to its connection overview', () => {+ createRoot((dispose) => {+ const view = createConnectionsViewState({ provider: 'github' });+ expect(view.provider()).toBe('github');+ view.showOverview();+ expect(view.provider()).toBeNull();+ expect(view.mode()).toBe('connected');+ dispose();+ });+});+it('starts in discovery and preserves that mode when closing a provider', () => {+ createRoot((dispose) => {+ const view = createConnectionsViewState({ mode: 'discover' });+ expect(view.mode()).toBe('discover');+ view.openProvider('github');+ view.closeProvider();+ expect(view.provider()).toBeNull();+ expect(view.mode()).toBe('discover');+ dispose();+ });+});diff --git a/apps/web/src/features/settings/connections/view-state.tsx b/apps/web/src/features/settings/connections/view-state.tsxindex 2f1820a885..f555930b71 100644--- a/apps/web/src/features/settings/connections/view-state.tsx+++ b/apps/web/src/features/settings/connections/view-state.tsx@@ -9,9 +9,16 @@ import type { ProviderId } from './model';export type ConnectionsMode = 'connected' | 'discover';/** Navigation belongs to one mounted Agents Connections page, not global settings. */-export function createConnectionsViewState() {- const [mode, setMode] = createSignal<ConnectionsMode>('connected');- const [provider, setProvider] = createSignal<ProviderId | null>(null);+export function createConnectionsViewState(initial?: {+ mode?: ConnectionsMode;+ provider?: ProviderId;+}) {+ const [mode, setMode] = createSignal<ConnectionsMode>(+ initial?.mode ?? 'connected'+ );+ const [provider, setProvider] = createSignal<ProviderId | null>(+ initial?.provider ?? null+ );return {mode,provider,diff --git a/apps/web/src/index.css b/apps/web/src/index.cssindex 1c57c5c70f..020b972657 100644--- a/apps/web/src/index.css+++ b/apps/web/src/index.css@@ -1,5 +1,13 @@@import "tailwindcss";+@font-face {+ font-family: 'Roboto Slab Variable';+ font-style: normal;+ font-weight: 100 900;+ font-display: swap;+ src: url('./features/onboarding/assets/roboto-slab-variable.woff2') format('woff2');+}+@source inline("{data-highlighted:}text-{comment,note,canvas,html,folder,email,code,pdf,image,write,chat,video,rss,calendar,contact,default},{tauri-ios:}{hidden}");@source inline("z-{popup-viewer,viewer-definition-lookup}");@source './lib/core/component/LexicalMarkdown/theme.ts';diff --git a/apps/web/src/lib/core/component/AI/component/input/ModelCatalogPicker.tsx b/apps/web/src/lib/core/component/AI/component/input/ModelCatalogPicker.tsxindex 570e2d919f..05c2c50241 100644--- a/apps/web/src/lib/core/component/AI/component/input/ModelCatalogPicker.tsx+++ b/apps/web/src/lib/core/component/AI/component/input/ModelCatalogPicker.tsx@@ -33,12 +33,16 @@ type ModelCatalogPickerProps = {pending?: boolean;triggerLabel?: JSX.Element;children?: JSX.Element;+ /** Optional overview that can reveal the complete catalog. */+ menu?: (catalog: JSX.Element) => JSX.Element;emptyMessage?: string;triggerClass?: string;contentClass?: string;placeholder?: string;searchPlaceholder?: string;ariaLabel?: string;+ getAnchorRect?: (anchor?: HTMLElement) => DOMRect | undefined;+ gutter?: number;placement?: 'top-start' | 'top-end' | 'bottom-start' | 'bottom-end';};@@ -76,6 +80,7 @@ export function ModelRow(props: ModelRowProps) {/** One model section, shared by the frontier shortlist and provider groups. */function ModelList(props: {label: string;+ hideLabel?: boolean;options: CatalogModelOption[];value: string | null;disabled?: boolean;@@ -85,10 +90,15 @@ function ModelList(props: {}) {const Row = props.row;return (- <Dropdown.Group class="bg-transparent py-0">- <Dropdown.GroupLabel class="h-6 font-medium text-ink-muted">- {props.label}- </Dropdown.GroupLabel>+ <Dropdown.Group+ class="bg-transparent py-0"+ aria-label={props.hideLabel ? props.label : undefined}+ >+ <Show when={!props.hideLabel}>+ <Dropdown.GroupLabel class="h-6 font-medium text-ink-muted">+ {props.label}+ </Dropdown.GroupLabel>+ </Show><For each={props.options}>{(option) => (<Row@@ -179,12 +189,35 @@ export function ModelCatalogPicker(props: ModelCatalogPickerProps) {const selected = () =>props.options.find((option) => option.id === props.value) ?? null;const displayValue = () => selected()?.label ?? props.placeholder ?? 'Model';+ const catalog = () => (+ <ModelCatalogMenu+ value={props.value}+ options={props.options}+ disabled={props.disabled || props.pending}+ onSelect={(id) => {+ props.onSelect(id);+ setOpen(false);+ }}+ onClose={() => setOpen(false)}+ modelRow={props.modelRow}+ emptyMessage={props.emptyMessage}+ searchPlaceholder={props.searchPlaceholder}+ autoFocusSearch+ searchRef={(element) => {+ searchRef = element;+ }}+ >+ {props.children}+ </ModelCatalogMenu>+ );return (<Dropdownopen={open()}onOpenChange={setOpen}placement={props.placement ?? 'top-start'}+ getAnchorRect={props.getAnchorRect}+ gutter={props.gutter ?? 4}><Dropdown.Triggervariant="ghost"@@ -221,24 +254,7 @@ export function ModelCatalogPicker(props: ModelCatalogPickerProps) {focusSearchAfterMenuOpen(() => searchRef);}}>- <ModelCatalogMenu- value={props.value}- options={props.options}- disabled={props.disabled || props.pending}- onSelect={(id) => {- props.onSelect(id);- setOpen(false);- }}- onClose={() => setOpen(false)}- modelRow={props.modelRow}- emptyMessage={props.emptyMessage}- searchPlaceholder={props.searchPlaceholder}- searchRef={(element) => {- searchRef = element;- }}- >- {props.children}- </ModelCatalogMenu>+ {props.menu ? props.menu(catalog()) : catalog()}</Dropdown.Content></Dropdown>);@@ -264,6 +280,8 @@ export function ModelCatalogMenu(*/autoFocusSearch?: boolean;fullCatalog?: boolean;+ suggestedFirst?: boolean;+ searchable?: boolean;onClose?: () => void;}) {@@ -272,7 +290,8 @@ export function ModelCatalogMenu(const [query, setQuery] = createSignal('');const [showAll, setShowAll] = createSignal(false);onMount(() => {- if (props.autoFocusSearch) keepSearchFocused(() => searchEl);+ if (props.autoFocusSearch && props.searchable !== false)+ keepSearchFocused(() => searchEl);});const normalizedQuery = () => query().trim().toLowerCase();const filtered = createMemo(() => {@@ -286,33 +305,35 @@ export function ModelCatalogMenu(return (<>- <div class="sticky top-0 z-10 bg-menu py-1">- <div class="flex h-8 items-center gap-2 px-3">- <MagnifyingGlassIcon- aria-hidden="true"- class="size-4 shrink-0 text-ink-extra-muted"- />- <input- ref={(element) => {- searchEl = element;- props.searchRef?.(element);- }}- aria-label={props.searchPlaceholder ?? 'Search models'}- placeholder={props.searchPlaceholder ?? 'Search models'}- value={query()}- onInput={(event) => setQuery(event.currentTarget.value)}- onMouseDown={(event: MouseEvent) => event.stopPropagation()}- onClick={(event) => event.stopPropagation()}- onKeyDown={(event) => {- if (event.key !== 'Escape') event.stopPropagation();- }}- onKeyUp={(event) => {- if (event.key !== 'Escape') event.stopPropagation();- }}- class="min-w-0 h-full w-full border-0 bg-transparent p-0 text-sm text-ink outline-none placeholder:text-ink-extra-muted"- />+ <Show when={props.searchable !== false}>+ <div class="sticky top-0 z-10 bg-menu py-1">+ <div class="flex h-8 items-center gap-2 px-3">+ <MagnifyingGlassIcon+ aria-hidden="true"+ class="size-4 shrink-0 text-ink-extra-muted"+ />+ <input+ ref={(element) => {+ searchEl = element;+ props.searchRef?.(element);+ }}+ aria-label={props.searchPlaceholder ?? 'Search models'}+ placeholder={props.searchPlaceholder ?? 'Search models'}+ value={query()}+ onInput={(event) => setQuery(event.currentTarget.value)}+ onMouseDown={(event: MouseEvent) => event.stopPropagation()}+ onClick={(event) => event.stopPropagation()}+ onKeyDown={(event) => {+ if (event.key !== 'Escape') event.stopPropagation();+ }}+ onKeyUp={(event) => {+ if (event.key !== 'Escape') event.stopPropagation();+ }}+ class="min-w-0 h-full w-full border-0 bg-transparent p-0 text-sm text-ink outline-none placeholder:text-ink-extra-muted"+ />+ </div></div>- </div>+ </Show>{props.children}<Show when={props.options.length === 0}>@@ -326,13 +347,14 @@ export function ModelCatalogMenu(<div class="space-y-1"><Showwhen={- !props.fullCatalog &&+ (!props.fullCatalog || props.suggestedFirst) &&!showAll() &&catalog().frontier.length > 0}><ModelListlabel="Suggested"+ hideLabel={props.suggestedFirst}options={catalog().frontier}value={props.value}disabled={props.disabled}diff --git a/apps/web/src/lib/core/component/AI/component/input/ModelEffortMenu.test.tsx b/apps/web/src/lib/core/component/AI/component/input/ModelEffortMenu.test.tsxnew file mode 100644index 0000000000..de07a4c256--- /dev/null+++ b/apps/web/src/lib/core/component/AI/component/input/ModelEffortMenu.test.tsx@@ -0,0 +1,219 @@+/** @vitest-environment jsdom */+import {+ cleanup,+ fireEvent,+ render,+ screen,+ waitFor,+} from '@solidjs/testing-library';+import { Dropdown } from '@ui';+import { createSignal } from 'solid-js';+import { afterEach, beforeEach, expect, it, vi } from 'vitest';+import { type ModelEffortConfig, ModelEffortMenu } from './ModelEffortMenu';++const config: ModelEffortConfig = {+ id: 'runtime-effort',+ name: 'Power',+ category: 'thought_level',+ type: 'select',+ description: null,+ currentValue: 'low',+ options: [+ { name: 'Low', value: 'low', group: null, description: null },+ { name: 'High', value: 'high', group: null, description: null },+ { name: 'Max', value: 'max', group: null, description: null },+ ],+};+beforeEach(() => {+ vi.stubGlobal(+ 'ResizeObserver',+ class {+ observe() {}+ unobserve() {}+ disconnect() {}+ }+ );+ vi.stubGlobal('scrollTo', vi.fn());+});+afterEach(() => {+ cleanup();+ vi.unstubAllGlobals();+});++function setup(disabled = false, effortConfig = config) {+ const change = vi.fn();+ const [value, setValue] = createSignal(effortConfig.currentValue);+ render(() => (+ <>+ <style>+ {'[role="menu"] { animation-name: none; transition-duration: 0s; }'}+ </style>+ <Dropdown>+ <Dropdown.Trigger>Model settings</Dropdown.Trigger>+ <Dropdown.Content>+ <ModelEffortMenu+ model="gpt-5"+ label="GPT-5"+ config={effortConfig}+ value={value()}+ disabled={disabled}+ onChange={(next) => {+ change(next);+ setValue(next);+ }}+ >+ <Dropdown.Item onSelect={() => change('other-model')}>+ Other model+ </Dropdown.Item>+ </ModelEffortMenu>+ </Dropdown.Content>+ </Dropdown>+ </>+ ));+ fireEvent.keyDown(screen.getByRole('button', { name: 'Model settings' }), {+ key: 'Enter',+ });+ return change;+}++it('adjusts named effort stops with the keyboard without dismissing the menu', async () => {+ const change = setup();+ const slider = await screen.findByRole('slider', {+ name: 'Reasoning effort',+ });+ slider.focus();+ expect(slider.getAttribute('aria-valuetext')).toBe('Low');+ fireEvent.keyDown(slider, { key: 'ArrowRight' });+ expect(change).toHaveBeenLastCalledWith('high');+ expect(slider.getAttribute('aria-valuetext')).toBe('High');+ expect(screen.getByRole('menu')).toBeTruthy();+ fireEvent.keyDown(slider, { key: 'ArrowRight' });+ expect(change).toHaveBeenLastCalledWith('max');+ fireEvent.keyDown(slider, { key: 'ArrowRight' });+ expect(change).toHaveBeenLastCalledWith('max');+ fireEvent.keyDown(slider, { key: 'ArrowLeft' });+ fireEvent.keyDown(slider, { key: 'ArrowLeft' });+ expect(change).toHaveBeenLastCalledWith('low');+});++it('tracks a captured thumb drag immediately and commits only on release', () => {+ const change = setup();+ const slider = screen.getByRole('slider', { name: 'Reasoning effort' });+ const track = slider.parentElement!;+ vi.spyOn(track, 'getBoundingClientRect').mockReturnValue(+ new DOMRect(0, 0, 200, 24)+ );+ let captured = false;+ slider.setPointerCapture = () => {+ captured = true;+ };+ slider.hasPointerCapture = () => captured;+ slider.releasePointerCapture = () => {+ captured = false;+ };+ fireEvent(+ slider,+ Object.assign(+ new MouseEvent('pointerdown', { bubbles: true, clientX: 0 }),+ {+ pointerId: 1,+ pointerType: 'mouse',+ }+ )+ );+ fireEvent(+ slider,+ Object.assign(+ new MouseEvent('pointermove', { bubbles: true, clientX: 100 }),+ {+ pointerId: 1,+ pointerType: 'mouse',+ }+ )+ );+ expect(slider.getAttribute('aria-valuetext')).toBe('High');+ expect(slider.closest('[data-scrubbing]')).not.toBeNull();+ expect(change).not.toHaveBeenCalled();+ fireEvent(+ slider,+ Object.assign(+ new MouseEvent('pointerup', { bubbles: true, clientX: 100 }),+ {+ pointerId: 1,+ pointerType: 'mouse',+ }+ )+ );+ expect(change).toHaveBeenCalledExactlyOnceWith('high');+ expect(slider.closest('[data-scrubbing]')).toBeNull();+ expect(screen.getByRole('menu')).toBeTruthy();+});++it('opens the catalog, returns to effort, and dismisses with Escape', async () => {+ setup();+ fireEvent.keyDown(screen.getByRole('menuitem', { name: 'Choose model' }), {+ key: 'Enter',+ });+ expect(screen.getByRole('menuitem', { name: 'Other model' })).toBeTruthy();+ expect(screen.queryByRole('slider', { name: 'Reasoning effort' })).toBeNull();+ fireEvent.keyDown(+ screen.getByRole('menuitem', { name: 'Model and effort' }),+ { key: 'Enter' }+ );+ const slider = screen.getByRole('slider', { name: 'Reasoning effort' });+ await waitFor(() =>+ expect(document.activeElement).toBe(+ screen.getByRole('menuitem', { name: 'Choose model' })+ )+ );+ fireEvent.keyDown(slider, { key: 'Escape' });+ await waitFor(() => expect(screen.queryByRole('menu')).toBeNull());+});++it('does not change a disabled effort control', () => {+ const change = setup(true);+ fireEvent.keyDown(screen.getByRole('slider', { name: 'Reasoning effort' }), {+ key: 'ArrowRight',+ });+ expect(change).not.toHaveBeenCalled();+});++it('preserves the inherited default until a specific effort is selected', () => {+ const change = setup(false, {+ ...config,+ id: 'reasoning_effort',+ currentValue: 'default',+ options: [+ { name: 'Default', value: 'default', group: null, description: null },+ config.options[0],+ { name: 'Medium', value: 'medium', group: null, description: null },+ config.options[1],+ ],+ });+ const slider = screen.getByRole('slider', { name: 'Reasoning effort' });+ expect(slider.getAttribute('aria-valuetext')).toBe('Default');+ slider.focus();+ fireEvent.keyDown(slider, { key: 'ArrowRight' });+ expect(change).toHaveBeenLastCalledWith('low');+ expect(slider.getAttribute('aria-valuetext')).toBe('Low');+ fireEvent.keyDown(slider, { key: 'ArrowRight' });+ expect(change).toHaveBeenLastCalledWith('medium');+});++it('shows the catalog directly for a model with no effort configuration', () => {+ render(() => (+ <Dropdown>+ <Dropdown.Trigger>Model settings</Dropdown.Trigger>+ <Dropdown.Content>+ <ModelEffortMenu label="Basic model">+ <Dropdown.Item>Basic model</Dropdown.Item>+ </ModelEffortMenu>+ </Dropdown.Content>+ </Dropdown>+ ));+ fireEvent.keyDown(screen.getByRole('button', { name: 'Model settings' }), {+ key: 'Enter',+ });+ expect(screen.getByRole('menuitem', { name: 'Basic model' })).toBeTruthy();+ expect(screen.queryByRole('slider')).toBeNull();+});diff --git a/apps/web/src/lib/core/component/AI/component/input/ModelEffortMenu.tsx b/apps/web/src/lib/core/component/AI/component/input/ModelEffortMenu.tsxnew file mode 100644index 0000000000..c3cfa521bd--- /dev/null+++ b/apps/web/src/lib/core/component/AI/component/input/ModelEffortMenu.tsx@@ -0,0 +1,196 @@+import CaretLeft from '@phosphor/caret-left.svg';+import CaretRight from '@phosphor/caret-right.svg';+import type { SessionConfigOption } from '@service-agent-fold/generated/types';+import { Dropdown, Slider } from '@ui';+import { createSignal, For, type JSX, Show } from 'solid-js';+import { ModelIcon } from '../ProviderIcon';++export type ModelEffortConfig = Extract<+ SessionConfigOption,+ { type: 'select' }+>;++/** A compact model overview; browsing retains the complete model/agent catalog. */+export function ModelEffortMenu(props: {+ model?: string | null;+ label: string;+ config?: ModelEffortConfig;+ value?: string;+ disabled?: boolean;+ onChange?: (value: string) => void;+ effortOnly?: boolean;+ children?: JSX.Element;+}) {+ const [browsing, setBrowsing] = createSignal(false);+ let overview: HTMLElement | undefined;+ const choices = () => props.config?.options ?? [];+ const available = () => choices().length > 1 && !!props.onChange;+ const [dragIndex, setDragIndex] = createSignal<number>();+ const [dragging, setDragging] = createSignal(false);+ const [scrubbing, setScrubbing] = createSignal(false);+ const value = () => props.value ?? props.config?.currentValue;+ const index = () =>+ dragIndex() ??+ Math.max(+ 0,+ choices().findIndex((choice) => choice.value === value())+ );+ const label = () => choices()[index()]?.name;+ const commit = (next: number) => {+ const choice = choices()[next];+ if (choice && !props.disabled) props.onChange?.(choice.value);+ };++ return (+ <Show+ when={available() && (!browsing() || props.effortOnly)}+ fallback={+ <>+ <Show when={available()}>+ <Dropdown.Item+ closeOnSelect={false}+ onSelect={() => {+ setBrowsing(false);+ queueMicrotask(() => overview?.focus());+ }}+ >+ <CaretLeft class="size-4" />+ Model and effort+ </Dropdown.Item>+ </Show>+ {props.children}+ </>+ }+ >+ <div class="px-3 pb-3 pt-1">+ <Show+ when={!props.effortOnly}+ fallback={+ <div class="mb-2 flex h-9 items-center justify-between gap-2 text-sm">+ <span class="text-ink-muted">Reasoning effort</span>+ <span class="font-medium">{label()}</span>+ </div>+ }+ >+ <Dropdown.Item+ ref={overview}+ closeOnSelect={false}+ aria-label="Choose model"+ class="mb-2 h-9 gap-2 rounded-xl px-0 hover:bg-transparent"+ onSelect={() => setBrowsing(true)}+ >+ <ModelIcon+ model={props.model}+ class="size-4 shrink-0 text-ink-muted"+ />+ <span class="flex min-w-0 flex-1 items-center justify-center gap-1">+ <span class="truncate text-base font-medium">{props.label}</span>+ <span class="shrink-0 text-base font-normal text-ink-muted">+ {label()}+ </span>+ <CaretRight class="size-3 shrink-0 text-ink-muted" />+ </span>+ </Dropdown.Item>+ </Show>+ <Slider+ class="group/effort px-3.5"+ data-dragging={dragging() || undefined}+ data-scrubbing={scrubbing() || undefined}+ onPointerMove={() => {+ if (dragging()) setScrubbing(true);+ }}+ aria-label="Reasoning effort"+ minValue={0}+ maxValue={Math.max(1, choices().length - 1)}+ step={1}+ value={[index()]}+ getValueLabel={() => label() ?? ''}+ disabled={props.disabled}+ onChange={([next]) => {+ if (dragging()) setDragIndex(next);+ else commit(next);+ }}+ onChangeEnd={([next]) => {+ if (!dragging()) return;+ setDragging(false);+ setScrubbing(false);+ commit(next);+ setDragIndex(undefined);+ }}+ onKeyDown={(event: KeyboardEvent) => {+ // Arrow keys belong to the slider, not the menu's roving focus.+ if (+ [+ 'ArrowLeft',+ 'ArrowRight',+ 'ArrowUp',+ 'ArrowDown',+ 'Home',+ 'End',+ ].includes(event.key)+ )+ event.stopPropagation();+ }}+ >+ <Slider.Track+ class="my-0 h-6 bg-transparent"+ onPointerDown={() => {+ setDragging(true);+ }}+ onPointerCancel={() => {+ setDragging(false);+ setScrubbing(false);+ setDragIndex(undefined);+ }}+ >+ <div+ aria-hidden="true"+ class="pointer-events-none absolute -inset-x-3.5 inset-y-0 rounded-full bg-ink/10 shadow-[inset_0_0_0_0.5px_color-mix(in_srgb,var(--color-ink)_10%,transparent)]"+ />+ <Slider.Fill+ class="bg-blue transition-[left,right] duration-300 ease-[cubic-bezier(0.2,1.3,0.35,1)] group-data-[scrubbing]/effort:transition-none motion-reduce:transition-none"+ style={{+ left: '-14px',+ display: index() === 0 ? 'none' : undefined,+ }}+ />+ <div+ aria-hidden="true"+ class="pointer-events-none absolute inset-x-0 inset-y-0 flex items-center justify-between"+ >+ <For each={choices()}>+ {(_, i) => (+ <span+ class="size-1 rounded-full"+ classList={{+ 'bg-panel/40': i() <= index(),+ 'bg-ink-muted/50': i() > index(),+ }}+ />+ )}+ </For>+ </div>+ <Slider.Thumb+ onPointerMove={() => {+ if (dragging()) setScrubbing(true);+ }}+ onPointerDown={() => {+ setDragging(true);+ }}+ onPointerCancel={() => {+ setDragging(false);+ setScrubbing(false);+ setDragIndex(undefined);+ }}+ aria-label="Reasoning effort"+ aria-valuetext={label()}+ class="size-7 cursor-grab group-data-[dragging]/effort:cursor-grabbing data-[disabled]:cursor-default border-ink/15 bg-composer-action shadow-[0_0_2px_0_color-mix(in_srgb,var(--color-ink)_10%,transparent)] light-mode:bg-panel focus-visible:ring-blue focus-visible:ring-offset-0 transition-[left,right,scale] duration-300 ease-[cubic-bezier(0.2,1.3,0.35,1)] group-data-[scrubbing]/effort:transition-[scale] motion-safe:group-data-[dragging]/effort:scale-105 motion-reduce:transition-none"+ >+ <Slider.Input />+ </Slider.Thumb>+ </Slider.Track>+ </Slider>+ </div>+ </Show>+ );+}diff --git a/apps/web/src/lib/core/component/ComposerGreeting.tsx b/apps/web/src/lib/core/component/ComposerGreeting.tsxnew file mode 100644index 0000000000..aef5e7ba5c--- /dev/null+++ b/apps/web/src/lib/core/component/ComposerGreeting.tsx@@ -0,0 +1,30 @@+import MacroIcon from '@icon/macro-logo.svg';+import MacroWireframeIcon from '@icon/macro-logo-wireframe.svg';+import type { JSX } from 'solid-js';+import { Dynamic } from 'solid-js/web';++/** The shared brand treatment for empty conversation greetings. */+export function ComposerGreeting(props: {+ as?: 'h1' | 'h2';+ wireframe?: boolean;+ children: JSX.Element;+}) {+ return (+ <Dynamic+ component={props.as ?? 'h2'}+ class="m-0 flex items-center justify-center gap-3 font-[Roboto_Slab_Variable] text-[28px] font-[315] light-mode:font-[390] leading-[1.2] tracking-[-0.025em] text-ink light-mode:text-ink/80"+ >+ <span class="grid size-9 shrink-0" aria-hidden="true">+ <MacroIcon+ data-active={!props.wireframe}+ class="greeting-mark col-start-1 row-start-1 size-9 overflow-visible opacity-0 scale-95 transition-[opacity,scale] duration-300 ease-[cubic-bezier(0.22,1,0.36,1)] data-[active=true]:opacity-100 data-[active=true]:scale-100 motion-reduce:transition-none"+ />+ <MacroWireframeIcon+ data-active={!!props.wireframe}+ class="greeting-mark col-start-1 row-start-1 size-9 overflow-visible opacity-0 scale-95 transition-[opacity,scale] duration-300 ease-[cubic-bezier(0.22,1,0.36,1)] data-[active=true]:opacity-100 data-[active=true]:scale-100 motion-reduce:transition-none"+ />+ </span>+ <span class="min-w-0 text-balance">{props.children}</span>+ </Dynamic>+ );+}diff --git a/apps/web/src/lib/core/component/LexicalMarkdown/plugins/agent-commands/agentCommandsPlugin.ts b/apps/web/src/lib/core/component/LexicalMarkdown/plugins/agent-commands/agentCommandsPlugin.tsindex 7c07e1b0c4..2c7f9da588 100644--- a/apps/web/src/lib/core/component/LexicalMarkdown/plugins/agent-commands/agentCommandsPlugin.ts+++ b/apps/web/src/lib/core/component/LexicalMarkdown/plugins/agent-commands/agentCommandsPlugin.ts@@ -40,9 +40,8 @@ export type AgentCommandItem = {inputHint: string | null;};-const TYPE_AGENT_COMMAND_SYMBOL_COMMAND: LexicalCommand<void> = createCommand(- 'AGENT_COMMAND_SYMBOL_COMMAND'-);+export const TYPE_AGENT_COMMAND_SYMBOL_COMMAND: LexicalCommand<void> =+ createCommand('AGENT_COMMAND_SYMBOL_COMMAND');export const CLOSE_AGENT_COMMAND_SEARCH_COMMAND: LexicalCommand<void> =createCommand('CLOSE_AGENT_COMMAND_SEARCH_COMMAND');diff --git a/apps/web/src/lib/core/component/LexicalMarkdown/plugins/skills/skillsPlugin.ts b/apps/web/src/lib/core/component/LexicalMarkdown/plugins/skills/skillsPlugin.tsindex c8b578309c..490b3f4173 100644--- a/apps/web/src/lib/core/component/LexicalMarkdown/plugins/skills/skillsPlugin.ts+++ b/apps/web/src/lib/core/component/LexicalMarkdown/plugins/skills/skillsPlugin.ts@@ -24,7 +24,7 @@ import {import type { MenuOperations } from '../../shared/inlineMenu';import { registerInlineMenuTrigger } from '../../shared/registerInlineMenuTrigger';-const TYPE_SKILL_SYMBOL_COMMAND: LexicalCommand<void> = createCommand(+export const TYPE_SKILL_SYMBOL_COMMAND: LexicalCommand<void> = createCommand('SKILL_SYMBOL_COMMAND');diff --git a/apps/web/src/lib/core/util/composerMenuAnchor.test.ts b/apps/web/src/lib/core/util/composerMenuAnchor.test.tsnew file mode 100644index 0000000000..2fa1a189b2--- /dev/null+++ b/apps/web/src/lib/core/util/composerMenuAnchor.test.ts@@ -0,0 +1,25 @@+/** @vitest-environment jsdom */+import { afterEach, expect, it, vi } from 'vitest';+import { composerMenuAnchorRect } from './composerMenuAnchor';++afterEach(() => {+ document.body.replaceChildren();+});++it('anchors to the Add button in the same composer', () => {+ document.body.innerHTML = `<div data-agent-composer><button data-composer-menu-anchor></button></div><div data-agent-composer><button data-composer-menu-anchor></button><button id="model"></button></div>`;+ const add = document.querySelectorAll<HTMLElement>(+ '[data-composer-menu-anchor]'+ )[1];+ const rect = new DOMRect(40, 100, 36, 36);+ vi.spyOn(add, 'getBoundingClientRect').mockReturnValue(rect);+ expect(composerMenuAnchorRect(document.getElementById('model')!)).toBe(rect);+});++it('uses the trigger when rendered outside a composer', () => {+ const trigger = document.createElement('button');+ const rect = new DOMRect(200, 50, 100, 36);+ vi.spyOn(trigger, 'getBoundingClientRect').mockReturnValue(rect);+ expect(composerMenuAnchorRect(trigger)).toBe(rect);+ expect(composerMenuAnchorRect()).toBeUndefined();+});diff --git a/apps/web/src/lib/core/util/composerMenuAnchor.ts b/apps/web/src/lib/core/util/composerMenuAnchor.tsnew file mode 100644index 0000000000..245133ea08--- /dev/null+++ b/apps/web/src/lib/core/util/composerMenuAnchor.ts@@ -0,0 +1,7 @@+/** Align composer menus with the Add button, regardless of their trigger. */+export function composerMenuAnchorRect(trigger?: HTMLElement) {+ const anchor = trigger+ ?.closest('[data-agent-composer]')+ ?.querySelector<HTMLElement>('[data-composer-menu-anchor]');+ return (anchor ?? trigger)?.getBoundingClientRect();+}diff --git a/docs/agent-guide/ai-chat.md b/docs/agent-guide/ai-chat.mdindex 794e75b89e..01a186d488 100644--- a/docs/agent-guide/ai-chat.md+++ b/docs/agent-guide/ai-chat.md@@ -353,8 +353,37 @@ the shimmer.Right-click (or long-press on mobile) opens the same entity menu as Home:Rename, Favorite, Copy link, Share, Archive, Delete, and the other sessionactions. Archived sessions are grouped at the bottom under **Archived**.+- The agent composer's **+ (Add)** menu offers **Add photos & files**,+ **Add from library** (`@` references), and **Use a skill** (`/`; sessions show+ **Skills & commands**). Desktop uses a scrollable menu; phones use a bottom+ sheet with the same actions. Selecting a reference or skill restores editor+ focus before opening its picker and preserves the existing draft.+ Connected apps open their own connection settings, without inserting a prompt.+ **Add connections** opens Discover; **Manage connections** opens Connected.+ Disabled connections remain available to manage. A partial loading failure+ offers Retry without hiding uploads, references, or skills.+- Empty conversation greetings use Roboto Slab with the Macro mark to the left,+ at weight 390 with softened ink in light mode and 315 in dark mode, including the Chat and Code+ starting headings, legacy Home, and the conversation preview empty state.+ Code uses the wireframe blocks from the loading mark; Chat uses the filled mark.+ The marks crossfade and scale over 300ms on mode changes while the incoming+ mark's three blocks lift and settle in a staggered wave.+- The desktop input uses 28px corners with an 18px horizontal text inset and+ 16px top padding when expanded. Light mode uses a faint shadow outline and+ layered outer shadow; dark mode retains the production glass rim and shadow.+ Both modes retain the production composer background.+- In dark mode, the footer is darker than the input, with successively lighter+ toggle track and selected segment.- The starting page has **Chat / Code** in the composer’s inset bar, below the input on- desktop and above it on phones. The choice limits the offered agents and is+ desktop and above it on phones. On desktop, the borderless footer is inset 12px+ from the 28px-radius input; Chat / Code share one track with equal 8px insets+ in the 52px footer. The dark track is lighter than the footer lip and the selected segment lighter again;+ a faint gradient gives the dark toggle depth without borders or shadows.+ Light mode uses an off-white selected segment with a subtle border and shadow.+ The selected segment glides for 250ms with+ an ease-out curve. The greeting text flips vertically into place on each mode change+ with the same duration; both animations respect reduced motion.+ Its bottom corners follow the toggle's curve. The choice limits the offered agents and isremembered per user. Switching modes preserves the draft and attachments andclears model and effort overrides from the previous mode. It does not filterthe conversation sidebar. Session composers start at one line and grow with@@ -370,14 +399,15 @@ the shimmer.keeps the saved model name visible in its picker, including unavailable models.- The agent dropdown includes saved agents of the selected mode regardless ofruntime, plus Cursor in Code mode.- Macro's models use the same searchable catalog as running sessions:- **Suggested** lists **Opus 5.5**, **Sonnet 5.5**, **GPT-5.6** (Sol in- runtime catalogs), **GPT-6 Astra**, and **Gemini**, when available, in that order. The- **More models** submenu contains the complete catalog grouped by provider,- including the Suggested choices and effort/speed variants. Your agents- follow Suggested and More models in the root menu. Choosing a model- does not reorder the sections. Search matches names, IDs, and provider names. The compact borderless search- field receives focus when the selector opens or reopens. Its opaque header+ In Chat mode, the desktop picker uses a wide, height-limited layout with+ agents on the left without a redundant Your agents subheading. The models+ column starts with unlabeled suggested choices, followed by the complete+ catalog grouped by provider. There is no search box or More step; each column scrolls independently.+ It shares the Plus menu's width and below-composer anchor. Code mode keeps its+ compact agent dropdown above the selector. Phones retain their single-column+ searchable sheet, Suggested choices, and More models action. Model-specific+ submenus also retain search. Choosing a model does not reorder the sections.+ The separate speedometer controls effort. The catalog's opaque headermeets the top of the scroll area so rows cannot show through above it.**Built-in**, **Your agents**, and **Needs connection** groups follow whenthey have entries. Each agent row shows its runtime and model, or its setup@@ -397,7 +427,7 @@ the shimmer.default for Macro's in-memory agent until another model entry is picked.The built-in Macro agent is the only agent excluded from these sections; its models remain available.Unavailable paired agents stay visible with a reason.- If Macro is unavailable, its catalog stays searchable but+ If Macro is unavailable, its catalog stays visible butmodel choices are disabled in every list. Model discovery uses theselected runtime, including Claude Cloud. Every coding agent shows repositorycontrols; chat agents hide those controls but keep the mode bar. Repository/branch overrides are currently applied@@ -433,11 +463,11 @@ the shimmer.with the repository bar below the input on desktop and above it on mobile.The plus attachment button stays at the far left: before thetext in the compact row, and on the bottom control row when expanded. The editor sits above the controls, with attachments- on the left and the agent/model and Send on the right. On mobile, Chat/Code sits at the top left and repository controls at the top right; repository and branch selection open in standard bottom drawers. These controls sit inside the same continuous surface as the input with no inset or dividing border. On desktop, an inset bar aligned to the full input width holds Chat/Code with rounded outer corners and a subtle border, with a darker surface in dark mode. The settings row keeps a stable height when changing modes: 44 px on desktop, with 2 px more top and side padding on mobile.+ on the left and the agent/model and Send on the right. On mobile, Chat/Code sits at the top left and repository controls at the top right; repository and branch selection open in standard bottom drawers. These controls sit inside the same continuous surface as the input with no inset or dividing border. On desktop, the borderless bar sits 12px inside each input edge and gives the 36px Chat/Code toggle equal 8px insets, with concentric bottom corners and a darker fill. The settings row keeps a stable height when changing modes: 52px on desktop and a 46px minimum on mobile.Selecting Chat hides the repository controls and keeps the mode switch inthe settings row, without remounting the editor or losing the draft. Reduced-motionpreferences disable the animation. The hidden drawer is inert. **Repository**- (**Choose repository** until one is picked) opens a searchable list:+ (**Choose automatically** with a GitHub icon until one is picked) opens a searchable list:**Choose automatically**, then the repositories the signed-in user reachesthrough Macro's GitHub App (`GET /agent-repositories` on the agent harness),recently used ones first. A new conversation always starts on **Choose@@ -480,15 +510,19 @@ the shimmer.provider icons, search, **Suggested** first, and **More models** for thecomplete provider catalog. Desktop opens a submenu; phone widths showthe catalog in place with a Back action. Search includes every model.-- A compact **speedometer-style effort** button with a simple arc and needle beside the model selector opens a simple list of effort levels with a check beside the current choice: a popover centered below the button on desktop, or its own bottom sheet on mobile. Choosing a level applies it and closes the menu. Mobile shows it alongside the model control after the input expands. It is hidden when the model has fewer than two effort choices.+- Desktop keeps the model selector and speedometer as separate controls. The+ speedometer opens a slider with a stop for each advertised effort level. Arrow keys+ adjust the level; pointer drags commit on release. The popover stays open, and+ the model selector opens the full catalog independently. On mobile, the **speedometer-style+ effort** button opens its own sheet after the input expands. Choosing a level+ applies it and closes the sheet. Models with fewer than two effort choices+ omit the effort button.Model-specific effort choices remain available in desktop model submenus.Free and Pro users start new conversations at the lowest advertised level,unless they explicitly choose another. Existing sessions keep their current setting.-- On desktop, chat agents' empty input types tips about connectors, skills,- mentions, and agents one character at a time, pauses to read each hint, then- quickly erases it before typing the next. Entering a draft pauses the animation;- clearing it resumes. The text-only typewriter also runs when reduced motion- is enabled.+- On desktop, chat agents' empty input shows the static hint **Type @ to mention+ docs, people, or channels, / for skills** immediately, without typing or cycling+ through other hints. Clearing a draft restores the same hint.Coding agents show **Describe what you want to build**; phones keep the short**Message Macro AI** placeholder. Type `@` formentions and `/` for skills.@@ -1718,12 +1752,15 @@ There is no periodic PR lookup polling.### Agent reasoning effort-Open the model selector and hover a model to choose its reasoning effort in the-submenu on desktop, opened with Right Arrow. On mobile, tap a model to select it,-then use the adjacent effort button to adjust effort.+On desktop, open the speedometer beside the model selector to adjust the+current model with the **Reasoning effort** slider. The header and accessible value announce the+selected level. Arrow keys move between supported levels; the menu stays open+until dismissed. The model selector opens the full catalog independently; other+models still offer their own effort submenu with Right Arrow. On mobile, tap a model+to select it, then use the adjacent effort button to adjust effort.Cursor and Macro's in-memory agent load the hovered model's own advertised-choices. The selected label includes the effort, such as `Sonnet 5.5 · High`;-the composer also offers a separate effort button for the selected model. Models without effort+choices. The model trigger shows the model name; the speedometer announces the effort.+Models without effortsupport remain selectable through `Use <model>` (or a desktop click/Enter).Default keeps the model's existing behavior.@@ -1961,12 +1998,15 @@ that chat remains usable, and that a non-owner cannot submit. Sending an email ocreating an event is a real action, including from a local app connected to dev.## Agent reasoning effort-Open the model selector and hover a model to choose its reasoning effort in the-submenu on desktop, opened with Right Arrow. On mobile, tap a model to select it,-then use the adjacent effort button to adjust effort.+On desktop, open the speedometer beside the model selector to adjust the+current model with the **Reasoning effort** slider. The header and accessible value announce the+selected level. Arrow keys move between supported levels; the menu stays open+until dismissed. The model selector opens the full catalog independently; other+models still offer their own effort submenu with Right Arrow. On mobile, tap a model+to select it, then use the adjacent effort button to adjust effort.Cursor and Macro's in-memory agent load the hovered model's own advertised-choices. The selected label includes the effort, such as `Sonnet 5 · High`;-the composer also offers a separate effort button for the selected model. Models without effort+choices. The model trigger shows the model name; the speedometer announces the effort.+Models without effortsupport remain selectable through `Use <model>` (or a desktop click/Enter).Default keeps the model's existing behavior.diff --git a/docs/architecture/agent-effort.md b/docs/architecture/agent-effort.mdindex 640b88bd9c..bbb6027b11 100644--- a/docs/architecture/agent-effort.md+++ b/docs/architecture/agent-effort.md@@ -92,14 +92,17 @@ an external harness result.## Model menu interaction-The selected model also has a **speedometer-style effort** button beside its model selector-in new-chat and running-session composers. It opens a compact desktop popover-or a dedicated bottom sheet on mobile. Its needle reflects the selected level. A simple list shows the supported effort levels and checks the current choice. Selecting a level applies it and closes the menu; models with fewer than two choices hide the button.+Desktop new-chat and running-session model selectors open the full model catalog.+The adjacent speedometer opens a discrete **Reasoning effort** slider. Slider+stops come directly from the runtime's advertised choices and retain their opaque+values, including Default when advertised. Arrow keys change one level at a time;+pointer drags commit on release. The menu stays open while its accessible value+updates. Mobile retains the dedicated effort sheet.On desktop, effort remains available in each model’s submenu.Discovery runs when the submenu opens, scoped to that model and harness;the current session's advertised options take precedence for its selected model.-The trigger displays the model and selected effort together. Keyboard Right Arrow+The model trigger displays the model; the adjacent speedometer shows effort. Keyboard Right Arrowopens the submenu. On mobile, tapping a model selects it directly; use the adjacenteffort button to adjust its supported effort levels. Loading, discovery errors, and models withno effort options keep ordinary model selection available.