Add 'Copy Document' option to document menu#160
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
There was a problem hiding this comment.
Pull request overview
This PR adds a "Copy Document" feature to the document detail page, allowing users to quickly copy the full document JSON to their clipboard from the overflow menu. The implementation provides both a modern Clipboard API with a textarea fallback for broader browser support.
Changes:
- Added
copyDocument()method that serializes the document to JSON and copies it to clipboard using navigator.clipboard API with execCommand fallback - Added "Copy Document" button to both desktop and mobile overflow menus in the document header
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| frontend/src/document/document.js | Implements the copyDocument() method with clipboard API and textarea fallback, displaying success toast on completion |
| frontend/src/document/document.html | Adds "Copy Document" button to both desktop (line 87-93) and mobile (line 167-173) overflow menus |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Motivation
Description
frontend/src/document/document.html.copyDocument()infrontend/src/document/document.jswhich serializesthis.documentto pretty JSON and writes it to the clipboard usingnavigator.clipboard.writeTextwith a textarea fallback, and displays a success toast on completion.Testing
Codex Task