-
Notifications
You must be signed in to change notification settings - Fork 14
feat: use pre and code tags for JSON display #1434
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
feat: use pre and code tags for JSON display #1434
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
🦋 Changeset detectedLatest commit: 2fd8e17 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
|
@alexfreska I renamed this component, so the changes here are a bit obfuscated. Check ExplorerTextArea. This reduces the complexity of this considerably and was a great idea (yours!). |
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.
Pull request overview
This PR replaces the ExplorerTextarea component with a new ExplorerCopyableCodeBlock component that uses semantic HTML <pre> and <code> tags instead of <textarea> for displaying JSON data. This change addresses UX issues related to height and scrollbar behavior in JSON dropdown views.
Changes:
- Introduced
ExplorerCopyableCodeBlockcomponent using<pre>and<code>tags with horizontal overflow support - Removed
ExplorerTextareacomponent and its dynamic height management logic - Updated all JSON display locations to use the new component
Reviewed changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| apps/explorer/components/ExplorerCopyableCodeBlock.tsx | New component implementing copyable code blocks with <pre> and <code> tags |
| apps/explorer/components/ExplorerTextarea.tsx | Removed legacy textarea-based component |
| apps/explorer/components/TroubleshooterResults/index.tsx | Updated to use ExplorerCopyableCodeBlock for JSON display |
| apps/explorer/components/Transaction/index.tsx | Updated to use ExplorerCopyableCodeBlock for JSON display |
| apps/explorer/components/Output/index.tsx | Updated to use ExplorerCopyableCodeBlock for state element JSON display |
| apps/explorer/components/BlockMetrics/DifficultyMetrics.tsx | Updated to use ExplorerCopyableCodeBlock for metrics JSON display |
| apps/explorer/components/Block/index.tsx | Updated to use ExplorerCopyableCodeBlock for block JSON display |
| .changeset/better-shrimps-stay.md | Documented the change as a minor version bump for the explorer package |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Closes #1295.