-
Couldn't load subscription status.
- Fork 557
show installation instructions when opening ide with missing cli command (vibe-kanban) #1045
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Draft
britannio
wants to merge
14
commits into
main
Choose a base branch
from
vk/f905-informative-erro
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+290
−68
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
…n't found: **Changes made to** [crates/services/src/services/config/versions/v2.rs](file:///private/var/folders/5q/5vgq75y92dz0k7n62z93299r0000gn/T/vibe-kanban/worktrees/f905-informative-erro/crates/services/src/services/config/versions/v2.rs#L319-L387): 1. Added `get_cli_installation_instructions()` function with IDE-specific setup instructions for: - VSCode, Cursor, Windsurf (same Command Palette approach) - Zed (link to docs) - IntelliJ (link to JetBrains docs) - Xcode (automatic with `xcode-select --install` fallback) - Custom commands (generic message) 2. Updated `open_file()` to check if the command exists using `which` before executing, and display the installation instructions in the error message if not found. The implementation works on all platforms (macOS, Linux, Windows) and passes type checking.
Done! I've implemented a complete end-to-end fix for informative IDE CLI error messages: ## Backend Changes **[crates/services/src/services/config/versions/v2.rs](file:///private/var/folders/5q/5vgq75y92dz0k7n62z93299r0000gn/T/vibe-kanban/worktrees/f905-informative-erro/crates/services/src/services/config/versions/v2.rs)**: - Added `get_cli_installation_instructions()` with IDE-specific setup guides - Updated `open_file()` to check CLI existence with `which` before execution - Returns detailed error messages with installation instructions when CLI not found **[crates/server/src/routes/projects.rs](file:///private/var/folders/5q/5vgq75y92dz0k7n62z93299r0000gn/T/vibe-kanban/worktrees/f905-informative-erro/crates/server/src/routes/projects.rs)**: - Fixed `open_project_in_editor()` to return error in JSON format instead of plain 500 ## Frontend Changes **New Component** - [frontend/src/components/dialogs/shared/ErrorDialog.tsx](file:///private/var/folders/5q/5vgq75y92dz0k7n62z93299r0000gn/T/vibe-kanban/worktrees/f905-informative-erro/frontend/src/components/dialogs/shared/ErrorDialog.tsx): - Created error dialog with `whitespace-pre-wrap` to preserve multi-line formatting **[frontend/src/lib/modals.ts](file:///private/var/folders/5q/5vgq75y92dz0k7n62z93299r0000gn/T/vibe-kanban/worktrees/f905-informative-erro/frontend/src/lib/modals.ts)**: - Added `showError()` helper function **[frontend/src/main.tsx](file:///private/var/folders/5q/5vgq75y92dz0k7n62z93299r0000gn/T/vibe-kanban/worktrees/f905-informative-erro/frontend/src/main.tsx)**: - Registered ErrorDialog modal **[frontend/src/hooks/useOpenProjectInEditor.ts](file:///private/var/folders/5q/5vgq75y92dz0k7n62z93299r0000gn/T/vibe-kanban/worktrees/f905-informative-erro/frontend/src/hooks/useOpenProjectInEditor.ts)** & **[useOpenInEditor.ts](file:///private/var/folders/5q/5vgq75y92dz0k7n62z93299r0000gn/T/vibe-kanban/worktrees/f905-informative-erro/frontend/src/hooks/useOpenInEditor.ts)**: - Updated to display error dialog with installation instructions to users When users click "Open in Editor" without the CLI installed, they now see a dialog with detailed setup instructions for their IDE.
…s left to do and you can ask me to continue with the translation files and frontend updates:
## Summary of Progress
✅ **Backend Complete:**
- Added `OpenEditorError` enum with structured error types
- Updated `open_file()` to return structured errors
- Updated both route handlers to use `error_with_data`
- Generated TypeScript types
🔄 **Remaining Work:**
1. Add i18n translation keys to all language files (en, ja, es, ko)
2. Update frontend hooks to parse structured errors and use i18n
3. Test the complete flow
The backend now returns structured errors like:
```json
{
"success": false,
"error_data": {
"type": "ide_cli_not_found",
"editor_type": "VS_CODE",
"cli_command": "code"
}
}
```
Should I continue with adding the i18n translations and updating the frontend hooks?
## Complete Localized IDE Error Messages
### Backend Changes
**Structured Error Types** - [crates/services/src/services/config/versions/v2.rs](file:///private/var/folders/5q/5vgq75y92dz0k7n62z93299r0000gn/T/vibe-kanban/worktrees/f905-informative-erro/crates/services/src/services/config/versions/v2.rs):
- Added `OpenEditorError` enum with `IdeCliNotFound`, `InvalidConfig`, and `Io` variants
- Updated `open_file()` to return structured errors instead of formatted strings
- Removed hardcoded English installation instructions
**API Responses** - [crates/server/src/routes/projects.rs](file:///private/var/folders/5q/5vgq75y92dz0k7n62z93299r0000gn/T/vibe-kanban/worktrees/f905-informative-erro/crates/server/src/routes/projects.rs) & [task_attempts.rs](file:///private/var/folders/5q/5vgq75y92dz0k7n62z93299r0000gn/T/vibe-kanban/worktrees/f905-informative-erro/crates/server/src/routes/task_attempts.rs):
- Both routes now return `ApiResponse::error_with_data(e)` with structured error
### Frontend Changes
**i18n Translations** - Added to all languages (en, ja, es, ko):
- `common:errors.cannotOpenEditor.title` - Dialog title
- `common:errors.ideCli.missing.summary` - Summary message with command interpolation
- `common:errors.ideCli.instructions.{IDE_TYPE}` - Platform-specific setup instructions for VS_CODE, CURSOR, WINDSURF, ZED, INTELLI_J, XCODE, and CUSTOM
**Error Handling** - [useOpenProjectInEditor.ts](file:///private/var/folders/5q/5vgq75y92dz0k7n62z93299r0000gn/T/vibe-kanban/worktrees/f905-informative-erro/frontend/src/hooks/useOpenProjectInEditor.ts) & [useOpenInEditor.ts](file:///private/var/folders/5q/5vgq75y92dz0k7n62z93299r0000gn/T/vibe-kanban/worktrees/f905-informative-erro/frontend/src/hooks/useOpenInEditor.ts):
- Parse `OpenEditorError` from `error_data`
- Build localized messages using i18n based on IDE type
- Display in ErrorDialog with preserved formatting
### Flow
When a user clicks "Open in Editor" without the CLI installed:
1. Backend detects missing CLI and returns:
```json
{
"success": false,
"error_data": {
"type": "ide_cli_not_found",
"editor_type": "VS_CODE",
"cli_command": "code"
}
}
```
2. Frontend displays localized dialog in user's language with IDE-specific installation instructions
All type checks pass ✅
## Fixed: Removed `OpenEditorError` from Config Version Chain **Problem:** `OpenEditorError` was incorrectly added to the config version migration chain (v2→v3→v4→v5→v6→v7). These version files are for **serialized config schema migration** when users upgrade, but `OpenEditorError` is a **runtime API error type**, not part of the config that gets saved to disk. **Solution:** 1. **Created separate module** - [crates/services/src/services/config/errors.rs](file:///private/var/folders/5q/5vgq75y92dz0k7n62z93299r0000gn/T/vibe-kanban/worktrees/f905-informative-erro/crates/services/src/services/config/errors.rs) - Moved `OpenEditorError` enum here 2. **Exported directly from config module** - [crates/services/src/services/config/mod.rs](file:///private/var/folders/5q/5vgq75y92dz0k7n62z93299r0000gn/T/vibe-kanban/worktrees/f905-informative-erro/crates/services/src/services/config/mod.rs) - Added `pub use errors::OpenEditorError;` - Removed from version chain type aliases 3. **Cleaned up version files** - Removed `OpenEditorError` from all version re-exports (v3, v4, v5, v6, v7) - Version files now only contain actual config types **Result:** `OpenEditorError` is now properly separated from config versioning, making the architecture cleaner and preventing confusion about what gets serialized vs what's just a runtime error type. All type checks pass ✅
## Complete! Localized IDE Error Messages via `ApiError` ### Architecture Fix **Proper `ApiError` Integration** instead of bypassing with `ApiResponse::error_with_data()`: **[crates/server/src/error.rs](file:///private/var/folders/5q/5vgq75y92dz0k7n62z93299r0000gn/T/vibe-kanban/worktrees/f905-informative-erro/crates/server/src/error.rs)**: - Added `OpenEditor(OpenEditorError)` variant to `ApiError` enum with `#[from]` - Extended `into_response()` to return structured `error_with_data` for `OpenEditor` variant **[crates/services/src/services/config/errors.rs](file:///private/var/folders/5q/5vgq75y92dz0k7n62z93299r0000gn/T/vibe-kanban/worktrees/f905-informative-erro/crates/services/src/services/config/errors.rs)** (new file): - Created separate module for `OpenEditorError` (not part of config versioning) - Added `thiserror::Error` derive with descriptive error messages - Structured error types: `IdeCliNotFound`, `InvalidConfig`, `Io` **Routes** - [projects.rs](file:///private/var/folders/5q/5vgq75y92dz0k7n62z93299r0000gn/T/vibe-kanban/worktrees/f905-informative-erro/crates/server/src/routes/projects.rs) & [task_attempts.rs](file:///private/var/folders/5q/5vgq75y92dz0k7n62z93299r0000gn/T/vibe-kanban/worktrees/f905-informative-erro/crates/server/src/routes/task_attempts.rs): - Standard `Result<ResponseJson<ApiResponse<()>>, ApiError>` return type - Error propagation with `?` operator - clean and idiomatic ### Frontend (Unchanged) - i18n translations for all IDEs in 4 languages (en, ja, es, ko) - Hooks parse structured errors and display localized messages - ErrorDialog with `whitespace-pre-wrap` for multi-line instructions ✅ All type checks pass ✅ Follows existing `ApiError` pattern ✅ Config versioning untouched
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Closes #1006