Add 'Explain this error' AI CTA to all error surfaces#9221
Conversation
525568a to
6844151
Compare
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Bump padding from py-0.5 to py-1 and icon from 12px to 14px for better accessibility on the "Explain this error" button. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Switch from text-accent-primary-action to text-primary-600 for WCAG AA compliance (5.17:1 vs 3.89:1 on bg-destructive/15) - Move "Explain this error" button to bottom-left of error containers instead of right-aligned inline Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Add `large` prop to ExplainErrorButton that renders a 28px-height bordered button matching the design system's secondary button scale. Applied to Canvas and Explore full-page error views where the inline pill treatment was visually undersized next to the ErrorPage layout. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Both inline and large variants now always show a visible primary-600 border, so the button always looks like a button rather than text that transforms on hover. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Solid bg-primary-600 with white text instead of transparent fill. Makes the AI action more prominent and clearly clickable in error contexts. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Neutral dark button that doesn't compete with the red error context or imply a brand/AI-specific action color. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
bg-surface-muted with text-fg-primary and a visible border for distinction against the red error banner background. Passes WCAG AA in both light mode (16:1) and dark mode (11.9:1). Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Restructure the error banner layout so the icon and text+button are in a flex row. The button sits in the same column as the error text, ensuring perfect left-alignment. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
… containers Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
d98adfa to
e225a31
Compare
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
AdityaHegde
left a comment
There was a problem hiding this comment.
Would be good to try a minimal version of this by just saying, Fix the errors in <file_path>
| parts.push(""); | ||
|
|
||
| // Error message | ||
| parts.push(`**Error:** ${errorMessage}`); |
There was a problem hiding this comment.
Do we need to send the error? LLM can get parser errors using tool calls.
| const sanitized = isConnector ? stripCredentials(fileContent) : fileContent; | ||
| const context = extractContext(sanitized, lineNumber); | ||
| if (context) { | ||
| codeBlockStart = parts.length; |
There was a problem hiding this comment.
Same here, LLM can get the contents of the file and map the line number from errors to the relevant parts.
Address review feedback: let the LLM agent fetch parser errors and file content via tool calls instead of pre-composing them into the prompt. Removes `errorMessage`, `fileContent`, `lineNumber`, and `additionalErrorCount` props from `ExplainErrorButton` and its callers. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|
Addressed feedback! |
AdityaHegde
left a comment
There was a problem hiding this comment.
Approving a few nits. Works great otherwise! Was able to fix issues in underlying metrics view from a canvas.
| @@ -0,0 +1,7 @@ | |||
| /** | |||
There was a problem hiding this comment.
nit: this is not needed, lets move this into the button component below.
| @@ -0,0 +1,9 @@ | |||
| import { describe, it, expect } from "vitest"; | |||
There was a problem hiding this comment.
Same with this, testing the prompt generation is overkill.
- Inline the minimal "Fix the errors in <file_path>" prompt into the button; remove error-prompt-composer.ts and its spec - Rename ExplainErrorButton to ExplainAndFixErrorButton to match what it does
|
@copilot resolve the merge conflicts in this pull request |
…ution # Conflicts: # web-local/src/routes/(application)/(workspace)/files/[...file]/+page.svelte
Adds an "Explain this error" button to every error displayed in Rill Developer's code and visual editors. Clicking it opens the AI chat panel with a pre-composed prompt containing the error message, file path, resource type, line number, and surrounding code context.
composeErrorPrompt()utility builds structured prompts from error metadata, with credential stripping for connector files and a 2000-char length capExplainErrorButtoncomponent usingSparklesIconthat callssidebarActions.startChat(prompt)WorkspaceEditorContainer(code view banner),ModelWorkspace(table errors),ExploreWorkspace(visual error page),CanvasLoadingState(canvas errors),SubmissionError(connector forms, optional)Closes APP-850, APP-851, APP-852
Checklist:
Developed in collaboration with Claude Code