feat(sampling): replace InlineSamplingRequest responseText with draftResult#1250
Conversation
…Result (#1239) Closes the Phase 5 audit partial: the inline card's prop interface now matches SamplingRequestPanel's, accepting an optional CreateMessageResult draft instead of a flat scalar. Lets future hook-layer wiring share a single draft store between the inline card and the full panel. Rendering: - No draft → existing layout (request preview, model hints, action buttons), with the readonly placeholder textarea removed. - Text draft → 2-line preview of draftResult.content.text (lineClamp 2). - Image / audio draft → "[Image content]" / "[Audio content]" label, matching the ContentViewer fallback convention. Updates the three consumer stories that threaded responseText="" through (PendingClientRequests, ToolsScreen) — no callback signatures changed. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
|
@claude review |
|
Claude finished @cliffhall's task in 1m 54s —— View job PR Review:
|
|
Thanks for the review. Walking through the four points:
"Draft:" label — agreed it would help disambiguate when both previews are populated. Punting to the parent-wiring PRs (#1243 / #1244) as you suggest, since the label only matters once a real draft store can produce content. Story fixture model ID ( Filed #1251 as a follow-up: the test plan reference to No code changes in this PR; ready to merge if you're happy. |
* docs(agents): require version label on new issues and PRs (#1256) Recent v2 PRs (#1247, #1249, #1250, #1252, #1255) all landed without a v2 label, making version-filtered queries unreliable. Codify the expectation directly in the issue-driven workflow: each branch / board gets a fixed label, and the label is set at create time via the gh create flag rather than backfilled. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> * Also fix stale "PR against main" line The PR-target line still said "Open a PR against main", which is correct only for v1 work. Mirror the version-label mapping above so the PR base matches the board. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Closes #1239.
Summary
InlineSamplingRequestnow takesdraftResult?: CreateMessageResultinstead ofresponseText: string, matchingSamplingRequestPanel's prop shape so a future shared-draft store can feed both views.Textarea. The card renders request preview + model hints + action buttons, identical to before minus the empty textarea slot. Buttons (onAutoRespond,onEditAndSend,onReject,onViewDetails) — and their callback shapes — are unchanged.draftResult.content.textvia Mantine'slineClamp.[Image content]/[Audio content]label, matching theContentViewerfallback convention.PrefilledResponsewithWithTextDraftand addedWithNonTextDraftcovering the image branch. ExistingDefault,WithModelHints,InQueuestories now exercise the no-draft state. Updated the three consumer stories (PendingClientRequests× 2,ToolsScreen) that threadedresponseText=""through.Open design question (deferred)
The audit asked whether the inline preview should mirror the panel's live draft (shared state) or stay a static snapshot. That's a parent-wiring concern — this PR only changes the prop shape. The component is read-only from this layer's perspective; whoever wires the pending-request store in #1243 / #1244 picks the answer.
Scope notes
Textarearather than keeping it as an empty placeholder. The acceptance criteria call out the four action buttons as "unchanged" but don't list the textarea — and a permanent empty textarea felt redundant with the action buttons already signaling the affordance. Happy to revisit if reviewers prefer a placeholder slot in the no-draft state.git grep responseTextshows onlyHistoryListPanel.tsx, where it's a local variable for entry-search matching — unrelated.Test plan
npm run validatepasses.npx vitest run --project=storybook src/components/groups/InlineSamplingRequest src/components/groups/PendingClientRequests src/components/screens/ToolsScreen— 17/17 stories pass.🤖 Generated with Claude Code