Skip to content

Commit d9af1e3

Browse files
os-zhuangclaude
andauthored
feat(chatbot): frame extend builds in the plan card ("Adding to existing app X") (#2005)
When propose_blueprint returns a `targetApp` (extend mode), the plan card now shows a badge — "Adding to existing app 「X」" — so the user can see the build is ADDITIVE (growing an existing app), not a new one. `targetApp` was already plumbed through detectProposedPlan; this renders it. New `planExtendLabel` prop (English default, host-overridable). Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
1 parent 9130b33 commit d9af1e3

1 file changed

Lines changed: 12 additions & 0 deletions

File tree

packages/plugin-chatbot/src/ChatbotEnhanced.tsx

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -522,6 +522,9 @@ export interface ChatbotEnhancedProps extends React.HTMLAttributes<HTMLDivElemen
522522
nextStepsLabel?: string;
523523
/** Heading for the pre-build proposed-plan card (default "Proposed plan"). */
524524
planTitleLabel?: string;
525+
/** Extend mode: prefix shown when proposedPlan.targetApp is set, framing
526+
* the build as additive (e.g. "Adding to existing app"). */
527+
planExtendLabel?: string;
525528
/** Heading above the structure-deciding questions in the plan card (default "Confirm before building"). */
526529
planQuestionsLabel?: string;
527530
/** Heading above the agent's assumptions in the plan card (default "Assumptions"). */
@@ -915,6 +918,7 @@ const ChatbotEnhanced = React.forwardRef<HTMLDivElement, ChatbotEnhancedProps>(
915918
verifiedLabel = 'Verified',
916919
nextStepsLabel = "What's next",
917920
planTitleLabel = 'Proposed plan',
921+
planExtendLabel = 'Adding to existing app',
918922
planQuestionsLabel = 'Confirm before building',
919923
planAssumptionsLabel = 'Assumptions',
920924
planApproveHintLabel = 'Reply to approve or adjust this plan.',
@@ -1577,6 +1581,14 @@ const ChatbotEnhanced = React.forwardRef<HTMLDivElement, ChatbotEnhancedProps>(
15771581
<ClipboardList className="size-3.5" />
15781582
{planTitleLabel}
15791583
</span>
1584+
{tool.proposedPlan.targetApp ? (
1585+
<span
1586+
className="inline-flex w-fit items-center gap-1 rounded-md border border-blue-200 bg-blue-50 px-2 py-0.5 text-[11px] font-medium text-blue-700 dark:border-blue-900/50 dark:bg-blue-950/30 dark:text-blue-300"
1587+
data-testid="proposed-plan-extend"
1588+
>
1589+
+ {planExtendLabel}{tool.proposedPlan.targetApp}
1590+
</span>
1591+
) : null}
15801592
{tool.proposedPlan.summary ? (
15811593
<p className="text-xs text-muted-foreground">{tool.proposedPlan.summary}</p>
15821594
) : null}

0 commit comments

Comments
 (0)