Skip to content

Comments

feat(react): add copy page for AI button#393

Merged
tmm merged 3 commits intowevm:nextfrom
brendanjryan:feat/copy-for-ai
Feb 9, 2026
Merged

feat(react): add copy page for AI button#393
tmm merged 3 commits intowevm:nextfrom
brendanjryan:feat/copy-for-ai

Conversation

@brendanjryan
Copy link

@brendanjryan brendanjryan commented Feb 2, 2026

Summary

Adds a "Copy page for AI" button to the right sidebar (Outline component) that allows users to copy the current page's markdown content for use with AI assistants.

Changes

  • New component: CopyForAi.client.tsx - A client component that:

    • Uses the existing /assets/md/{pagePath}.md endpoint from the llms.txt pipeline
    • Copies content to clipboard on click
    • Shows checkmark icon for 2s after successful copy
    • Inline layout with clipboard icon (matches Ask AI menu style)
    • Pointer cursor on hover
  • New config option: mcp.copyForAi

    • Requires mcp.enabled: true (the MCP pipeline serves the markdown endpoint)
    • Set mcp.copyForAi: false to disable the button (defaults to true)
  • Updated: Outline.tsx - Renders CopyForAi after the Feedback widget in the desktop sidebar

Usage

export default defineConfig({
  mcp: {
    enabled: true,
    // copyForAi: false, // uncomment to disable
  },
})

CleanShot 2026-02-01 at 18 50 54

@vercel
Copy link

vercel bot commented Feb 2, 2026

@brendanjryan is attempting to deploy a commit to the Wevm Team on Vercel.

A member of the Team first needs to authorize it.

@brendanjryan brendanjryan force-pushed the feat/copy-for-ai branch 2 times, most recently from 56434ea to 68356da Compare February 2, 2026 02:50
Add CopyForAi client component that:
- Fetches page markdown from /assets/md/{pagePath}.md endpoint
- Copies content to clipboard for use with AI assistants
- Shows checkmark icon for 2s after successful copy
- Uses inline layout with clipboard icon matching Ask AI menu
- Pointer cursor on hover, default cursor when disabled

Visibility controlled by:
- mcp.enabled must be true (required, serves the markdown endpoint)
- mcp.copyForAi can be set to false to disable (defaults to true)

Integrate into Outline.tsx after Feedback widget.
@brendanjryan
Copy link
Author

I don't love this config structure, but it does make it clear there is a dep between these two.

IMO it may make more sense to have a sidebar: config where features can be toggled

cc @jxom @tmm for thoughts

@pkg-pr-new
Copy link

pkg-pr-new bot commented Feb 9, 2026

Open in StackBlitz

npm i https://pkg.pr.new/wevm/vocs@393
npm i https://pkg.pr.new/wevm/vocs/create-vocs@393

commit: bb633a4

}
}, [router.path, state])

if (frontmatter?.showAskAi === false) return null
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

going to use showAskAi for now and we can break out into a separate property later if necessary

@tmm tmm merged commit 001de60 into wevm:next Feb 9, 2026
8 of 11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants