Skip to content

Conversation

@phodal
Copy link
Member

@phodal phodal commented Dec 1, 2025

No description provided.

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)
…dependency

fix(mpp-idea): replace Material Icons with local IdeaComposeIcons
Ensure document listener addition and caret movement are executed within a read action to improve thread safety.
- Simplify IdeaCodeReviewViewModel by extending CodeReviewViewModel from mpp-ui
- Remove duplicate IdeaCodeReviewModels.kt, use shared models from mpp-ui
- Update IdeaCodeReviewContent.kt to use shared model types
- Fix dependency configuration in build.gradle.kts and settings.gradle.kts
- All CodeReview features now inherited from base class:
  - Plan generation (generateModificationPlan)
  - Fix generation (generateFixes, proceedToGenerateFixes)
  - Lint analysis (runLint, analyzeModifiedCode)
  - Issue tracking (loadIssueForCommit)
  - Test discovery (findRelatedTests)
  - File viewer support (openFile, closeFileViewer)
Add Knowledge Agent feature to mpp-idea, aligned with mpp-ui's DocumentReaderViewModel.

New files:
- IdeaKnowledgeModels.kt: State and data models for Knowledge Agent
- IdeaKnowledgeViewModel.kt: ViewModel with DocumentAgent integration
- IdeaKnowledgeContent.kt: Three-panel UI (document list, viewer, AI chat)

Features:
- Project document scanning (md, pdf, docx, kt, java, py, etc.)
- Document content viewing with line numbers and TOC navigation
- AI-powered document querying via DocumentAgent
- LLM configuration via shared ConfigManager

Modified files:
- IdeaAgentApp.kt: Integrate Knowledge tab with IdeaKnowledgeContent
- IdeaComposeIcons.kt: Add Refresh, Description, Code, Delete icons

Reuses mpp-core components:
- DocumentAgent, DocumentRegistry, DocumentParserFactory
- ConfigManager for LLM configuration
- JewelRenderer for agent output rendering
refactor(mpp-idea): reuse CodeReviewViewModel from mpp-ui
Fixes based on review feedback:

1. EDT violations - Move IO-heavy operations to Dispatchers.IO:
   - initializeLLMService() and loadDocuments() in init block
   - selectDocument() file loading
   - File read/parse operations in loadDocumentContent()
   - refreshDocuments() document scanning

2. Init coroutine tracking - Store initJob for proper disposal:
   - Add initJob property to track init coroutine
   - Cancel initJob in dispose()
   - Handle CancellationException in init block

3. Cancellation handling - Remove error message for intentional cancellation:
   - Change renderError() to comment for CancellationException in sendMessage()

4. Selection visual distinction - Improve selected item highlighting:
   - Use AutoDevColors.Blue.c400.copy(alpha = 0.15f) for better visibility

5. Unused code - Comment out IdeaDocumentIndexRecord:
   - Add TODO comment for future indexing feature
Use coerceAtLeast(1) to prevent IllegalArgumentException when
tocItem.level is zero or negative in repeat() call.
feat(mpp-idea): implement Knowledge Agent functionality
Replace string-based TextField handling with state objects to better synchronize UI input and external changes in search and chat components.
No longer exclude SQLDelight from IntelliJ plugin dependencies in build script.
- Extract timeline components: IdeaTimelineContent, IdeaMessageBubble, IdeaToolCallBubble, IdeaErrorBubble, IdeaTaskCompleteBubble, IdeaTerminalOutputBubble
- Extract header component: IdeaAgentTabsHeader
- Extract status component: IdeaToolLoadingStatusBar
- Reduce IdeaAgentApp.kt from 780 lines to 276 lines
- Align component structure with mpp-ui patterns
- Add AnimatedVisibility for expand/collapse animation
- Add copy to clipboard functionality for params and output
- Add status icons (executing, success, failed) with colors
- Add execution time display
- Add 'Show Full' toggle for long params/output
- Add IdeaCurrentToolCallItem for executing tool indicator
- Add new icons: PlayArrow, ExpandLess, ExpandMore, ContentCopy

