Skip to content

feat(mpp-idea): redesign IdeaAgentTabsHeader with modern segmented control - #16

Merged
phodal merged 2 commits into
masterfrom
feat/fancy-agent-tabs-header
Nov 30, 2025
Merged

phodal merged 2 commits into
masterfrom
feat/fancy-agent-tabs-header

Conversation

@phodal

@phodal phodal commented Nov 30, 2025 •

Copy link
Copy Markdown
Member

Summary

Redesigned IdeaAgentTabsHeader with a modern, fancy segmented control design featuring smooth animations and visual enhancements.

Changes

Visual Improvements

  • Segmented Control Design: Unified background container with rounded corners wrapping all tabs
  • Animated Bottom Indicator: Selected tab shows a colored indicator bar with spring animation
  • Hover Effects: Tabs and action buttons respond to hover with color changes

Agent Type Theming

Each agent type now has a unique color and icon:

Agent Type Color Icon
Agentic (Coding) Blue Code </>
Review Indigo Magnifier with checkmark
Knowledge Green Book
Remote Amber Cloud

Animation System

  • Spring-based physics animations using animateColorAsState and animateDpAsState
  • Smooth transitions for background color, text color, and indicator height
  • Spring.StiffnessMediumLow for natural feeling transitions

New Icons

Added to IdeaComposeIcons:

  • Add - Plus icon for new chat button
  • Review - Magnifying glass with checkmark
  • Book - Book icon for Knowledge agent
  • Cloud - Cloud icon for Remote agent
  • Chat - Chat bubble icon

Testing

  • ./gradlew :mpp-idea:compileKotlin passes

Pull Request opened by Augment Code with guidance from the PR author

Summary by CodeRabbit

  • New Features

    • Redesigned agent tabs with an animated segmented control for clearer, responsive navigation.
    • Added right‑side action buttons for creating new chats and accessing settings.
    • Added five new UI icons (Add, Review, Book, Cloud, Chat) for toolbar and tab use.
  • Bug Fixes

    • Removed hard‑coded tab rendering in favor of a centralized, consistent tab implementation.

✏️ Tip: You can customize this high-level summary in your review settings.

…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
@coderabbitai

coderabbitai Bot commented Nov 30, 2025 •

Copy link
Copy Markdown

Walkthrough

Adds 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

Cohort / File(s) Summary
Icon definitions (duplicates present)
mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/toolwindow/IdeaComposeIcons.kt
Adds public lazy ImageVector properties: Add, Review, Book, Cloud, Chat (24x24dp, single filled path). The same five icons are declared again later in the same object, producing duplicate public declarations.
Tabbed header refactor
mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/toolwindow/header/IdeaAgentTabsHeader.kt
Replaces static left-aligned tabs with a segmented, animated tab system (new SegmentedAgentTabs, IdeaAgentTabPill, FancyActionButton). IdeaAgentTabsHeader signature now includes onNewChat: () -> Unit and onSettings: () -> Unit. Adds per-AgentType color/icon helpers and animated visuals (background, text, indicator).

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

  • Verify whether duplicated icon declarations in IdeaComposeIcons.kt are accidental (remove one set).
  • Inspect animation parameters (spring/timing) and ensure no layout jank in IdeaAgentTabPill.
  • Confirm getAgentTypeColor/getAgentTypeIcon cover all AgentType values and are correct.
  • Ensure new callbacks (onNewChat, onSettings) are wired and tested in parent usage.

Possibly related PRs

Poem

🐰 I nibble code in morning light,
Five tiny icons jump to sight,
Tabs that puff and gently spring,
New buttons clap — I hum and sing,
Hop! The UI dances bright.

Pre-merge checks and finishing touches

✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly describes the main change: redesigning IdeaAgentTabsHeader with modern segmented control, which aligns with the primary modifications in the changeset.
Docstring Coverage ✅ Passed Docstring coverage is 83.33% which is sufficient. The required threshold is 80.00%.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch feat/fancy-agent-tabs-header

Comment @coderabbitai help to get the list of available commands and usage tips.

@augmentcode augmentcode Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review completed. 2 suggestions posted.

Comment augment review to trigger a new review at any time.

reflectiveCurveTo(11.99f, 14f, 9.5f, 14f)
close()
// Checkmark inside
moveTo(7.5f, 9.5f)

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 👎

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

📥 Commits

Reviewing files that changed from the base of the PR and between 5e68e8e and 77f7b01.

📒 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/actual for 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.kt
  • mpp-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 IdeaAgentTabsHeader properly separates concerns between the segmented tabs and action buttons. The new onNewChat and onSettings callbacks integrate well with the component's API.


112-196: Well-implemented animated tab pill with smooth transitions.

The use of animateColorAsState and animateDpAsState with spring physics creates polished hover and selection effects. Setting indication = null in clickable correctly 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: IconButton from Jewel may have its own internal interaction handling, but since you're only tracking hover state (not press) via the external interactionSource, 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 IdeaComposeIcons and 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

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 list

The segmented control wrapper reads well, and the explicit comment about excluding LOCAL_CHAT clarifies the behavior. As a tiny optimization, you could avoid re‑allocating the agentTypes list 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

📥 Commits

Reviewing files that changed from the base of the PR and between 77f7b01 and 18a10c6.

📒 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/actual for 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.kt
  • mpp-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.Round and StrokeJoin.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 solid

The split between the segmented tabs on the left and compact action buttons on the right is clear, and the added onNewChat/onSettings callbacks are cleanly wired without extra state. No issues from a composable or layout perspective.


116-199: Tab pill interaction and animations are well-structured

Using a shared MutableInteractionSource for hoverable and clickable plus 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 actions

The hover-driven background and icon color animations around IconButton, with a remembered interactionSource, 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-proof

The when mappings for both colors and icons cover all current AgentType entries, including LOCAL_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.

@phodal
phodal merged commit b9f92bd into master Nov 30, 2025
@phodal
phodal deleted the feat/fancy-agent-tabs-header branch December 2, 2025 10:30
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.

1 participant