Skip to content

Conversation

@phodal
Copy link
Member

@phodal phodal commented Nov 30, 2025

Problem

The IntelliJ plugin was crashing with:

java.lang.NoClassDefFoundError: androidx/compose/material/icons/Icons
	at cc.unitmesh.devins.ui.compose.icons.AutoDevComposeIcons.getSettings(AutoDevComposeIcons.kt:36)
	at cc.unitmesh.devins.idea.toolwindow.ComposableSingletons$IdeaAgentAppKt$lambda$1981209179$1.invoke-KMTpdl8(IdeaAgentApp.kt:466)

Root Cause

The mpp-ui module's AutoDevComposeIcons uses androidx.compose.material.icons.Icons (Material Icons), which is available for Android/Multiplatform but not in IntelliJ's Compose environment (Jewel UI).

Solution

Created a local icon provider IdeaComposeIcons in mpp-idea that defines icons using ImageVector.Builder with path-based vector graphics, avoiding the dependency on Material Icons.

Changes

  1. Created IdeaComposeIcons.kt - A new icon provider that uses ImageVector.Builder with paths:

    • Settings - gear/cog icon
    • Build - wrench icon
    • Error - circle with exclamation mark
    • CheckCircle - circle with checkmark
  2. Updated IdeaAgentApp.kt:

    • Removed import of AutoDevComposeIcons
    • Changed all usages from AutoDevComposeIcons.X to IdeaComposeIcons.X

Testing

  • The icons are defined using standard Compose ImageVector paths which work with Jewel's Icon composable
  • No runtime dependencies on Material Icons library

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

Summary by CodeRabbit

  • Style
    • Updated UI icons (Settings, Build, Error, and status indicators) for improved visual consistency and better integration with the IDE interface.

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

Fix NoClassDefFoundError for androidx/compose/material/icons/Icons in
IntelliJ IDEA Compose environment.

The mpp-ui module uses Material Icons which are not available in
IntelliJ's Jewel UI environment. This fix creates a local icon provider
(IdeaComposeIcons) that defines icons using ImageVector paths, avoiding
the dependency on Material Icons.

Icons provided:
- Settings (gear/cog)
- Build (wrench)
- Error (circle with exclamation)
- CheckCircle (circle with checkmark)
@coderabbitai
Copy link

coderabbitai bot commented Nov 30, 2025

Walkthrough

Introduces a new custom icon set for IntelliJ IDEA Compose UI by creating IdeaComposeIcons.kt with four ImageVector icons (Settings, Build, Error, CheckCircle), and updates IdeaAgentApp.kt to replace references from AutoDevComposeIcons to the new icon set.

Changes

Cohort / File(s) Summary
Icon Asset Update
mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/toolwindow/IdeaAgentApp.kt
Updated import statement from AutoDevComposeIcons to IdeaComposeIcons and replaced icon references in Bubble components (Build, Error, CheckCircle/Check, Settings icons remain unchanged in logic, only source changed).
Custom Icon Definitions
mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/toolwindow/IdeaComposeIcons.kt
New file defining public object IdeaComposeIcons with four lazily-initialized ImageVector properties (Settings, Build, Error, CheckCircle) constructed via ImageVector.Builder with explicit viewport, size, and SVG path data.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

  • Icon path accuracy: Verify that the SVG path data in IdeaComposeIcons.kt for each of the four icons renders correctly at intended dimensions and aligns with expected visual design.
  • Icon viewport/size consistency: Confirm that viewport sizes and dimensions are consistent across all four icons and compatible with existing UI layouts in IdeaAgentApp.kt.

Possibly related PRs

Poem

🐰 With whiskers twitching, icons bright,
Custom vectors drawn just right,
Settings, Builds, and Errors too—
Fresh new icons, shiny new, new!
From old icons we hopped away,
IdeaComposeIcons saves the day! ✨

Pre-merge checks and finishing touches

❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'fix(mpp-idea): replace Material Icons with local IdeaComposeIcons' directly and clearly describes the main change in the pull request: replacing Material Icons with a local icon provider.
✨ 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 fix/idea-compose-icons-no-material-dependency

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

Copy link

@augmentcode augmentcode bot left a comment

Choose a reason for hiding this comment

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

Review completed. 1 suggestions posted.

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

}

/**
* Error icon (circle with X)
Copy link

Choose a reason for hiding this comment

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

The KDoc says "Error icon (circle with X)" but the vector draws an exclamation mark inside a circle; consider updating the comment to match the icon.

🤖 Was this useful? React with 👍 or 👎

Copy link

@coderabbitai coderabbitai bot left a comment

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/IdeaComposeIcons.kt (1)

117-151: Nit: KDoc for Error icon doesn’t match actual glyph

The KDoc says “Error icon (circle with X)”, but the path defines a circle with an exclamation mark (!). Consider updating the comment (or the path) so the description matches the actual icon.

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 5824500 and e33d94f.

📒 Files selected for processing (2)
  • mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/toolwindow/IdeaAgentApp.kt (4 hunks)
  • mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/toolwindow/IdeaComposeIcons.kt (1 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/IdeaComposeIcons.kt
  • mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/toolwindow/IdeaAgentApp.kt
🧠 Learnings (3)
📓 Common learnings
Learnt from: CR
Repo: phodal/auto-dev-sketch PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-11-30T02:30:49.805Z
Learning: Applies to **/src/{androidMain,desktopMain}/**/*.kt : For Compose (Desktop/Android), use `AutoDevColors` from `cc.unitmesh.devins.ui.compose.theme` or `MaterialTheme.colorScheme`
📚 Learning: 2025-11-30T02:30:49.805Z
Learnt from: CR
Repo: phodal/auto-dev-sketch PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-11-30T02:30:49.805Z
Learning: Applies to **/src/{androidMain,desktopMain}/**/*.kt : For Compose (Desktop/Android), use `AutoDevColors` from `cc.unitmesh.devins.ui.compose.theme` or `MaterialTheme.colorScheme`

Applied to files:

  • mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/toolwindow/IdeaComposeIcons.kt
  • mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/toolwindow/IdeaAgentApp.kt
📚 Learning: 2025-11-30T02:30:49.805Z
Learnt from: CR
Repo: phodal/auto-dev-sketch PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-11-30T02:30:49.805Z
Learning: Applies to {mpp-ui/src/jsMain/typescript/**/*.{ts,tsx},**/src/{androidMain,desktopMain}/**/*.kt} : DO NOT hardcode colors (e.g., `Color(0xFF...)` or `#hex`). Always use design tokens for consistency across platforms

Applied to files:

  • mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/toolwindow/IdeaAgentApp.kt
⏰ 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 (2)
mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/toolwindow/IdeaAgentApp.kt (1)

283-307: Icon usages correctly migrated to IdeaComposeIcons

All four icon call sites now consistently use IdeaComposeIcons and continue to rely on Jewel/AutoDev color tokens for tinting. This cleanly removes the Material Icons dependency from this screen without changing behavior.

Also applies to: 350-355, 388-393, 460-469

mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/toolwindow/IdeaComposeIcons.kt (1)

17-184: Local ImageVector icons successfully decouple from Material Icons

IdeaComposeIcons defines four lazily-initialized 24dp ImageVector icons (Settings, Build, Error, CheckCircle) with inline paths, removing any runtime dependency on androidx.compose.material.icons. This aligns with the IntelliJ/Jewel environment and eliminates the NoClassDefFoundError. All previous references to AutoDevComposeIcons and Material Icons have been removed from the codebase.

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