Skip to content

Add Page Actions#753

Merged
yamcodes merged 18 commits intomainfrom
752-add-copy-text-button
Jan 19, 2026
Merged

Add Page Actions#753
yamcodes merged 18 commits intomainfrom
752-add-copy-text-button

Conversation

@yamcodes
Copy link
Copy Markdown
Owner

@yamcodes yamcodes commented Jan 17, 2026

Closes #752

Summary by CodeRabbit

Release Notes

  • New Features

    • Added "Copy Markdown" button for quick content copying to clipboard
    • Introduced "View Options" menu enabling access to documentation in multiple AI platforms (ChatGPT, Claude, Scira AI, T3 Chat, and GitHub)
    • New endpoints for accessing full LLM-processed documentation content
  • Style

    • Updated outline button styling for improved visual appearance and consistency
  • Chores

    • Added new UI library dependencies for enhanced component support

✏️ Tip: You can customize this high-level summary in your review settings.

@yamcodes yamcodes linked an issue Jan 17, 2026 that may be closed by this pull request
@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented Jan 17, 2026

⚠️ No Changeset found

Latest commit: 7bc9644

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Jan 17, 2026

Warning

Rate limit exceeded

@yamcodes has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 25 minutes and 22 seconds before requesting another review.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

📥 Commits

Reviewing files that changed from the base of the PR and between 1a90bef and 7bc9644.

📒 Files selected for processing (1)
  • apps/www/lib/utils/github.test.ts

Walkthrough

This change replaces the EditOnGithub component with new page action features (LLMCopyButton and ViewOptions), removes the component and its tests, and adds infrastructure including new API routes, utilities, and configuration to serve LLM-generated Markdown versions of documentation pages.

Changes

Cohort / File(s) Summary
Page Rendering Updates
apps/www/app/docs/[[...slug]]/page.tsx
Replaced EditOnGithub and Separator imports with LLMCopyButton and ViewOptions; added new UI block rendering both components with page URL and GitHub URL.
LLM Content Routes
apps/www/app/llms-full.txt/route.ts, apps/www/app/llms.mdx/docs/[[...slug]]/route.ts
Added two new routes: one to serve all LLM text concatenated as plain text, another to serve individual page LLM content as Markdown with static param generation and 404 handling.
Page Action Components
apps/www/components/page-actions.tsx
New client component exporting LLMCopyButton (fetches and copies Markdown with in-memory caching) and ViewOptions (popover with external links to GitHub, Scira AI, ChatGPT, Claude, T3 Chat).
UI Component Updates
apps/www/components/ui/button.tsx, apps/www/components/ui/popover.tsx
Updated outline button variant styling; added new Radix UI Popover wrapper with four exports (Popover, PopoverTrigger, PopoverContent, PopoverClose).
Utility Functions
apps/www/lib/get-llm-text.ts, apps/www/lib/cn.ts, apps/www/lib/utils/github.ts
Added getLLMText function to format page content as Markdown; added cn alias for twMerge; updated github utilities to fallback to hardcoded default URL instead of throwing error.
Configuration & Routing
apps/www/next.config.ts, apps/www/proxy.ts, apps/www/source.config.ts, apps/www/cli.json
Added rewrite rule for MDX docs, Markdown preference handling in proxy, postprocessing flag for Markdown generation, and new CLI schema configuration.
Removed Component
apps/www/components/page/edit-on-github.tsx, apps/www/components/page/edit-on-github.test.tsx
Completely removed EditOnGithub component and its test suite covering link rendering, icon styling, environment variable handling, and error reporting.
Dependencies
apps/www/package.json
Added @radix-ui/react-popover (^1.1.15) and @fumadocs/cli (^1.1.9).

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~22 minutes

Possibly related PRs

  • Ts codeblock #161: Modifies apps/www/app/docs/[[...slug]]/page.tsx with changes to MDX component imports and rendering, overlapping with the page rendering updates in this PR.

Poem

🐰 A button to copy, a view to explore,
LLM text flows through each opened door.
Routes and popovers, a feature so bright,
The rabbit rejoices—new features take flight! ✨

