-
Notifications
You must be signed in to change notification settings - Fork 17
feat(error-page): Copy to clipboard #994
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
…nd enhance error reporting
✅ Deploy Preview for cedarjs canceled.
|
|
I'm not too sure how to actually test the new page in a working stack. That's probably easy for you. |
Ja, I'll take care of that |
|
| Command | Status | Duration | Result |
|---|---|---|---|
nx run-many -t build:pack --exclude create-ceda... |
✅ Succeeded | 2s | View ↗ |
nx run-many -t build |
✅ Succeeded | 4s | View ↗ |
nx run-many -t test --minWorkers=1 --maxWorkers=4 |
✅ Succeeded | 5s | View ↗ |
nx run-many -t test:types |
✅ Succeeded | 9s | View ↗ |
☁️ Nx Cloud last updated this comment at 2026-01-20 20:51:32 UTC
Greptile OverviewGreptile SummaryThis PR adds a "Copy All" button to the fatal error page that allows users to copy formatted error details (including error type, message, request/response context, and stack trace) to the clipboard. This makes it easier to share error information with AI assistants or when reporting bugs. Key Changes:
Issues Identified:
The core functionality is sound and the feature adds genuine value, but the test coverage needs improvement and there are defensive coding opportunities to handle edge cases more gracefully. Confidence Score: 3/5
Important Files ChangedFile Analysis
Sequence DiagramsequenceDiagram
participant User
participant DevFatalErrorPage
participant formatErrorForClipboard
participant navigator.clipboard
participant setState
User->>DevFatalErrorPage: Clicks "Copy All" button
DevFatalErrorPage->>formatErrorForClipboard: Call with (err, stack, typeName, msg, err)
formatErrorForClipboard->>formatErrorForClipboard: Build error report lines
formatErrorForClipboard->>formatErrorForClipboard: Add error type & message
formatErrorForClipboard->>formatErrorForClipboard: Extract request details
formatErrorForClipboard->>formatErrorForClipboard: JSON.stringify variables & response
formatErrorForClipboard->>formatErrorForClipboard: Iterate stack.items for trace
formatErrorForClipboard->>formatErrorForClipboard: Add source code context
formatErrorForClipboard-->>DevFatalErrorPage: Return formatted string
DevFatalErrorPage->>navigator.clipboard: writeText(errorText)
alt Clipboard write succeeds
navigator.clipboard-->>DevFatalErrorPage: Success
DevFatalErrorPage->>setState: setCopyFeedback('✓ Copied to clipboard')
DevFatalErrorPage->>DevFatalErrorPage: setTimeout to clear feedback (3s)
else Clipboard write fails
navigator.clipboard-->>DevFatalErrorPage: Error
DevFatalErrorPage->>setState: setCopyFeedback('Failed to copy')
DevFatalErrorPage->>DevFatalErrorPage: setTimeout to clear feedback (3s)
end
DevFatalErrorPage-->>User: Show feedback message
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
7 files reviewed, 7 comments
packages/web/src/components/__tests__/DevFatalErrorPage.test.tsx
Outdated
Show resolved
Hide resolved
2d37582 to
32f5875
Compare
|
You updating the testing docs, made me wonder, if we should add some cedar specific context, so that it knows to query https://cedarjs.com/llms-full.txt for e.g. |
|
@razzeee I have no idea why this is failing on Windows. Do you (or someone at your work) have a Windows computer you could test this on? |
|
Test fixed itself after I just triggered a rerun 🤷 |
|
And now the web tests failed again, but on Ubuntu this time. Definitely too flaky :( |
|
It passed CI twice. I still don't like that it was flaky, but let's see how it behaves over the next few days |
|
The changes in this PR are now available in 3.0.0-canary.13210+975f5db67 |

Add clipboard functionality to copy error details and enhance error reporting
The idea is to make it easier to grab the whole context, to be able to feed it into an AI or report it here.