Conversation
This comment was marked as outdated.
This comment was marked as outdated.
|
🚀 Preview Deployment Your preview is ready: https://celestiaorg.github.io/docs-preview/pr-2364/ |
|
for me, when i copy, it doesnt show request and response: |
|
gemini seems onto something tbh |
fd5d2ea to
1b499b1
Compare
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 4 out of 4 changed files in this pull request and generated 3 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| article button:has(svg):has(*:is(:contains("Copy page"), :contains("Copied"))) { | ||
| display: none !important; | ||
| } | ||
| /* Fallback: hide the container if :has() or :contains() not supported */ |
There was a problem hiding this comment.
The CSS selectors :contains() and :has() combined in this way are not standard CSS. The :contains() pseudo-class doesn't exist in CSS (it's a jQuery selector), and while :has() is valid, this specific usage won't work. Consider using a more reliable approach such as adding a data attribute to the button you want to hide, or using JavaScript to hide the button based on its text content.
| article button:has(svg):has(*:is(:contains("Copy page"), :contains("Copied"))) { | |
| display: none !important; | |
| } | |
| /* Fallback: hide the container if :has() or :contains() not supported */ |
|
|
||
| {/* Hide Nextra's copy button - doesn't work well with dynamic content on this page */} | ||
| <style>{` | ||
| article button:has(svg):has(*:is(:contains("Copy page"), :contains("Copied"))) { | ||
| display: none !important; | ||
| } | ||
| /* Fallback: hide the container if :has() or :contains() not supported */ | ||
| article div[class*="border"][class*="inline-flex"][class*="float-end"] { | ||
| display: none !important; | ||
| } | ||
| `}</style> |
There was a problem hiding this comment.
This fallback selector is fragile and may hide unintended elements or break when CSS class names change. Consider targeting the button more specifically through a custom class name or data attribute, or use a more robust JavaScript-based solution to identify and hide the correct button.
| {/* Hide Nextra's copy button - doesn't work well with dynamic content on this page */} | |
| <style>{` | |
| article button:has(svg):has(*:is(:contains("Copy page"), :contains("Copied"))) { | |
| display: none !important; | |
| } | |
| /* Fallback: hide the container if :has() or :contains() not supported */ | |
| article div[class*="border"][class*="inline-flex"][class*="float-end"] { | |
| display: none !important; | |
| } | |
| `}</style> | |
| import Script from "next/script"; | |
| {/* Hide Nextra's copy button - doesn't work well with dynamic content on this page */} | |
| <style>{` | |
| article button:has(svg):has(*:is(:contains("Copy page"), :contains("Copied"))) { | |
| display: none !important; | |
| } | |
| `}</style> | |
| <Script id="hide-nextra-copy-button-fallback" strategy="afterInteractive"> | |
| {` | |
| (function() { | |
| try { | |
| var buttons = document.querySelectorAll('article button'); | |
| buttons.forEach(function(btn) { | |
| var text = (btn.textContent || '').toLowerCase(); | |
| if (text.indexOf('copy page') !== -1 || text.indexOf('copied') !== -1) { | |
| var container = btn.closest('div'); | |
| if (container) { | |
| container.style.display = 'none'; | |
| } else { | |
| btn.style.display = 'none'; | |
| } | |
| } | |
| }); | |
| } catch (e) { | |
| // Fail silently if the environment doesn't support querySelectorAll/closest | |
| } | |
| })(); | |
| `} | |
| </Script> |
This pull request enhances the Node API documentation page by improving the user experience around copying method specifications and refining the layout for better readability. The most significant change is the addition of a dedicated "Copy Spec" button that allows users to copy the full OpenRPC method specification, along with UI adjustments and the suppression of a conflicting default copy button.
User experience improvements:
app/build/rpc/components/RPCMethod.tsx,app/build/rpc/lib/types.ts,app/build/rpc/components/NodeAPIContent.tsx) [1] [2] [3]Methodtype and component props to support the new copy functionality. (app/build/rpc/lib/types.ts,app/build/rpc/components/NodeAPIContent.tsx) [1] [2]app/build/rpc/node-api/page.mdx)UI and accessibility enhancements:
app/build/rpc/components/RPCMethod.tsx) [1] [2] [3] [4]app/build/rpc/components/RPCMethod.tsx)