Aligns with mpp-ui ToolItem/ToolResultItem patterns
- Add IdeaShellExecutor service for command execution using PtyCommandLine
- Add IdeaUIWriter for streaming output updates with state callbacks
- Enhance IdeaTerminalOutputBubble with execute/stop, expand/collapse, copy
- Add Terminal and Stop icons to IdeaComposeIcons
- Pass project through timeline components for shell access
- Add status badges (Ready, Running, Success, Failed, Terminated)
- Add execution time display and 'Show Full Output' toggle
- Full width layout instead of max 700dp
- Scrollable output area with 4 lines visible (~120dp)
- Auto-scroll to bottom when output changes
- Remove execute/re-run functionality (display only)
- Remove IdeaShellExecutor and IdeaUIWriter services
- Simplified header with command, status badge, and copy button
- Replace '+' with '✓' checkmark in IdeaToolLoadingStatusBar
- Use IntelliJ CopyPasteManager instead of AWT Toolkit for clipboard
- Add RoundedCornerShape to IdeaTaskCompleteBubble background
- Simplify formatToolOutput to avoid breaking valid JSON/tables
refactor(mpp-idea): extract IdeaAgentApp components and align with mpp-ui patterns
… command support

- Add Send, Folder, AlternateEmail, ArrowDropDown icons to IdeaComposeIcons
- Replace emoji/text with proper Jewel Icon components in IdeaBottomToolbar
- Add onSlashClick callback for / command trigger button
- Update IdeaInputSection and IdeaAgentApp to support slash commands
- Align toolbar features with mpp-ui BottomToolbar (except ModelSelector)
- Add IdeaModelSelector for switching between LLM configurations
- Add IdeaModelConfigDialog for configuring LLM models with provider, model name, API key, base URL, and advanced settings
- Add new icons to IdeaComposeIcons: Check, Visibility, VisibilityOff, ExpandMore, ExpandLess
- Integrate ModelSelector into IdeaBottomToolbar
- Update IdeaAgentApp with model selector state management
- Add setActiveConfig method to IdeaAgentViewModel
- Remove duplicate ExpandMore/ExpandLess icons from IdeaComposeIcons
feat(mpp-idea): enhance IdeaBottomToolbar with icons, slash command, and ModelSelector
- Add multiplatform-markdown-renderer:0.38.1 dependency
- Create JewelMarkdownColors using Jewel theme colors
- Create JewelMarkdownTypography using Jewel text styles
- Create JewelMarkdown wrapper for core markdown library
- Create IdeaMarkdownRenderer with Mermaid block detection
- Create MermaidRenderer using JCEF (JBCefBrowser) for diagram rendering
- Create MermaidDiagramView Compose wrapper with SwingPanel integration
- Support dark/light theme for Mermaid diagrams
- Add IdeaSketchRenderer as main dispatcher for content block types
- Add IdeaCodeBlockRenderer for code blocks with Jewel styling
- Add IdeaDiffRenderer for unified diff rendering with syntax highlighting
- Add IdeaThinkingBlockRenderer for collapsible thinking process display
- Add IdeaWalkthroughBlockRenderer wrapping IdeaMarkdownRenderer
- Integrate IdeaSketchRenderer into IdeaCodeReviewContent for AI analysis output
- Support markdown, diff, thinking, walkthrough, mermaid, and code blocks
…e generation

This PR implements Issue #14 - adding ProductFeatureTreeAgent capability to DocumentAgent.

## New Features

### ProductFeatureTreeAgent Mode
- Added new feature-tree mode to DocumentAgent for generating product feature trees
- AI-driven analysis using ReAct (Reasoning + Acting) workflow
- No hardcoded judgments - LLM autonomously analyzes codebase structure
- Multi-format output support: Mermaid MindMap, PlantUML, Graphviz DOT, Markdown, JSON

### Data Models (ProductFeature.kt)
- ProductFeature: Hierarchical feature node with id, name, description, level, confidence, children, codeRefs
- FeatureLevel enum: PRODUCT to MODULE to FEATURE to ATOMIC
- FeatureStatus enum: PENDING/ANALYZING/CONFIRMED/NEEDS_REVIEW
- CodeRef: Source code tracing with file path and inference source
- FeatureTreeRenderer: Multi-format output rendering

