Skip to content

Add 'Explain this error' AI CTA to all error surfaces#9221

Open
ericokuma wants to merge 19 commits intomainfrom
eokuma/ai-error-resolution
Open

Add 'Explain this error' AI CTA to all error surfaces#9221
ericokuma wants to merge 19 commits intomainfrom
eokuma/ai-error-resolution

Conversation

@ericokuma
Copy link
Copy Markdown
Contributor

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.

  • New composeErrorPrompt() utility builds structured prompts from error metadata, with credential stripping for connector files and a 2000-char length cap
  • New ExplainErrorButton component using SparklesIcon that calls sidebarActions.startChat(prompt)
  • Button added to: 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:

  • Covered by tests
  • Ran it and it works as intended
  • Reviewed the diff before requesting a review
  • Checked for unhandled edge cases
  • Linked the issues it closes
  • Checked if the docs need to be updated. If so, create a separate Linear DOCS issue
  • Intend to cherry-pick into the release branch
  • I'm proud of this work!

Developed in collaboration with Claude Code

@ericokuma ericokuma force-pushed the eokuma/ai-error-resolution branch from 525568a to 6844151 Compare April 10, 2026 21:42
@ericokuma ericokuma requested a review from AdityaHegde April 10, 2026 22:33
ericokuma and others added 18 commits April 10, 2026 15:35
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>
@ericokuma ericokuma force-pushed the eokuma/ai-error-resolution branch from d98adfa to e225a31 Compare April 10, 2026 22:36
@ericokuma
Copy link
Copy Markdown
Contributor Author

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
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.

1 participant