Repository navigation
Add a Copy button to debug toolbar errors - #4203
Merged
Merged
Conversation
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01YajzBFUtT3d7kErLkqaMr6
Each error in the debug toolbar now has a Copy button that copies the error message and its traceback. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01YajzBFUtT3d7kErLkqaMr6
errorToText joins the message, frontend stack and backend traceback. copyToClipboard uses the Clipboard API and falls back to execCommand when it is unavailable or denied. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01YajzBFUtT3d7kErLkqaMr6
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01YajzBFUtT3d7kErLkqaMr6
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01YajzBFUtT3d7kErLkqaMr6
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



Closes #3624
Each error in the debug toolbar now has a Copy button. It copies the error message and the traceback to the clipboard, so several errors can be copied and pasted one at a time.
For backend errors it copies the plain traceback from the Werkzeug debugger page when there is one, and the text of the HTML otherwise. Frontend errors copy the message and the stack trace.
Changes
FrontEndError.react.js: add the Copy button to each error header. Clicking it does not collapse or expand the error. The label shows "Copied" or "Copy failed" for 1.5 seconds.errorText.js(new):errorToTextbuilds the text to copy.copyToClipboarduses the Clipboard API and falls back todocument.execCommand('copy')when the API is missing or denied, for example inside an iframe.FrontEndError.css: styles for the button. The title group in the header goes from 77% to 65% width so the timestamp does not wrap onto a second line.tests/errorText.test.js(new): 5 unit tests forerrorToText.CHANGELOG.md: entry under Added.Testing
What I ran:
karma, headless Chrome 153): 143 of 143 passed, including the 5 new tests.eslintandprettieron the changed files: no findings.puppeteer-core): both errors show a Copy button, the clipboard holds the message and the traceback, the label goes to "Copied" and back to "Copy", and clicking it does not toggle the error. I checked both the Clipboard API path and theexecCommandfallback.What I did not run:
tests/integration/devtools). The environment I worked in could not get a ChromeDriver that matches the installed Chrome, so I did not add an integration test for the button. I am relying on CI for the existing ones.Contributor Checklist
next(feature)CHANGELOG.mdAI disclosure
This PR was prepared with Claude (Anthropic), an AI assistant, acting for agamsiingh, who authorized opening it. The code, tests and manual checks above were produced in that session.
🤖 Generated with Claude Code
https://claude.ai/code/session_01YajzBFUtT3d7kErLkqaMr6