Skip to content

Keep revision search results in preview - #4582

Open
jpreynat wants to merge 2 commits into
mainfrom
jpreynat/rnd-11624-preview-search-navigation
Open

Keep revision search results in preview#4582
jpreynat wants to merge 2 commits into
mainfrom
jpreynat/rnd-11624-preview-search-navigation

Conversation

@jpreynat

@jpreynat jpreynat commented Sep 4, 2026

Copy link
Copy Markdown
Member

Summary

  • Fix RND-11624 by mapping current-space search hits back to the revision page tree using stable page IDs.
  • Generate valid current-space destinations with the revision-aware GitBookLinker, including moved pages and safe section anchors, and filter results missing from the preview.
  • Preserve published and cross-space navigation, custom domains and base paths, result presentation, ranking, and ordering.

Search is intentionally not revision-specific after this change: candidates still come from the main published-content index. Valid current-space candidates are mapped back into the revision currently being viewed.

Testing

  • bun test src/app/sites/dynamic/[mode]/[siteURL]/[siteData]/~gitbook/search/route.test.ts
  • bun run format
  • bunx oxlint --quiet on the changed search files
  • bun run typecheck (blocked by pre-existing errors in ContentKitWithClientContext.tsx; the changed search files produce no reported errors)

@linear-code

linear-code Bot commented Sep 4, 2026

Copy link
Copy Markdown

RND-11624

@changeset-bot

changeset-bot Bot commented Sep 4, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 9dd179b

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

@argos-ci

argos-ci Bot commented Sep 4, 2026

Copy link
Copy Markdown

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

Build Status Details Updated (UTC)
customers-v2-cloudflare (Inspect) 👍 Approved by Johan Preynat 1 changed, 2 ignored Sep 4, 2026, 11:06 AM
customers-v2-vercel (Inspect) 👍 Approved by Johan Preynat 1 changed, 2 ignored Sep 4, 2026, 11:03 AM
v2-cloudflare (Inspect) ✅ No changes detected 8 ignored Sep 4, 2026, 11:08 AM
v2-vercel (Inspect) ✅ No changes detected 1 ignored Sep 4, 2026, 11:06 AM

@github-actions

github-actions Bot commented Sep 4, 2026

Copy link
Copy Markdown
Contributor

Style invalidation on a large API reference

Elements restyled by opening one popup on the Snyk API reference. A share near or above 100% means the insertion restyles the whole document.

interaction restyled page share budget
openapi-select 6 10,731 0.1% 25%
search 629 10,731 5.9% 125%

@jpreynat jpreynat self-assigned this Sep 4, 2026
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.

1 participant