Skip to content

Allow quickly viewing which pages have changed in a CR/revision#4348

Open
viktorrenkema wants to merge 1 commit into
mainfrom
viktor/gbo/rnd-9237-diff-with-code-highlighting
Open

Allow quickly viewing which pages have changed in a CR/revision#4348
viktorrenkema wants to merge 1 commit into
mainfrom
viktor/gbo/rnd-9237-diff-with-code-highlighting

Conversation

@viktorrenkema

Copy link
Copy Markdown
Contributor

What changed

Adds a changed-pages button to the AdminToolbar for change request and revision previews. Clicking it opens a compact dropdown listing changed document pages, with links back to the relevant preview page.

Deleted pages are included too, but route to the editor change instead of the preview since they may no longer exist in the published page tree.

CleanShot.2026-06-29.at.13.25.59.mp4

Notes

  • Fetches semantic changes for CRs and older revisions.
  • Filters to document pages only and skips computed/link/group pages.
  • Dedupes multiple changes for the same page into a single row.
  • Keeps the dropdown trigger stable while preserving toolbar magnification, so the popover does not shift when the cursor moves away.

Closes https://linear.app/gitbook-x/issue/RND-11620/show-a-list-of-changed-pages-in-gbos-toolbar

@viktorrenkema viktorrenkema requested a review from SamyPesse as a code owner June 29, 2026 11:27
@linear-code

linear-code Bot commented Jun 29, 2026

Copy link
Copy Markdown

RND-11620

RND-9237

@changeset-bot

changeset-bot Bot commented Jun 29, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: a2b0eb9

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 Jun 29, 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) ✅ No changes detected 2 ignored Jun 29, 2026, 12:04 PM
customers-v2-vercel (Inspect) 👍 Changes approved 3 changed Jun 29, 2026, 12:03 PM
v2-cloudflare (Inspect) 👍 Changes approved 3 changed, 1 ignored Jun 29, 2026, 12:10 PM
v2-vercel (Inspect) ⚠️ Changes detected (Review) 4 removed, 1 failure, 1 ignored Jun 29, 2026, 1:08 PM

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 24cc9c2315

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

context: GitBookSiteContext
): Promise<MinimalChangedPages | null> {
const changes = context.changeRequest
? await getDataOrNull(

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Isolate failures from changed-pages fetches

In CR/revision previews, this optional toolbar query now runs during AdminToolbar server rendering, but getDataOrNull only suppresses 404s; a transient 5xx/403 from the semantic-changes endpoint (the revision branch below uses the same pattern) will throw and fail rendering of the whole site page instead of just hiding the changed-pages button. Wrap these optional fetches so non-critical API errors degrade to null.

Useful? React with 👍 / 👎.

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