Skip to content

feat(ai-partner): continue-in-tab handoff from peek (#1464)#1500

Merged
CraigBuckmaster merged 1 commit into
masterfrom
claude/issue-1464-continue-in-tab-handoff
Apr 17, 2026
Merged

feat(ai-partner): continue-in-tab handoff from peek (#1464)#1500
CraigBuckmaster merged 1 commit into
masterfrom
claude/issue-1464-continue-in-tab-handoff

Conversation

@CraigBuckmaster
Copy link
Copy Markdown
Owner

Summary

Resolves phase 3, card #1464 of epic #1446. Completes the FAB-peek → Amicus tab story arc.

  • New promotePeekToThread service generates a word-boundary-truncated title from the first user message, creates the thread row in amicus_threads, replays each peek message into amicus_messages (citations + follow_ups serialized), and navigates via parent.navigate('AmicusTab', { screen: 'Thread' }).
  • AmicusPeekSheet wires the CTA to the service, tracks handoffInProgress to prevent double-taps, and surfaces "Couldn't save conversation — try again" on DB failure. On failure the peek stays open so the user can retry — nothing is lost.
  • PeekMiniConversation accepts an optional handoffError string so handoff failures render cleanly without overloading the streaming-error code set.

Title generation cases:

  • < 10 chars → "New Amicus conversation" fallback
  • ≤ 50 chars → raw text
  • > 50 chars → truncated at a word boundary with trailing (hard-cut if no usable boundary)

Acceptance criteria

  • CTA appears at turn 3 (inherited from ai-partner: mini-conversation component (inside peek) #1463)
  • Tap creates thread with generated title, writes all messages
  • Navigation lands on AmicusTab/Thread with the new threadId
  • Peek closes after navigation
  • Underlying screen state preserved (standard peek-dismissal)
  • Double-tap prevented; CTA shows "Saving…" during save
  • DB failure → banner + peek stays open; messages preserved
  • Unit tests: title generation (5 cases), happy path, DB failure, missing parent nav, peek-integration (CTA/error/double-tap)
  • No any types; lint clean

Test plan

  • npx jest src/services/amicus/__tests__/promotePeekToThread.test.ts — 9 passing
  • npx jest src/components/amicus/__tests__/AmicusPeekSheet.test.tsx — 8 passing (3 new peek-integration tests)
  • Full suite: 3391 passing
  • Coverage thresholds met: 80.53 / 67.47 / 73.06 / 82.31 (vs required 80 / 65 / 72 / 82)
  • npx tsc --noEmit clean for all Amicus files
  • npx eslint clean (0 errors, 0 warnings) on changed files

https://claude.ai/code/session_01Pht3kzgdvkn81DDfL9SnFe

Promotes an ephemeral peek conversation into a persistent Amicus
thread when the user taps "Continue in Amicus tab →".

- `promotePeekToThread` service: generates a word-boundary-truncated
  title from the first user message, creates the thread row, replays
  each peek message into `amicus_messages` (with citations +
  follow_ups serialized), and navigates via
  `getParent().navigate('AmicusTab', { screen: 'Thread' })`.
- `AmicusPeekSheet` wires the CTA to the service, tracks
  `handoffInProgress` to prevent double-taps, and surfaces a
  "Couldn't save conversation — try again" banner on DB failure
  (peek stays open so the user can retry; messages preserved).
- `PeekMiniConversation` now accepts a `handoffError` string so
  handoff failures render a clear message without reusing the
  streaming-error code set.

Acceptance criteria covered:
- CTA appears at turn 3, writes thread + all messages, navigates to
  AmicusTab/Thread
- Peek closes after navigation; underlying screen state preserved
- Double-tap rejected; CTA shows "Saving…" during save
- DB failure → error banner; peek stays open

https://claude.ai/code/session_01Pht3kzgdvkn81DDfL9SnFe
@github-actions
Copy link
Copy Markdown

Test Results

✅ All tests passed

Passed Failed Total
Tests ✅ 3391 ❌ 0 3391
Suites ✅ 461 ❌ 0 461

Coverage

Statements Branches Functions Lines

⏱️ Duration: 80.9s

@CraigBuckmaster CraigBuckmaster merged commit 11488ab into master Apr 17, 2026
6 checks passed
@CraigBuckmaster CraigBuckmaster deleted the claude/issue-1464-continue-in-tab-handoff branch April 17, 2026 17:59
CraigBuckmaster added a commit that referenced this pull request Apr 17, 2026
…rash-I3NJC

revert: back out #1500 to unblock TestFlight launch (P0)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants