Repository navigation
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
7 Skipped Deployments
|
|
This pull request has been ignored for the connected project Preview Branches by Supabase. |
|
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Central YAML (base), Repository UI (inherited), Organization UI (inherited) Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (7)
🚧 Files skipped from review as they are similar to previous changes (4)
📝 WalkthroughSummary by CodeRabbit
WalkthroughAdds a Studio error-handling system: a new ErrorMatcher component that normalizes errors, matches them against ERROR_MAPPINGS, and renders targeted troubleshooting UI or a generic ErrorDisplay with a support link; new TroubleshootingAccordion and TroubleshootingSections (restart project/database, external guide, AI debug) with telemetry hooks; RestartProjectDialog to perform restarts; ConnectionTimeout mapping that opens the troubleshooting flow and can invoke the AI assistant; ErrorDisplay UI and types; telemetry constants extended for inline troubleshooter events; TableEditorMenu updated to use ErrorMatcher; support URL formatting tightened; docs, examples, and tests added. Sequence Diagram(s)sequenceDiagram
participant UI as UI Layer (e.g., TableEditorMenu)
participant EM as ErrorMatcher
participant MAP as ERROR_MAPPINGS
participant TEL as Telemetry
participant TS as Troubleshooting Components
participant AI as AI Assistant / Sidebar
participant SUPPORT as Support Form
UI->>EM: Render(title, error, supportFormParams)
EM->>EM: Normalize error -> message
EM->>EM: build supportUrl via createSupportFormUrl
EM->>MAP: Match message against patterns
alt mapping found
MAP-->>EM: Return mapping (id, troubleshooting UI)
EM->>TEL: Emit inline_error_troubleshooter_shown (errorType)
EM->>TS: Render troubleshooting UI (Accordion + Sections)
TS->>TEL: Emit inline_error_troubleshooter_accordion_toggled on toggle
opt user clicks restart
TS->>UI: Open RestartProjectDialog
UI->>UI: Call restart mutation
UI->>TEL: Emit inline_error_troubleshooter_action_clicked (restart_db)
end
opt user clicks troubleshooting guide
TS->>TEL: Emit inline_error_troubleshooter_action_clicked (troubleshooting_guide)
TS->>SUPPORT: Open external guide link
end
opt user triggers AI debug
TS->>AI: Open sidebar & initialize chat (buildPrompt)
TS->>TEL: Emit inline_error_troubleshooter_action_clicked (ask_ai)
end
opt user clicks contact support
TS->>TEL: Emit inline_error_troubleshooter_action_clicked (contact_support)
TS->>SUPPORT: Open supportUrl
end
else no mapping
MAP-->>EM: No match
EM->>TEL: (optional) Emit DashboardErrorCreatedEvent with source='error_display'
EM->>UI: Render ErrorDisplay with supportUrl
end
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
🎭 Playwright Test ResultsDetails
Skipped testsFeatures › sql-editor.spec.ts › SQL Editor › snippet favourite works as expected |
This comment has been minimized.
This comment has been minimized.
seanoliver
left a comment
There was a problem hiding this comment.
Looking good from a growth eng / telemetry POV! I just dropped in a few minor notes on naming consistency that I noticed!
kemaldotearth
left a comment
There was a problem hiding this comment.
Is it possible when we do have space above a certain viewport we adhere to the alignment below?
One thing I was wondering with the the placement in the sidebar, I think we could potentially do something similar to our feature preview enable popover. E.g. we have a smaller version of our error card, a button that says "Troubleshoot" (or similar) and we can open the error display as a dialog?
| aria-labelledby="error-display-title" | ||
| {...props} | ||
| > | ||
| <CardHeader className="flex-row items-center gap-2.5 space-y-0 py-2 px-3"> |
There was a problem hiding this comment.
Vertical padding is too snug, I believe I had it 12px / p-3 in the design file. Gives it bit more room to breathe.
@kemaldotearth |
Ahh I seem to remember |
@kemaldotearth yea 100% go for it, this is just v1 we can keep improving it and adding it to more places. |
kemaldotearth
left a comment
There was a problem hiding this comment.
✅ to keep it moving!
seanoliver
left a comment
There was a problem hiding this comment.
Telemetry side looks great!
Braintrust eval report
|
When the dashboard hits a DB connection timeout, users currently see a
raw error message with no
path forward. This PR adds an inline troubleshooting system that detects
known error types and
surfaces contextual next steps — restart the DB, read the docs, or debug
with AI.
## Changes
- New ErrorDisplay component (packages/ui-patterns) — styled error card
with a title, monospace error
block, optional troubleshooting slot, and a "Contact support" link that
always renders. Accepts
typed supportFormParams to pre-fill the support form.
- Error classification in handleError (data/fetchers.ts) — on every API
error, the message is tested
against ERROR_PATTERNS. If matched, handleError throws a typed subclass
(ConnectionTimeoutError
extends ResponseError) instead of a plain ResponseError. Stack traces
now show the exact error
class. All existing instanceof ResponseError checks continue to work.
- ErrorMatcher component — reads errorType from the thrown class
instance, does an O(1) lookup into
ERROR_MAPPINGS, and renders the matching troubleshooting accordion as
children of ErrorDisplay.
Falls back to plain ErrorDisplay for unclassified errors.
- Connection timeout mapping — first error type wired up, with three
troubleshooting steps: restart
the database, link to the docs, and "Debug with AI" (opens the AI
assistant sidebar with a
pre-filled prompt).
- Telemetry — three new typed events track when the troubleshooter is
shown, when accordion steps are
toggled, and which CTAs are clicked.
## Adding a new error type
1. Add a class to types/api-errors.ts
2. Add { pattern, ErrorClass } to data/error-patterns.ts
3. Create a troubleshooting component in errorMappings/
4. Add an entry to error-mappings.tsx
When the dashboard hits a DB connection timeout, users currently see a raw error message with no
path forward. This PR adds an inline troubleshooting system that detects known error types and
surfaces contextual next steps — restart the DB, read the docs, or debug with AI.
Changes
New ErrorDisplay component (packages/ui-patterns) — styled error card with a title, monospace error
block, optional troubleshooting slot, and a "Contact support" link that always renders. Accepts
typed supportFormParams to pre-fill the support form.
Error classification in handleError (data/fetchers.ts) — on every API error, the message is tested
against ERROR_PATTERNS. If matched, handleError throws a typed subclass (ConnectionTimeoutError
extends ResponseError) instead of a plain ResponseError. Stack traces now show the exact error
class. All existing instanceof ResponseError checks continue to work.
ErrorMatcher component — reads errorType from the thrown class instance, does an O(1) lookup into
ERROR_MAPPINGS, and renders the matching troubleshooting accordion as children of ErrorDisplay.
Falls back to plain ErrorDisplay for unclassified errors.
Connection timeout mapping — first error type wired up, with three troubleshooting steps: restart
the database, link to the docs, and "Debug with AI" (opens the AI assistant sidebar with a
pre-filled prompt).
Telemetry — three new typed events track when the troubleshooter is shown, when accordion steps are
toggled, and which CTAs are clicked.
Adding a new error type