Skip to content

Conversation

nolannbiron
Copy link
Member

No description provided.

Copy link

changeset-bot bot commented Oct 4, 2025

🦋 Changeset detected

Latest commit: 9c4b254

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
gitbook Patch

Not sure what this means? Click here to learn what changesets are.

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

Copy link
Contributor

@Copilot 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 PR fixes an issue with the markdownPageURL for PageActions by ensuring the URL has a .md extension when passed to the PageActions component, but removes it when sending to LLM providers to avoid bad requests.

  • Add .md extension to markdownPageURL in PageHeader component
  • Strip .md extension from URLs before sending to LLM providers in PageActions
  • Add changeset documenting the fix

Reviewed Changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.

File Description
packages/gitbook/src/components/PageBody/PageHeader.tsx Adds .md extension to the markdown page URL
packages/gitbook/src/components/PageActions/PageActions.tsx Removes .md extension from URL before passing to LLM providers
.changeset/eight-eels-sort.md Documents the fix in changeset

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Copy link

argos-ci bot commented Oct 4, 2025

The latest updates on your projects. Learn more about Argos notifications ↗︎

Build Status Details Updated (UTC)
customers-v2 (Inspect) 👍 Changes approved 21 changed Oct 4, 2025, 4:23 PM
v2-cloudflare (Inspect) 👍 Changes approved 79 changed Oct 4, 2025, 4:27 PM
v2-vercel (Inspect) ✅ No changes detected - Oct 4, 2025, 4:26 PM

Copy link
Contributor

@gregberge gregberge left a comment

Choose a reason for hiding this comment

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

A bit weird to pass it then remove it because the logic to compute the markdown URL is now duplicated but let's fix it.

@nolannbiron
Copy link
Member Author

@gregberge yeah I know but it's either we add it for copy and view, or remove it once for LLMs

@gregberge
Copy link
Contributor

The good way to fix it is to pass urls property with html / markdown property and use the correct one. Or better to compute it in the component where it's actually needed (because of RSC payload).

@nolannbiron
Copy link
Member Author

we can't compute in the component because we can't pass context from server to client, let's merge this first and I'll update to use urls: {html, markdown} after

@nolannbiron nolannbiron merged commit 6815dd1 into main Oct 4, 2025
16 checks passed
@nolannbiron nolannbiron deleted the nolann/fix-page-actions branch October 4, 2025 17:02
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