Skip to content

feat(agents): fold edit-with-AI + dock toggle into one split button#2746

Merged
dmarticus merged 2 commits into
dylan/agent-builderfrom
ben/agent-builder-edit-with-ai-split
Jun 18, 2026
Merged

feat(agents): fold edit-with-AI + dock toggle into one split button#2746
dmarticus merged 2 commits into
dylan/agent-builderfrom
ben/agent-builder-edit-with-ai-split

Conversation

@benjackwhite

@benjackwhite benjackwhite commented Jun 18, 2026

Copy link
Copy Markdown

Stacked on top of #2742. Puts back the "Edit with AI" affordance that #2742 removed — but de-dupes it structurally rather than dropping it.

Screenshot 2026-06-18 at 10 15 44

Why

#2742 dropped the contextual Edit with AI header CTA to kill the "two near-identical gold buttons" problem: the CTA and the dock toggle both rendered as gold sparkle buttons sitting next to each other. Fair — but that also dropped the one-click hand-off into authoring the view you're currently on. You now have to open the dock and type the intent yourself.

What

AgentBuilderHeaderControls now renders a single split button instead of two competing ones:

  • Primary segment — the contextual edit-with-AI action for the current page (New agent / Edit configuration / Explain this session / …), resolved from the dock's page context. Opens the dock and seeds the matching prompt. This is the core action.
  • Trailing segment — opens/closes the dock without seeding, with a distinct sidebar icon and an open/hide tooltip that tracks dock state. So you can peek at or dismiss the existing conversation.

One sparkle (the AI identity), one neutral toggle — no more duplicate gold buttons. Mirrors the existing split-button idiom (SkillButtonsMenu): quill Buttons fused with rounded-s/rounded-e + border-s-0 under a shared TooltipProvider.

Views with no obvious action (Scouts) collapse to the lone open/close toggle. Restores agentBuilderActions (headerActionForPage); the header reads page context from the store, so the existing callers stay prop-free (no context prop re-threaded).

Per your note, the Following badge is not carried over into the header for now.

Test plan

  • pnpm --filter @posthog/ui typecheck clean; Biome clean.
  • Verified live (CDP): the agent-config view shows Edit configuration + an open/close toggle whose icon and tooltip flip with dock state.
  • Scouts tab shows the lone toggle (no contextual action).
  • Primary segment seeds the right prompt per page (New agent / Explain this session / …).

🤖 Generated with Claude Code

#2742 dropped the contextual "Edit with AI" header CTA to kill the "two
near-identical gold buttons" (the CTA and the dock toggle both read as
gold sparkles). That also dropped the one-click hand-off into authoring
the view you're on.

Put the affordance back, de-duped structurally instead. AgentBuilderHeaderControls
now renders a single split button:
  - primary segment: the contextual edit-with-AI action for the current
    page (New agent / Edit configuration / Explain this session / …),
    resolved from the dock's page context — opens the dock and seeds the
    prompt,
  - trailing segment: opens/closes the dock without seeding, with a
    distinct sidebar icon + open/hide tooltip that tracks dock state.

One sparkle (the AI identity), one neutral toggle — no more duplicate
gold buttons. Views with no obvious action (Scouts) collapse to the lone
toggle. Restores agentBuilderActions (headerActionForPage); the header
reads page context from the store, so callers stay prop-free.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@github-actions

github-actions Bot commented Jun 18, 2026

Copy link
Copy Markdown

React Doctor found no issues in the changed files. 🎉

Reviewed by React Doctor for commit e4d73f3.

@benjackwhite benjackwhite requested a review from dmarticus June 18, 2026 08:16
@greptile-apps

greptile-apps Bot commented Jun 18, 2026

Copy link
Copy Markdown
Contributor
Prompt To Fix All With AI
Fix the following 1 code review issue. Work through them one at a time, proposing concise fixes.

---

### Issue 1 of 1
packages/ui/src/features/agent-applications/agent-builder/agentBuilderActions.ts:29-34
The label "Ask about this agent" creates a slightly different mental model than the seed prompt it triggers. Every other label in this switch is either an imperative directive ("Edit configuration", "Review sessions", "Explain this session") or descriptively aligned with the prompt that follows. Here the label implies an open-ended question while the prompt is actually a directive to explain — and the analogous session view already uses "Explain this session" consistently. Aligning the label would make the button's intent clearer and match the established pattern.

```suggestion
    case "agent":
      return {
        label: "Explain this agent",
        prompt: "Explain what this agent does and how it's configured.",
        agentSlug: page.slug,
      };
```

Reviews (1): Last reviewed commit: "feat(agents): fold edit-with-AI + dock t..." | Re-trigger Greptile

…tBuilderActions.ts

Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
@dmarticus dmarticus merged commit a88ce70 into dylan/agent-builder Jun 18, 2026
19 checks passed
@dmarticus dmarticus deleted the ben/agent-builder-edit-with-ai-split branch June 18, 2026 17:28
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