feat(frontend): auto-expand agent config sections when the agent fills them#5260
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (2)
🚧 Files skipped from review as they are similar to previous changes (2)
📝 WalkthroughSummary by CodeRabbit
WalkthroughThe change adds zero-crossing detection for section counts and applies controlled auto-expansion to the tools, MCP, skills, and triggers accordions while preserving existing behavior for other sections. ChangesSection auto-expand controls
Estimated code review effort: 3 (Moderate) | ~20 minutes Sequence Diagram(s)sequenceDiagram
participant AgentTemplateControl
participant useAutoExpandOnPopulate
participant Accordion
AgentTemplateControl->>useAutoExpandOnPopulate: pass section counts
useAutoExpandOnPopulate->>AgentTemplateControl: update sectionOpen on zero crossings
AgentTemplateControl->>Accordion: provide controlled open state
Accordion-->>AgentTemplateControl: report manual open-state changes
Possibly related PRs
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
@coderabbitai review |
✅ Action performedReview finished.
|
There was a problem hiding this comment.
Actionable comments posted: 1
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro Plus
Run ID: 25a2063d-3765-4c04-860c-010be97a6e04
📒 Files selected for processing (3)
web/packages/agenta-entity-ui/src/DrillInView/SchemaControls/AgentTemplateControl.tsxweb/packages/agenta-entity-ui/src/DrillInView/SchemaControls/agentSectionAutoExpand.tsweb/packages/agenta-entity-ui/tests/unit/agentSectionAutoExpand.test.ts
|
@coderabbitai review |
✅ Action performedReview finished.
|
Context
When the agent added a tool, skill, or trigger, the config panel committed a new revision but left that section collapsed, so the change was invisible. People asked "did the agent do anything?" even with a commit showing.
Changes
The four list sections (Tools, MCP, Skills, Triggers) are now controlled, and a small hook opens a section when its item count crosses from zero to non-zero and collapses it when it returns to zero. The trigger is the boundary crossing, not the level, so manually collapsing a populated section sticks across unrelated re-renders. Singleton and drawer sections are untouched.
Tests / notes
computeSectionCrossings(open on 0 to >0, close on >0 to 0, no-op when it does not cross zero).What to QA