### Prompt Templates (ProductFeatureTreeTemplate.kt)
- Complete ReAct-style System Prompt
- Bilingual support (EN/ZH)
- Confidence scoring guidelines (1.0/0.8/0.6/0.4)
- Skip rules for test, build, utils directories
- Tool usage format specifications

## Bug Fixes

### ToolCallParser.kt
- Fixed JSON parsing for single-line format like json followed by JSON on same line
- Now handles both standard and compact JSON code block formats

### ToolOrchestrator.kt
- Fixed glob tool parameter passing (was only passing pattern, now passes all params)
- Fixed grep tool number type conversion for maxMatches/contextLines
- Fixed read-file tool number type conversion for startLine/endLine/maxLines

### build.gradle.kts
- Fixed parameter naming conflict with Gradle reserved projectPath
- Added docMode and docLanguage parameters for CLI

Closes #14
1. Thread-safety: Use AtomicInt.addAndFetch(1) for thread-safe counter
2. DOT graph: Add style=filled to child nodes for fillcolor visibility
3. Documentation: Fix CLI usage examples with correct module name and parameter names
feat(document): add ProductFeatureTreeAgent for automatic feature tree generation
…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
- 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
feat(mpp-idea): redesign IdeaAgentTabsHeader with modern segmented control
phodal added 29 commits December 1, 2025 09:44
Use DatePeriod to handle month and year boundaries when computing yesterday's date.
Relocate reusable UI components from the toolwindow package to a shared components package for better organization and reusability. Update imports accordingly.
Rename SimpleJewelMarkdown to JewelMarkdownRenderer and move table rendering logic to a new MarkdownTable.kt file for better modularity.
Split IdeaCodeReviewContent.kt (1915 lines) into 4 focused component files:

- IdeaCodeReviewContent.kt (78 lines): Main entry point with three-panel layout
- IdeaCommitComponents.kt (569 lines): Commit list and commit info components
- IdeaDiffComponents.kt (251 lines): Diff viewer and file tree components
- IdeaAnalysisComponents.kt (219 lines): AI analysis and lint result components

This improves code organization and maintainability by separating concerns.
…tionPlanSection

Address PR review comment by removing the unused parameter.
Renamed the file for clarity and consistency with naming conventions.
refactor(mpp-idea): extract CodeReview components into separate files
- Create RendererModels.kt with shared data models:
  - ToolCallInfo, TaskInfo, TaskStatus, ToolCallDisplayInfo
- Create RendererUtils.kt with shared utility methods:
  - formatToolCallDisplay(), formatToolResultSummary()
  - parseParamsString(), toToolCallInfo()
- Update ComposeRenderer to use shared models and utils
- Update JewelRenderer to use shared models and utils
- Add UI extensions for TaskStatus (icon, color) in TaskPanel.kt
- Update related imports in AgentChatInterface, ToolItem, tests
- Move TimelineItem sealed class from JewelRenderer to RendererModels.kt
- Move MessageRole enum to shared module
- Update all references in mpp-idea components and tests
- Maintain compatibility with ComposeRenderer's TimelineItem structure
…core

- Remove local TimelineItem sealed class from ComposeRenderer
- Update imports to use shared TimelineItem from cc.unitmesh.agent.render
- Replace CombinedToolItem with ToolCallItem
- Replace ToolErrorItem with ErrorItem
- Update MessageItem to handle nullable message field
- Update toMessageMetadata and fromMessageMetadata methods
- Add LiveTerminalItem handling in mpp-idea components
- Update MessageRole imports to use cc.unitmesh.devins.llm.MessageRole
…h Android-specific CodeParser

- Remove incorrect import of IosCodeParser from androidMain
- Create AndroidCodeParser class with regex-based parsing (similar to iOS implementation)
- Support parsing for Java, Kotlin, JavaScript, TypeScript, and Python
- Fix CI build failure in kmp-test.yml workflow
…cking

RendererModels.kt:
- Replace mutable idCounter with random-based ID generation for thread-safety
- Add documentation explaining copy() behavior with default parameters