🚥 Pre-merge checks | ✅ 3 | ❌ 2
❌ Failed checks (1 warning, 1 inconclusive)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
Out of Scope Changes check ❓ Inconclusive Most changes are in-scope for adding page actions. However, modifications to button styling, utility aliases, and GitHub URL fallback logic appear tangential to the core copy-text feature. Clarify whether styling changes to button outline variant, cn utility alias, and GitHub URL fallback are intentional dependencies for the page actions feature or should be separated into dedicated PRs.
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'Add Page Actions' accurately reflects the main change: introducing new page action components (LLMCopyButton and ViewOptions) to the documentation pages.
Linked Issues check ✅ Passed The PR implements the linked issue #752 by adding copy text functionality via LLMCopyButton and ViewOptions components with external action links, meeting the core requirement.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@github-actions github-actions Bot added www Improvements or additions to arkenv.js.org tests This issue or PR is about adding, removing or changing tests labels Jan 17, 2026
@yamcodes yamcodes marked this pull request as ready for review January 17, 2026 19:52
@arkenv-bot
Copy link
Copy Markdown
Contributor

arkenv-bot Bot commented Jan 17, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Review Updated (Asia/Almaty)
arkenv Ready Ready Preview, Comment Jan 20 2026, 2:48 AM (Asia/Almaty)

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 6

🤖 Fix all issues with AI agents
In `@apps/www/app/docs/`[[...slug]]/page.tsx:
- Around line 32-35: The githubUrl construction can produce malformed paths when
NEXT_PUBLIC_DOCS_CONTENT_PATH lacks a trailing slash or page.path has a leading
slash; update the logic used by getLinkTitleAndHref call that builds githubUrl
to normalize both segments (ensure NEXT_PUBLIC_DOCS_CONTENT_PATH ends with a
single slash and strip any leading slash from page.path, or vice-versa) before
concatenation so the resulting href is always a valid repo path; modify the
expression that passes `${process.env.NEXT_PUBLIC_DOCS_CONTENT_PATH ??
"apps/www/content/docs/"}${page.path}` to perform this normalization.

In `@apps/www/cli.json`:
- Around line 1-12: The cli.json references the schema at
node_modules/@fumadocs/cli/dist/schema/default.json but the `@fumadocs/cli`
package is missing from apps/www/package.json; add "@fumadocs/cli" to the
apps/www package.json dependencies (or devDependencies) and run yarn/npm install
so the schema path resolves, ensuring IDE JSON schema validation works for the
"uiLibrary" and other keys in cli.json.

In `@apps/www/components/page-actions.tsx`:
- Around line 27-47: The fetch passed into new ClipboardItem can succeed at
network level but return a non-2xx response; update the logic inside the
useCopyButton handler (the async callback using markdownUrl, cache, setLoading,
and ClipboardItem) to await fetch(markdownUrl) into a response variable, check
response.ok and throw or reject with a clear error if not ok, then await
response.text(), cache.set(markdownUrl, content) and return content; this
ensures failed HTTP responses do not get written to the clipboard and bubble as
errors to be handled by the existing try/finally around setLoading.
- Around line 82-87: The SSR fallback sets fullMarkdownUrl to the literal string
"loading", producing an invalid URL in the query; change the useMemo logic (the
items computation around useMemo, fullMarkdownUrl and q) to avoid constructing a
URL during SSR—use an empty string or the original relative markdownUrl when
typeof window === "undefined", or defer URL construction until client-side
(e.g., only build new URL(markdownUrl, window.location.origin) when window
exists) so fullMarkdownUrl is always a valid string for the query generated in
items.

In `@apps/www/components/ui/button.tsx`:
- Line 17: The outline variant in the Button component uses the class string
that sets "bg-primary/5" with "text-foreground/90" which can reduce contrast in
dark mode; inspect the Button component's outline variant (the class string
containing "border border-border bg-primary/5 hover:bg-primary/10
hover:border-primary/30 text-foreground/90 hover:text-primary") and either
replace text-foreground/90 with a full-contrast token (e.g., text-foreground) or
add dark: modifiers (e.g., dark:text-foreground) or adjust the background token
(e.g., bg-primary/10) to meet your accessibility contrast targets, then verify
with your contrast checker against the theme tokens and update the Tailwind
classes accordingly.

In `@apps/www/package.json`:
- Line 20: The package `@radix-ui/react-popover`@1.1.15 declares peerDeps for
React ^16.8.0 || ^17 || ^18 and thus does not officially support React 19.2.3
used in this repo; update package.json to either (a) upgrade
`@radix-ui/react-popover` to a Radix release that explicitly supports React 19
when available, or (b) if you must keep this version, add a pnpm override
(pnpm.overrides) or package.json "resolutions"/"overrides" entry to coerce
compatibility and add a short comment explaining the risk, then run install and
exercise components using Popover to verify runtime behavior (reference
`@radix-ui/react-popover` in package.json).
🧹 Nitpick comments (2)
apps/www/lib/cn.ts (1)

1-1: Add JSDoc for the public cn utility.

This is a public API; add a brief JSDoc (with example) for discoverability.

