diff --git a/web/README.md b/web/README.md index 233948ec..fbe442a8 100644 --- a/web/README.md +++ b/web/README.md @@ -78,6 +78,7 @@ The Hub persists and enforces the lock across clients, restarts, and resume. - Message thread with infinite scroll. - Concise view (header toggle or `/settings/chat`, per device): shows only user input and each round's final reply (`src/chat/conciseView.ts`). Permission requests, questions, plan proposals, user shell commands, and errors stay visible; the full thread returns while a search target is active. - Composer for sending messages. +- A collapsible **Awaiting your reply** section above the composer collects all live non-blocking `request_user_input` questions, including those outside the loaded transcript. Answer there or dismiss individual questions without sending an answer or stopping the agent. Collapsing preserves drafts; blocking permissions retain their existing controls. - Permission mode and model selection for supported agents. Cursor Auto uses CLI Auto for new/resumed sessions configured with Auto. Switching a live session to Auto when ACP does not advertise a literal Auto option relaunches the Cursor ACP process in place under `--model auto` while preserving the hub session id. - Session abort and handoff controls. diff --git a/web/e2e-fixtures/async-questions-fixture.html b/web/e2e-fixtures/async-questions-fixture.html new file mode 100644 index 00000000..392c4b6e --- /dev/null +++ b/web/e2e-fixtures/async-questions-fixture.html @@ -0,0 +1,2 @@ + +HAPI async questions preview
diff --git a/web/e2e-fixtures/async-questions-fixture.tsx b/web/e2e-fixtures/async-questions-fixture.tsx new file mode 100644 index 00000000..e60d2573 --- /dev/null +++ b/web/e2e-fixtures/async-questions-fixture.tsx @@ -0,0 +1,40 @@ +// Isolated manual preview; all requests are fake and no hub is contacted. +import { useState } from 'react' +import { createRoot } from 'react-dom/client' +import '../src/index.css' +import { I18nProvider } from '../src/lib/i18n-context' +import { AsyncQuestionsPanel } from '../src/components/AssistantChat/AsyncQuestionsPanel' +import type { ApiClient } from '../src/api/client' +import type { AgentState } from '../src/types/api' + +function Preview() { + const [requests, setRequests] = useState({ + style: { tool: 'request_user_input', createdAt: 1, arguments: { isBlocking: false, questions: [{ + id: 'style', question: 'Which visual style do you prefer?', isOther: true, + options: [{ label: 'Warm and natural' }, { label: 'Cool and minimal' }] + }] } }, + details: { tool: 'request_user_input', createdAt: 2, arguments: { isBlocking: false, questions: [{ + id: 'details', question: 'Any other details you would like to add?', options: [] + }] } } + }) + const [lastAction, setLastAction] = useState('The agent is still working while these optional questions wait.') + const complete = (id: string, action: string) => { + setRequests((current) => Object.fromEntries(Object.entries(current ?? {}).filter(([key]) => key !== id))) + setLastAction(`${action}: ${id}`) + } + const api = { + approvePermission: async (_session: string, id: string) => complete(id, 'Answered'), + denyPermission: async (_session: string, id: string) => complete(id, 'Dismissed without an answer') + } as unknown as ApiClient + return
+
HAPI · Optional questions preview
+
+

Please prepare the project. You can keep working while I choose the details.

+

I have started the work. Your outstanding questions are available above the message box, even after a long conversation.

+

{lastAction}

+
+
{}} />
+