Repository navigation
feat(mpp-idea): redesign IdeaAgentTabsHeader with modern segmented control - #16
Conversation
…ntrol - Add segmented control design with unified background container - Implement smooth color and size animations using spring physics - Add unique color and icon for each agent type: - Agentic: Blue with code icon - Review: Indigo with review/magnifier icon - Knowledge: Green with book icon - Remote: Amber with cloud icon - Add hover effects for tabs and action buttons - Add animated bottom indicator for selected tab - Add new icons to IdeaComposeIcons: Add, Review, Book, Cloud, Chat
WalkthroughAdds five ImageVector icons (Add, Review, Book, Cloud, Chat) to IdeaComposeIcons — duplicates of these declarations were appended — and refactors IdeaAgentTabsHeader to a segmented, animated tab control, adding onNewChat and onSettings callbacks and new private composables for pill tabs and action buttons. Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes
Possibly related PRs
Poem
Pre-merge checks and finishing touches✅ Passed checks (3 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
Comment |
| reflectiveCurveTo(11.99f, 14f, 9.5f, 14f) | ||
| close() | ||
| // Checkmark inside | ||
| moveTo(7.5f, 9.5f) |
There was a problem hiding this comment.
The checkmark is also included in this filled path, which will likely render as a solid filled triangle under the stroked checkmark below and cause visual artifacts when tinted; consider removing it from the fill path so only the stroked checkmark draws.
🤖 Was this useful? React with 👍 or 👎
| onAgentTypeChange = onAgentTypeChange | ||
| ) | ||
|
|
||
| // Right: Actions with tooltips |
There was a problem hiding this comment.
This says "Actions with tooltips", but the actions below don't attach any tooltip composables; consider adding tooltips or updating the comment to avoid confusion.
🤖 Was this useful? React with 👍 or 👎
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (1)
mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/toolwindow/IdeaComposeIcons.kt (1)
823-837: Consider simplifying the checkmark rendering in the Review icon.The checkmark is drawn twice—once as a fill path (lines 823-827) and again as a stroke path (lines 834-837). The fill path doesn't close and may not render as intended since it's just line segments without a closed shape. Consider removing the fill portion of the checkmark and keeping only the stroked version.
// Checkmark inside - moveTo(7.5f, 9.5f) - lineToRelative(1.5f, 1.5f) - lineToRelative(3f, -3f) } path( stroke = SolidColor(Color.Black), strokeLineWidth = 1.5f, strokeLineCap = StrokeCap.Round, strokeLineJoin = StrokeJoin.Round ) { moveTo(7.5f, 9.5f) lineToRelative(1.5f, 1.5f) lineToRelative(3f, -3f) }
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (2)
mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/toolwindow/IdeaComposeIcons.kt(1 hunks)mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/toolwindow/header/IdeaAgentTabsHeader.kt(2 hunks)
🧰 Additional context used
📓 Path-based instructions (1)
**/*.kt
📄 CodeRabbit inference engine (AGENTS.md)
Use
expect/actualfor platform-specific code in KMP projects (e.g., file I/O on JVM/JS/Wasm)
Files:
mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/toolwindow/header/IdeaAgentTabsHeader.ktmpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/toolwindow/IdeaComposeIcons.kt
🧬 Code graph analysis (1)
mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/toolwindow/header/IdeaAgentTabsHeader.kt (1)
mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/toolwindow/IdeaAgentViewModel.kt (1)
onAgentTypeChange(182-184)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (2)
- GitHub Check: Build (223)
- GitHub Check: Build (241)
🔇 Additional comments (6)
mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/toolwindow/IdeaComposeIcons.kt (1)
756-929: New icons look well-implemented and follow the established pattern.The five new icons (Add, Review, Book, Cloud, Chat) are correctly implemented using lazy initialization with
ImageVector.Builder, matching the existing icon definitions in the file.Note: The AI summary mentions duplicate icon declarations, but the provided code shows only single definitions for each icon. If duplicates existed in an earlier version, they appear to have been resolved.
mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/toolwindow/header/IdeaAgentTabsHeader.kt (5)
35-77: LGTM! Clean composable structure with new action callbacks.The refactored
IdeaAgentTabsHeaderproperly separates concerns between the segmented tabs and action buttons. The newonNewChatandonSettingscallbacks integrate well with the component's API.
112-196: Well-implemented animated tab pill with smooth transitions.The use of
animateColorAsStateandanimateDpAsStatewith spring physics creates polished hover and selection effects. Settingindication = nullinclickablecorrectly defers visual feedback to the custom animated background.
201-246: Action button implementation looks good.The hover-based color animations provide nice visual feedback. One minor note:
IconButtonfrom Jewel may have its own internal interaction handling, but since you're only tracking hover state (not press) via the externalinteractionSource, this should work correctly.
248-258: LGTM!The color mapping is clean and exhaustive, with appropriate themed colors for each agent type.
260-269: LGTM!The icon mapping correctly uses the newly added icons from
IdeaComposeIconsand aligns with the PR's theming specification.
- Fix Review icon: remove checkmark from fill path to avoid visual artifacts - Update comment: change 'Actions with tooltips' to 'Action buttons' - Add documentation: explain why LOCAL_CHAT is excluded from tabs
There was a problem hiding this comment.
Actionable comments posted: 0
🧹 Nitpick comments (1)
mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/toolwindow/header/IdeaAgentTabsHeader.kt (1)
84-110: Segmented tabs implementation is clean; consider memoizing the agent type listThe segmented control wrapper reads well, and the explicit comment about excluding
LOCAL_CHATclarifies the behavior. As a tiny optimization, you could avoid re‑allocating theagentTypeslist on every recomposition:- val agentTypes = listOf(AgentType.CODING, AgentType.CODE_REVIEW, AgentType.KNOWLEDGE, AgentType.REMOTE) + val agentTypes = remember { + listOf(AgentType.CODING, AgentType.CODE_REVIEW, AgentType.KNOWLEDGE, AgentType.REMOTE) + }
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (2)
mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/toolwindow/IdeaComposeIcons.kt(1 hunks)mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/toolwindow/header/IdeaAgentTabsHeader.kt(2 hunks)
🧰 Additional context used
📓 Path-based instructions (1)
**/*.kt
📄 CodeRabbit inference engine (AGENTS.md)
Use
expect/actualfor platform-specific code in KMP projects (e.g., file I/O on JVM/JS/Wasm)
Files:
mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/toolwindow/header/IdeaAgentTabsHeader.ktmpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/toolwindow/IdeaComposeIcons.kt
🧬 Code graph analysis (1)
mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/toolwindow/header/IdeaAgentTabsHeader.kt (1)
mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/toolwindow/IdeaAgentViewModel.kt (1)
onAgentTypeChange(182-184)
🔇 Additional comments (10)
mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/toolwindow/IdeaComposeIcons.kt (6)
756-785: LGTM!The Add icon is correctly implemented with a standard plus sign path, following the established pattern in this file.
787-836: Good fix: Checkmark now rendered as stroke-only path.The previous concern about visual artifacts from the checkmark being in the filled path has been properly addressed. The checkmark is now rendered as a separate stroke path with appropriate
StrokeCap.RoundandStrokeJoin.Round, which ensures clean rendering when tinted.
838-871: LGTM!The Book icon is well-implemented with a recognizable book shape including a bookmark detail.
873-898: LGTM!The Cloud icon is correctly implemented with a standard cloud shape.
900-926: LGTM!The Chat icon is correctly implemented with a standard speech bubble shape.
756-926: AI summary inconsistency: No duplicate icon declarations found.The AI-generated summary claims duplicate declarations of Add, Review, Book, Cloud, and Chat icons were appended, but the provided code shows only one set of these icons. This may indicate the summary is outdated or the duplicates were already removed.
mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/toolwindow/header/IdeaAgentTabsHeader.kt (4)
36-77: Header layout and new callbacks look solidThe split between the segmented tabs on the left and compact action buttons on the right is clear, and the added
onNewChat/onSettingscallbacks are cleanly wired without extra state. No issues from a composable or layout perspective.
116-199: Tab pill interaction and animations are well-structuredUsing a shared
MutableInteractionSourceforhoverableandclickableplus animated background/text colors and indicator height is idiomatic Compose; the hierarchy (Column → Row → Icon/Text → indicator) keeps the pill behavior predictable. No functional issues spotted here.
205-249: FancyActionButton is a good reusable pattern for header actionsThe hover-driven background and icon color animations around
IconButton, with a rememberedinteractionSource, give a nice affordance without complicating the call site. The API (icon +contentDescription+onClick) is minimal yet flexible.
255-272: Agent type color/icon mapping is exhaustive and future-proofThe
whenmappings for both colors and icons cover all currentAgentTypeentries, includingLOCAL_CHAT, which keeps things safe if that type is used elsewhere. This also ensures the compiler will flag missing branches if new agent types are added.
Summary
Redesigned
IdeaAgentTabsHeaderwith a modern, fancy segmented control design featuring smooth animations and visual enhancements.Changes
Visual Improvements
Agent Type Theming
Each agent type now has a unique color and icon:
</>Animation System
animateColorAsStateandanimateDpAsStateSpring.StiffnessMediumLowfor natural feeling transitionsNew Icons
Added to
IdeaComposeIcons:Add- Plus icon for new chat buttonReview- Magnifying glass with checkmarkBook- Book icon for Knowledge agentCloud- Cloud icon for Remote agentChat- Chat bubble iconTesting
./gradlew :mpp-idea:compileKotlinpassesPull Request opened by Augment Code with guidance from the PR author
Summary by CodeRabbit
New Features
Bug Fixes
✏️ Tip: You can customize this high-level summary in your review settings.