-
Notifications
You must be signed in to change notification settings - Fork 1
Feat/hard errors diff preview #2
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
base: main
Are you sure you want to change the base?
Conversation
…d (config + tsconfig + root layout), and add unified diff preview; update docs
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR implements hard error handling and diff preview improvements for the Vector Studio plugin and backend. The main purpose is to enhance error handling by surfacing HTTP and parsing errors to the plugin UI, and improve diff previews by adding unified diff generation on the server side.
- Enhanced error handling with proper HTTP status codes and error bubbling to the plugin UI
- Added unified diff preview generation on the server that's displayed in the plugin
- Improved settings UI with a test button and better layout
Reviewed Changes
Copilot reviewed 14 out of 17 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| warp/plugin/src/main.server.lua | Enhanced UI with settings button, improved error handling for HTTP and parsed errors, and better diff preview display |
| warp/apps/web/lib/orchestrator/index.ts | Added diff preview generation and improved provider error handling |
| warp/apps/web/lib/diff/rangeEdits.ts | New utility for applying range edits and generating unified diffs |
| warp/apps/web/lib/catalog/search.ts | Replaced stub fallback with proper error handling |
| warp/apps/web/tsconfig.json | Updated to proper Next.js TypeScript configuration |
| warp/apps/web/next.config.ts | Removed TypeScript config file |
| warp/apps/web/next.config.mjs | Added ESM Next.js config file |
| warp/apps/web/app/layout.tsx | Added root layout component |
| warp/apps/web/app/page.tsx | Updated API endpoint documentation |
| warp/apps/web/app/api/proposals/route.ts | Fixed import path |
| warp/apps/web/app/api/chat/route.ts | Improved error response handling |
| warp/apps/web/app/api/assets/search/route.ts | Added proper error handling |
| docs/IMPLEMENTATION_STATUS.md | New comprehensive implementation status documentation |
| Warp.md | Updated to reference new status documentation |
Files not reviewed (1)
- warp/apps/web/package-lock.json: Language not supported
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
| const prefix = lines.slice(0, line).join('\n') | ||
| const base = prefix.length + (line > 0 ? 1 : 0) | ||
| return base + Math.max(0, pos.character) |
Copilot
AI
Sep 1, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The function doesn't handle the case where pos.character exceeds the line length, which could place the cursor beyond the actual line content. Consider clamping pos.character to the actual line length.
| const prefix = lines.slice(0, line).join('\n') | |
| const base = prefix.length + (line > 0 ? 1 : 0) | |
| return base + Math.max(0, pos.character) | |
| const lineContent = lines[line] ?? '' | |
| const character = Math.max(0, Math.min(pos.character, lineContent.length)) | |
| const prefix = lines.slice(0, line).join('\n') | |
| const base = prefix.length + (line > 0 ? 1 : 0) | |
| return base + character |
| const old = input.context.activeScript?.text || '' | ||
| const next = applyRangeEdits(old, edits) | ||
| const unified = simpleUnifiedDiff(old, next, path) | ||
| proposals.push({ id: id('edit'), type: 'edit', path, notes: `Parsed from ${name}`, diff: { mode: 'rangeEDITS', edits }, preview: { unified } } as any) |
Copilot
AI
Sep 1, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Using as any bypasses type safety. Consider defining a proper type for the proposal object with the preview field or use a type assertion to a more specific type.
| notes: providerContent ? 'Provider response did not include a valid tool call; generated fallback edit.' : 'Insert a comment at the top as a placeholder for an edit.', | ||
| diff: { mode: 'rangeEDITS', edits }, | ||
| preview: { unified }, | ||
| } as any] |
Copilot
AI
Sep 1, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Using as any bypasses type safety. Consider defining a proper type for the proposal object with the preview field or use a type assertion to a more specific type.
No description provided.