Conversation
Remove file path from toolName and use only displayName for clarity.
Use project.basePath for process execution and set terminal output bubble to collapsed by default.
Display tool output in the timeline bubble header, truncating with ellipsis and falling back to params if output is unavailable. UI now handles overflow without fixed truncation.
WalkthroughThis pull request refactors project execution logic to remove global ProjectManager dependency, simplifies tool call display formatting in the renderer, adjusts UI component default states, and restructures tool call bubble UI to dynamically display output in headers with fixed-width constraints and improved spacing handling. Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes
Possibly related PRs
Poem
Pre-merge checks and finishing touches❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
Actionable comments posted: 0
🧹 Nitpick comments (2)
mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/components/timeline/IdeaToolCallBubble.kt (2)
104-109: Consider adding width constraints to prevent layout issues.The comment mentions "fixed width" for the tool name, but there's no explicit
width()orminWidth()modifier. Very long tool names could still push other elements off-screen, while very short names might leave too much space.Consider applying a width constraint:
// Tool name (fixed width, no shrink) Text( text = item.toolName, style = JewelTheme.defaultTextStyle.copy(fontWeight = FontWeight.Bold), - maxLines = 1 + maxLines = 1, + modifier = Modifier.widthIn(min = 60.dp, max = 120.dp) )
403-408: Good simplification - dynamic truncation is now UI-driven.Removing the fixed truncation logic aligns with the PR objectives. The UI now handles overflow dynamically through
TextOverflow.Ellipsis.Since this function now just returns the input unchanged, you could consider removing it entirely and using
item.outputdirectly at the call site (line 307). However, keeping it provides flexibility for future formatting needs.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (4)
core/src/main/kotlin/cc/unitmesh/devti/sketch/run/ProcessExecutor.kt(1 hunks)mpp-core/src/commonMain/kotlin/cc/unitmesh/agent/render/RendererUtils.kt(1 hunks)mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/components/timeline/IdeaTerminalOutputBubble.kt(1 hunks)mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/components/timeline/IdeaToolCallBubble.kt(5 hunks)
🧰 Additional context used
📓 Path-based instructions (2)
**/*.kt
📄 CodeRabbit inference engine (AGENTS.md)
**/*.kt: Useexpect/actualfor platform-specific code (e.g., file I/O on JVM/JS/Wasm) in Kotlin Multiplatform projects
Check export first if some functions are not working well with CLI (TypeScript)
In Kotlin/JS @JsExport: AvoidFlow, usePromiseinstead
In Kotlin/JS @JsExport: Use concrete classes as return types and parameter types; avoid interface types
For WASM platform, avoid using emoji and UTF-8 in code
Files:
mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/components/timeline/IdeaTerminalOutputBubble.ktcore/src/main/kotlin/cc/unitmesh/devti/sketch/run/ProcessExecutor.ktmpp-core/src/commonMain/kotlin/cc/unitmesh/agent/render/RendererUtils.ktmpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/components/timeline/IdeaToolCallBubble.kt
**/idea/**/*.kt
📄 CodeRabbit inference engine (AGENTS.md)
**/idea/**/*.kt: For SwingPanel z-index issues with Compose popups, enable Jewel's custom popup renderer:JewelFlags.useCustomPopupRenderer = trueinIdeaAgentToolWindowFactory
For popup/dropdown menus in IntelliJ plugins, use Jewel'sPopupMenuinstead ofandroidx.compose.ui.window.Popup
For dialogs in IntelliJ plugins, use IntelliJ'sDialogWrapperwithorg.jetbrains.jewel.bridge.composeinstead ofandroidx.compose.ui.window.Dialog
Files:
mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/components/timeline/IdeaTerminalOutputBubble.ktmpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/components/timeline/IdeaToolCallBubble.kt
🧠 Learnings (4)
📚 Learning: 2025-12-02T00:20:34.480Z
Learnt from: CR
Repo: phodal/auto-dev-sketch PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-02T00:20:34.480Z
Learning: Applies to **/compose/**/*.{kt,kts} : In 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/components/timeline/IdeaToolCallBubble.kt
📚 Learning: 2025-12-02T00:20:34.480Z
Learnt from: CR
Repo: phodal/auto-dev-sketch PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-02T00:20:34.480Z
Learning: Applies to **/idea/**/*.kt : For dialogs in IntelliJ plugins, use IntelliJ's `DialogWrapper` with `org.jetbrains.jewel.bridge.compose` instead of `androidx.compose.ui.window.Dialog`
Applied to files:
mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/components/timeline/IdeaToolCallBubble.kt
📚 Learning: 2025-12-02T00:20:34.480Z
Learnt from: CR
Repo: phodal/auto-dev-sketch PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-02T00:20:34.480Z
Learning: Applies to **/idea/**/*.kt : For popup/dropdown menus in IntelliJ plugins, use Jewel's `PopupMenu` instead of `androidx.compose.ui.window.Popup`
Applied to files:
mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/components/timeline/IdeaToolCallBubble.kt
📚 Learning: 2025-12-02T00:20:34.480Z
Learnt from: CR
Repo: phodal/auto-dev-sketch PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-02T00:20:34.480Z
Learning: Applies to {**/compose/**/*.kt,mpp-ui/src/jsMain/typescript/**/*.{ts,tsx}} : 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/components/timeline/IdeaToolCallBubble.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). (4)
- GitHub Check: Agent
- GitHub Check: Build (241)
- GitHub Check: Build (223)
- GitHub Check: Test mpp-core (KMP)
🔇 Additional comments (4)
mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/components/timeline/IdeaTerminalOutputBubble.kt (1)
48-48: LGTM! Improved default UX.Collapsing terminal output by default reduces visual clutter and aligns with the PR's UI improvements. Users can still expand on demand.
core/src/main/kotlin/cc/unitmesh/devti/sketch/run/ProcessExecutor.kt (1)
128-128: Excellent fix! Resolves the working directory bug.This correctly uses the project instance's
basePathinstead of the first opened project fromProjectManager. SinceProcessExecutoris a project-level service, it already has the correct project reference. This ensures shell commands execute in the right directory.mpp-core/src/commonMain/kotlin/cc/unitmesh/agent/render/RendererUtils.kt (1)
20-30: LGTM! Cleaner tool name display.Simplifying the tool name to just the display name (removing the file path) improves readability. The file path is still available in the
detailsfield for expanded views.mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/components/timeline/IdeaToolCallBubble.kt (1)
111-149: Excellent dynamic output handling!The new logic intelligently displays:
- Output when available (collapsed state)
- Parameters as fallback when no output (collapsed state)
- Spacer when expanded
The use of
weight(1f),TextOverflow.Ellipsis, andclipToBoundsensures the content dynamically fills available space with proper truncation. This aligns perfectly with the PR objectives to remove fixed 100-character truncation.
There was a problem hiding this comment.
Pull request overview
This PR fixes a critical bug in shell command execution and improves the UI presentation of tool call results. The ProcessExecutor was incorrectly using the first opened project's base path instead of the current project's path, which caused shell commands to execute in the wrong directory in multi-project scenarios. The UI improvements make tool output more readable by using dynamic text overflow instead of fixed truncation.
Key Changes
- Fixed ProcessExecutor to use the current project's basePath instead of first opened project
- Improved IdeaToolCallBubble to show dynamic output with proper text overflow handling
- Simplified tool names in RendererUtils to show only the tool type, moving path details to output
- Changed IdeaTerminalOutputBubble default state from expanded to collapsed
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| core/src/main/kotlin/cc/unitmesh/devti/sketch/run/ProcessExecutor.kt | Fixed shell command working directory by using project.basePath instead of ProjectManager.getInstance().openProjects.firstOrNull()?.basePath, ensuring commands execute in the correct project context |
| mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/components/timeline/IdeaToolCallBubble.kt | Improved UI to show dynamic output with TextOverflow.Ellipsis, prioritize output over params in summary, and removed fixed 100-character truncation from formatToolOutput |
| mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/components/timeline/IdeaTerminalOutputBubble.kt | Changed initial expanded state from true to false for better UX |
| mpp-core/src/commonMain/kotlin/cc/unitmesh/agent/render/RendererUtils.kt | Simplified tool names for ReadFile and WriteFile to show only the tool type (path details remain in output/details) |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Changes
1. Fix Shell Tool Working Directory (ProcessExecutor)
Problem: Shell commands were executing in the wrong directory (first opened project instead of current project)
Root Cause:
ProcessExecutor.createProcess()usedProjectManager.getInstance().openProjects.firstOrNull()?.basePathinstead of the current project's basePathSolution: Changed to use
project.basePathdirectly sinceProcessExecutoris a project-level service that already has the correct project reference2. Improve Tool Call Bubble UI (IdeaToolCallBubble)
Problem: Output was truncated at fixed 100 characters regardless of available space
Changes:
TextOverflow.EllipsisformatToolOutput...only when actually overflowingSummary by CodeRabbit
UI/UX Changes
Internal Improvements
✏️ Tip: You can customize this high-level summary in your review settings.