feat: Add "Copy for AI" button to package page#169
Draft
NormVg wants to merge 2 commits intonpmx-dev:mainfrom
Draft
feat: Add "Copy for AI" button to package page#169NormVg wants to merge 2 commits intonpmx-dev:mainfrom
NormVg wants to merge 2 commits intonpmx-dev:mainfrom
Conversation
- Adds button to copy package info (name, version, description, install command, README) as markdown for AI context - Button positioned right of description on desktop, hidden on mobile - Secondary button in README section for mobile access - Uses theme-consistent btn/btn-ghost shortcuts - Fixed width (min-w-32) to prevent size change on copy feedback
|
@NormVg is attempting to deploy a commit to the danielroe Team on Vercel. A member of the Team first needs to authorize it. |
Member
|
this is related to #151 - we should probably have a shared util that we can use both for rendering a package to markdown from the server, and also for copying. |
Author
Member
|
hm. why don't I merge that one first and then you can refactor to share code as needed? I haven't checked - you might also have some improvements on the markdown rendering |
Author
sure lets me know to improve and update , would love to |
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.
feat: Add "Copy for AI" button to package page
Summary
Adds a "Copy for AI" button that copies package information formatted as markdown, optimized for pasting into AI assistants (Claude, ChatGPT, etc.).
Files Changed
app/pages/[...package].vueSingle file modification with ~117 insertions, ~28 deletions.
Implementation Details
1. State Management (Script Section)
2. README Text Extraction
Since
SlimPackumentdoesn't include raw README markdown (fetched separately as HTML), the implementation extracts text content client-side:3. Primary Button (Desktop Only)
Located right of the package description:
btnshortcut from design systemhidden sm:inline-flex- hidden on mobile, visible on ≥640pxmin-w-32- fixed width prevents size change on text toggle4. Secondary Button (README Section)
Located next to "Readme" heading:
btn-ghostshortcut (more subtle)5. Responsive Layout
Description container updated for responsive behavior:
flex-colon mobile (stacked)sm:flex-rowon desktop (side-by-side)What Gets Copied
No New Routes/APIs
This feature is entirely client-side. No new API endpoints or routes were created. Uses existing:
usePackage()composable for package datareadmeDatafrom existing README fetchnavigator.clipboard.writeText()APIChecklist
btn,btn-ghost)<ClientOnly>to prevent SSR issues