Skip to content

Conversation

@improdead
Copy link
Owner

No description provided.

@improdead improdead requested a review from Copilot September 1, 2025 00:19
Copy link

Copilot AI left a 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.

Comment on lines +7 to +9
const prefix = lines.slice(0, line).join('\n')
const base = prefix.length + (line > 0 ? 1 : 0)
return base + Math.max(0, pos.character)
Copy link

Copilot AI Sep 1, 2025

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.

Suggested change
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

Copilot uses AI. Check for mistakes.
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)
Copy link

Copilot AI Sep 1, 2025

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.

Copilot uses AI. Check for mistakes.
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]
Copy link

Copilot AI Sep 1, 2025

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.

Copilot uses AI. Check for mistakes.
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