Skip to content

Conversation

@dawnkelly09
Copy link
Collaborator

📝 Description

This pull request enhances the Markdown page utilities in js/copy-to-llm.js by improving URL handling for scoped deployments and adding a new "View Page in Markdown" option to the dropdown menu. The changes ensure that page slugs and Markdown URLs are correctly generated based on the current scope, and that the UI behaves appropriately on the home page.

Improvements to URL and slug handling:

  • Added getScopeUrl and stripBasePath functions to correctly compute the base path and scope for generating page slugs and Markdown URLs, ensuring compatibility with scoped deployments. (js/copy-to-llm.js, js/copy-to-llm.jsR21-R55)
  • Updated getPageSlug and getMarkdownUrl to use the new scope-aware logic for consistent and accurate URL generation. (js/copy-to-llm.js, js/copy-to-llm.jsR21-R55)

UI enhancements:

  • Added a "View Page in Markdown" button to the dropdown menu, allowing users to open the Markdown source of the current page in a new tab. (js/copy-to-llm.js, [1] [2]
  • Modified the UI mounting logic to prevent rendering copy buttons on the home page and avoid duplicate UI elements. (js/copy-to-llm.js, js/copy-to-llm.jsL292-R338)

@dawnkelly09 dawnkelly09 requested a review from a team as a code owner December 11, 2025 18:06
Copilot AI review requested due to automatic review settings December 11, 2025 18:06
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This pull request enhances the Copy to LLM functionality by adding scope-aware URL handling for deployments and introducing a "View Page in Markdown" button to the dropdown menu. The changes improve the robustness of URL generation for scoped deployments and prevent the UI from rendering on the home page.

Key Changes:

  • Added scope-aware URL handling via getScopeUrl() and stripBasePath() functions to ensure correct base path computation for scoped deployments
  • Introduced a "View Page in Markdown" dropdown option that opens the Markdown source in a new tab
  • Enhanced home page detection to prevent UI elements from rendering when not appropriate

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@dawnkelly09 dawnkelly09 requested a review from eshaben December 11, 2025 18:10
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