feat(agents): fold edit-with-AI + dock toggle into one split button#2746
Merged
dmarticus merged 2 commits intoJun 18, 2026
Merged
Conversation
#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>
|
React Doctor found no issues in the changed files. 🎉 Reviewed by React Doctor for commit |
Contributor
Prompt To Fix All With AIFix 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 |
dmarticus
approved these changes
Jun 18, 2026
…tBuilderActions.ts Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Stacked on top of #2742. Puts back the "Edit with AI" affordance that #2742 removed — but de-dupes it structurally rather than dropping it.
Why
#2742 dropped the contextual
Edit with AIheader 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
AgentBuilderHeaderControlsnow renders a single split button instead of two competing ones: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.One sparkle (the AI identity), one neutral toggle — no more duplicate gold buttons. Mirrors the existing split-button idiom (
SkillButtonsMenu): quillButtons fused withrounded-s/rounded-e+border-s-0under a sharedTooltipProvider.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 (nocontextprop re-threaded).Per your note, the
Followingbadge is not carried over into the header for now.Test plan
pnpm --filter @posthog/ui typecheckclean; Biome clean.Edit configuration+ an open/close toggle whose icon and tooltip flip with dock state.🤖 Generated with Claude Code