♻️ Proposed refactor
-export { twMerge as cn } from "tailwind-merge";
+import { twMerge } from "tailwind-merge";
+
+/**
+ * Merge Tailwind class names with conflict resolution.
+ *
+ * `@example`
+ * cn("px-2", isActive && "text-primary")
+ */
+export const cn = twMerge;

As per coding guidelines, public APIs should be documented with JSDoc.

apps/www/app/llms-full.txt/route.ts (1)

7-12: Consider adding a Content-Type header for consistency.

The sibling route at llms.mdx/docs/[[...slug]]/route.ts explicitly sets Content-Type: text/markdown. For consistency and clarity, consider setting Content-Type: text/plain here.

♻️ Suggested improvement
 export async function GET() {
 	const scan = source.getPages().map(getLLMText);
 	const scanned = await Promise.all(scan);

-	return new Response(scanned.join("\n\n"));
+	return new Response(scanned.join("\n\n"), {
+		headers: {
+			"Content-Type": "text/plain; charset=utf-8",
+		},
+	});
 }

Comment thread apps/www/app/docs/[[...slug]]/page.tsx
Comment thread apps/www/cli.json
Comment thread apps/www/components/page-actions.tsx
Comment thread apps/www/components/page-actions.tsx
Comment thread apps/www/components/ui/button.tsx Outdated
Comment thread apps/www/package.json
…ion and copy-to-clipboard error handling, and refine button styling.
@github-actions github-actions Bot added the docs Improvements or additions to documentation label Jan 17, 2026
Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Fix all issues with AI agents
In `@apps/www/DEPENDENCY_NOTES.md`:
- Around line 14-18: Update the compound modifier in the text to use a
hyphenated form: change the phrase "React 19 compatible" to "React
19-compatible" wherever it appears (notably in the sentence about monitoring
Radix UI releases and upgrading `@radix-ui/react-popover`) to correct the
grammar and improve readability.

Comment thread apps/www/DEPENDENCY_NOTES.md Outdated
Comment on lines +14 to +18
- The peer dependency warning can be safely ignored until Radix UI releases an official React 19 compatible version.

**Future action:**
- Monitor Radix UI releases for official React 19 support
- Upgrade `@radix-ui/react-popover` when a React 19 compatible version is available
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

Hyphenate the compound modifier “React 19-compatible.”

Minor grammar tweak to improve readability.

✏️ Suggested fix
- The peer dependency warning can be safely ignored until Radix UI releases an official React 19 compatible version.
+ The peer dependency warning can be safely ignored until Radix UI releases an official React 19-compatible version.

- - Upgrade `@radix-ui/react-popover` when a React 19 compatible version is available
+ - Upgrade `@radix-ui/react-popover` when a React 19-compatible version is available
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
- The peer dependency warning can be safely ignored until Radix UI releases an official React 19 compatible version.
**Future action:**
- Monitor Radix UI releases for official React 19 support
- Upgrade `@radix-ui/react-popover` when a React 19 compatible version is available
- The peer dependency warning can be safely ignored until Radix UI releases an official React 19-compatible version.
**Future action:**
- Monitor Radix UI releases for official React 19 support
- Upgrade `@radix-ui/react-popover` when a React 19-compatible version is available
🧰 Tools
🪛 LanguageTool

[grammar] ~14-~14: Use a hyphen to join words.
Context: ...l Radix UI releases an official React 19 compatible version. Future action: ...

(QB_NEW_EN_HYPHEN)


[grammar] ~18-~18: Use a hyphen to join words.
Context: ...@radix-ui/react-popover` when a React 19 compatible version is available

(QB_NEW_EN_HYPHEN)

🤖 Prompt for AI Agents
In `@apps/www/DEPENDENCY_NOTES.md` around lines 14 - 18, Update the compound
modifier in the text to use a hyphenated form: change the phrase "React 19
compatible" to "React 19-compatible" wherever it appears (notably in the
sentence about monitoring Radix UI releases and upgrading
`@radix-ui/react-popover`) to correct the grammar and improve readability.

@github-actions github-actions Bot removed the docs Improvements or additions to documentation label Jan 19, 2026
…d of error throwing when `NEXT_PUBLIC_GITHUB_URL` is not configured.
@yamcodes yamcodes merged commit e21d943 into main Jan 19, 2026
13 checks passed
@yamcodes yamcodes deleted the 752-add-copy-text-button branch January 19, 2026 21:44
@coderabbitai coderabbitai Bot mentioned this pull request Jan 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

tests This issue or PR is about adding, removing or changing tests www Improvements or additions to arkenv.js.org

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add "copy text" button

1 participant