Skip to content

Conversation

@viktorrenkema
Copy link
Contributor

When a preview link for a change-request or revision is opened, we show a toolbar with helpful info and actions. However, we don't want to show this toolbar if the site is rendered in an iframe in the GitBook web-app editor, under the preview tab.

This behaviour likely broke when the 'multi-id' functionality became obsolete with the move to gbo v2.

  • this pr removes that old logic
  • and replaces it with a new check using the existing isPreviewRequest util

Examples

Toolbar no longer shows when previewing in-app:
CleanShot 2025-09-09 at 11 28 24@2x

Toolbar still shows when visiting a change-request or revision preview link:
CleanShot 2025-09-09 at 11 32 20@2x

@changeset-bot
Copy link

changeset-bot bot commented Sep 9, 2025

⚠️ No Changeset found

Latest commit: 16bf6b9

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

@argos-ci
Copy link

argos-ci bot commented Sep 9, 2025

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

Build Status Details Updated (UTC)
customers-v2 (Inspect) ⚠️ Changes detected (Review) 9 changed Sep 9, 2025, 12:56 PM
v2-cloudflare (Inspect) 👍 Changes approved 4 changed Sep 9, 2025, 12:59 PM
v2-vercel (Inspect) 👍 Changes approved 1 changed Sep 9, 2025, 12:58 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.

I think we should do this only on iframe, if we decide to be able to open the preview in a new tab later it will break.

@viktorrenkema viktorrenkema force-pushed the viktor/rnd-7992-hidedisable-preview-pill-when-displayed-in-an-iframe-in-the branch from 5928449 to 16bf6b9 Compare September 9, 2025 12:49
@viktorrenkema viktorrenkema merged commit d7596bf into main Sep 9, 2025
15 of 16 checks passed
@viktorrenkema viktorrenkema deleted the viktor/rnd-7992-hidedisable-preview-pill-when-displayed-in-an-iframe-in-the branch September 9, 2025 13:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

3 participants