AndroidCodeParserFactory.kt:
- Fix line number tracking in extractJvmImports, extractPythonImports, extractJsImports
  to use actual line numbers from match positions instead of sequential counters
- Replace hashCode-based ID with deterministic composite ID (filePath:startLine:qualifiedName)
- Add comment explaining the approximate endLine calculation for regex-based parsing
refactor: extract shared renderer models and utils to mpp-core
Introduce a custom ANSI terminal renderer for IntelliJ IDEA using Jewel theming, with support for colors and formatting. Enable "Open in Terminal" for command outputs via a compatibility layer for different IDEA versions. Persist agent type preference to config to avoid UI flicker.
Show exit code, execution time, and output for live terminal sessions after completion. Prevent summarization or replacement of real-time terminal output. Improve fallback terminal API handling for older IDEA versions.
Deleted obsolete IdeaInputSection to clean up the codebase.
- Move model selector to left side of toolbar
- Add MCP settings and prompt optimization buttons to right side
- Create IdeaDevInEditorInput component with hybrid Swing/Compose UI
- Add AutoAwesome icon for prompt optimization
- Initialize PromptEnhancer and ConfigManager integration
- Add placeholders for dialogs (to be implemented)
- Add auto-completion trigger for @, /, $, : characters
- Try to use DevIn file type if available for syntax highlighting
- Integrate with AutoPopupController for programmatic completion
- Add PsiDocumentManager for document-PSI synchronization
- Fall back to plain text if DevIn language is not available
- Create IdeaMcpConfigDialog with two tabs: Tools and MCP Servers
- Implement auto-save functionality with 2 seconds delay
- Add real-time JSON validation for MCP server configuration
- Support incremental MCP server loading with progress indication
- Use Jewel UI components (DefaultButton, OutlinedButton, Checkbox, etc.)
- Integrate with IdeaDevInEditorInput component
- Create IdeaPromptOptimizationDialog with side-by-side comparison
- Display original and enhanced prompts
- Auto-enhance on dialog open using PromptEnhancer
- Allow editing of enhanced text before applying
- Integrate with IdeaDevInEditorInput component
- Support Ctrl+P keyboard shortcut (via toolbar button)
- Add SmartToy icon for model selector (robot/AI icon)
- Make model selector blend with background using hover effects
- Remove workspace/project name display (not needed in IDEA)
- Add border and rounded corners to IdeaDevInEditorInput
- Add padding to editor panel for better spacing
- Simplify token display to compact format (e.g., '1234t')
- Reduce toolbar padding for cleaner look
- Create IdeaTopToolbar component with @ and / triggers moved from bottom
- Add file selection buttons (clipboard, save, cursor, add file)
- Add file chips display with remove functionality
- Add new icons: ContentPaste, Save, TextFields, InsertDriveFile, Close
- Simplify IdeaBottomToolbar by removing @ and / buttons
- Update IdeaDevInEditorInput to use new top toolbar layout
- Update IdeaAgentApp to match new toolbar API
Deleted IdeaDevInEditorInput.kt as it is no longer needed.
- Use IdeaVerticalResizableSplitPane to separate timeline content and input area
- Allow dynamic resizing of input area (30% to 90% of available space)
- Initial split ratio set to 75% for content, 25% for input
- Apply resizable layout to CODING, LOCAL_CHAT, and REMOTE agent types
- CODE_REVIEW and KNOWLEDGE modes use fixed layout (no input area)
- Change SwingPanel from fixed height (120.dp) to weight(1f) for dynamic sizing
- Change Column modifier from fillMaxWidth to fillMaxSize
- Remove fixed preferredSize from JPanel wrapper
- EditorTextField now properly resizes when dragging the split pane divider
…input

- Add alignment = BottomStart to Popup to make it appear above the selector
- This prevents the dropdown from covering the input area when opened
Integrates DevIn language for completion and syntax highlighting, replaces kotlinx.serialization with Gson for JSON handling, updates dependencies, and improves Gradle configuration.
Define required extension points in plugin.xml to support devins-lang integration.
feat(mpp-idea): migrate DevInEditorInput functionality to mpp-idea module
@phodal phodal merged commit bbe9401 into unit-mesh:master Dec 1, 2025
3 checks passed
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