Skip to content

feat: open the issue-report modal from the error fallback - #10875

Merged
kirangadhave merged 5 commits into
mainfrom
kg/error-report-button
Sep 17, 2026
Merged

kirangadhave merged 5 commits into
mainfrom
kg/error-report-button

Conversation

@kirangadhave

@kirangadhave kirangadhave commented Sep 16, 2026

Copy link
Copy Markdown
Member

📝 Summary

Adds Report an issue to the shared React error fallback so a crashed cell (or a startup/root/island failure) can open the existing issue-report modal instead of a plain GitHub link.

The fallback owns a local dialog because a root crash removes ModalProvider. FeedbackModal reads the nullable requestClientAtom instead of useRequestClient(), because that hook throws when the client is still unset — which is exactly when this screen can appear. Other callers keep the strict hook. A missing client yields partial environment details, no Retry, and disabled notebook source.

Related: MO-7659

FeedbackModal now reads a nullable request client so a crash-time
report still produces partial environment details. Source collection
and environment retry stay disabled until a client exists.
The shared error screen now owns a local dialog and mounts
FeedbackModal with the application store, because root crashes
remove ancestor modal and tooltip providers.
Boundary tests exercise provider loss, a missing client, closed-dialog
request skipping, focus restore, retry, and source opt-in.
@vercel

vercel Bot commented Sep 16, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
marimo-docs Ready Ready Preview Sep 17, 2026 5:22pm UTC

Request Review

@github-actions

Copy link
Copy Markdown
Contributor

All contributors have signed the CLA ✍️ ✅
Posted by the CLA Assistant Lite bot.

@kirangadhave
kirangadhave marked this pull request as ready for review September 16, 2026 22:00
Copilot AI lite review requested due to automatic review settings September 16, 2026 22:00
@kirangadhave kirangadhave added the enhancement New feature or request label Sep 16, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

Add a local fallback Toaster and correct the missing-client explanation before approval.

Get a fresh assessment by requesting another Copilot review.

Pull request overview

Adds issue reporting to React error fallbacks, including partial diagnostics when the request client is unavailable.

Changes:

  • Adds a local FeedbackModal dialog to error fallbacks.
  • Supports nullable request clients and disabled notebook source.
  • Adds coverage for fallback, diagnostics, focus, and recovery behavior.
File summaries
File Summary Review notes
frontend/src/components/editor/chrome/components/feedback-button.tsx Handles nullable clients and partial diagnostics. Nit (1 vote): explain missing-client state before notebook/connection checks.
frontend/src/components/editor/chrome/components/__tests__/feedback-button.test.tsx Tests missing-client and retry scenarios.
frontend/src/components/editor/boundary/ErrorBoundary.tsx Adds the report action and standalone dialog. Moderate (2 votes): mount a local Toaster in the fallback.
frontend/src/components/editor/boundary/__tests__/ErrorBoundary.test.tsx Tests dialog integration and recovery behavior.
Review details

Suppressed comments (1)

frontend/src/components/editor/chrome/components/feedback-button.tsx:121

  • requestClient != null is now part of notebookSourceAvailable, but it is not represented in this reason chain. In the startup/root fallback the connection defaults to NOT_STARTED (and the filename may still be unset), so a missing client is reported as “Connect the notebook…” or “Save the notebook first” even though neither action can restore source access. Check the missing-client case before the notebook/connection checks so the explanation matches the disabled state.
        : connection.state !== WebSocketState.OPEN
          ? "Connect the notebook to include its source."
          : "Notebook source is unavailable.";
  • Files reviewed: 4/4 changed files
  • Comments generated: 1
  • Review effort level: Lite

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread frontend/src/components/editor/boundary/ErrorBoundary.tsx
@github-actions

github-actions Bot commented Sep 16, 2026

Copy link
Copy Markdown
Contributor

Coverage Report for ./frontend

Status Category Percentage Covered / Total
🔵 Lines 58.66% 22492 / 38341
🔵 Statements 58.59% 22888 / 39060
🔵 Functions 51.8% 5083 / 9811
🔵 Branches 52.39% 11921 / 22751
File Coverage
File Stmts Branches Functions Lines Uncovered Lines
Changed Files
frontend/src/components/editor/boundary/ErrorBoundary.tsx 100% 100% 100% 100%
frontend/src/components/editor/chrome/components/feedback-button.tsx 84.21% 82.81% 64.28% 83.92% 87, 90, 99-102, 123, 172, 185-189, 226
frontend/src/components/ui/use-toast.ts 77.46% 60% 69.56% 77.14% 67, 90-93, 134-148, 166, 187-190, 193-201, 220-221
Generated in workflow #21560 for commit e15ed78 by the Vitest Coverage Report Action

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All reported issues were addressed across 4 files

Reply with feedback, questions, or to request a fix.

Re-trigger cubic

Comment thread frontend/src/components/editor/boundary/ErrorBoundary.tsx
Comment thread frontend/src/components/editor/chrome/components/feedback-button.tsx Outdated
Comment thread frontend/src/components/editor/boundary/ErrorBoundary.tsx Outdated
Mount a local Toaster after a root crash, lazy-load FeedbackModal so
table tests do not hit a static-state mock TDZ, and explain a missing
request client before connection state.
Light2Dark
Light2Dark previously approved these changes Sep 17, 2026
Comment on lines +113 to +121
const notebookSourceReason = notebookSourceAvailable
? undefined
: filename === null
? "Save the notebook first."
: !codeAvailable
? "Notebook source is hidden in this view."
: "Connect the notebook to include its source.";
: requestClient == null
? "Notebook source is unavailable."
: filename === null
? "Save the notebook first."
: !codeAvailable
? "Notebook source is hidden in this view."
: "Connect the notebook to include its source.";

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit, but can we avoid this nested ternary for readability

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done!

Replace the nested ternary with an early-return helper so the missing-client
explanation stays readable.
@kirangadhave
kirangadhave merged commit dd4bf43 into main Sep 17, 2026
29 checks passed
@kirangadhave
kirangadhave deleted the kg/error-report-button branch September 17, 2026 17:57

This branch was successfully deployed

1 active deployment
Preview e15ed78b Deployed Sep 17, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants