flesh out the Claude prompt UX: options, stepper, collapse

Builds on the in-composer prompt surface (D-78):

- Permission prompts (T-175): Allow / Allow-and-don't-ask-again / Deny.
  "Don't ask again" appears only when the request carries a
  permission_suggestion and echoes it back as updatedPermissions. An
  optional note rides Deny as the message, or Allow as a follow-up user
  message (the protocol has no allow-with-message).
- AskUserQuestion picker (T-176): a single question renders bare; 2-4
  questions step one at a time (nav shows "N · Header", ✓ when answered)
  then a review/confirm screen. Each question offers an "Other" free-text
  choice and a per-choice note; multi-select joins labels. A "chat
  instead" escape denies the prompt so the user can type freely. On
  submit the answer is echoed into the log, since the card is ephemeral.
- Collapsed tool cards (T-177): multi-line tool_use / tool_result start
  collapsed behind a one-line summary; one-line output renders inline.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-05-25 09:30:50 +02:00
co-authored by Claude Opus 4.7
parent fbf5a720a8
commit de264e7141
8 changed files with 324 additions and 16 deletions
@@ -170,6 +170,24 @@ void main() {
expect(find.text('error'), findsOneWidget);
});
testWidgets('a one-line tool result renders inline (no collapse caret)', (tester) async {
await pumpWith(tester, [_result('hello-from-spike')]);
expect(find.text('hello-from-spike'), findsOneWidget);
expect(find.byType(ClideIcon), findsNothing); // not collapsible → no caret
});
testWidgets('a multi-line tool result starts collapsed with a first-line summary', (tester) async {
await pumpWith(tester, [_result('first line\nsecond line\nthird line')]);
// Collapsed: caret present, summary (first line) shown, full body hidden.
expect(find.byType(ClideIcon), findsOneWidget);
expect(find.text('first line'), findsOneWidget);
expect(find.text('first line\nsecond line\nthird line'), findsNothing);
await tester.tap(find.byType(ClideIcon));
await tester.pump();
expect(find.text('first line\nsecond line\nthird line'), findsOneWidget);
});
testWidgets('select-all + copy spans multiple cards', (tester) async {
final clipboard = _MockClipboard();
TestDefaultBinaryMessengerBinding.instance.defaultBinaryMessenger.setMockMethodCallHandler(SystemChannels.platform, clipboard.handleMethodCall);