Skip to content

feat(playground): add preview mode option to share button#1377

Merged
joshunrau merged 1 commit into
DouglasNeuroInformatics:mainfrom
joshunrau:build-instrument2
Jun 9, 2026
Merged

feat(playground): add preview mode option to share button#1377
joshunrau merged 1 commit into
DouglasNeuroInformatics:mainfrom
joshunrau:build-instrument2

Conversation

@joshunrau

@joshunrau joshunrau commented Jun 9, 2026

Copy link
Copy Markdown
Collaborator

Add a "Preview mode" toggle to the share popover. When enabled, the share URL includes a fullscreen=1 query param, and opening that link renders the instrument fullscreen as a read-only preview with no editor.

Summary by CodeRabbit

  • New Features
    • Added a fullscreen preview mode toggle to the share button, allowing users to generate share links that open the playground in fullscreen view with an optimized layout.

Add a "Preview mode" toggle to the share popover. When enabled, the
share URL includes a fullscreen=1 query param, and opening that link
renders the instrument fullscreen as a read-only preview with no editor.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@joshunrau joshunrau merged commit 2900c93 into DouglasNeuroInformatics:main Jun 9, 2026
1 check was pending
@coderabbitai

coderabbitai Bot commented Jun 9, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: 5261f14e-d29a-483f-827b-416cb8692d14

📥 Commits

Reviewing files that changed from the base of the PR and between 460ccc9 and 41ccdce.

📒 Files selected for processing (3)
  • apps/playground/src/components/Header/ShareButton/ShareButton.tsx
  • apps/playground/src/pages/IndexPage.tsx
  • apps/playground/src/utils/encode.ts

Walkthrough

ShareButton adds a fullscreen toggle that encodes fullscreen=1 into share URLs via an updated encodeShareURL contract. IndexPage detects these URLs with isFullscreenShareURL and renders a dedicated fullscreen layout showing only Viewer, theme toggle, and language toggle.

Changes

Fullscreen Share Preview

Layer / File(s) Summary
URL encoding contract for fullscreen flag
apps/playground/src/utils/encode.ts
encodeShareURL accepts optional fullscreen?: boolean and appends fullscreen=1 query parameter. New isFullscreenShareURL(url: URL) detects this flag in shared URLs.
ShareButton fullscreen toggle
apps/playground/src/components/Header/ShareButton/ShareButton.tsx
ShareButton adds isFullscreen state and extends popover UI with a fullscreen switch control and help tooltip, passing the flag to encodeShareURL when generating share URLs.
IndexPage fullscreen preview rendering
apps/playground/src/pages/IndexPage.tsx
IndexPage detects fullscreen share URLs and renders a dedicated fullscreen layout with ThemeToggle, LanguageToggle, and Viewer, bypassing the normal header and main content layout.

Estimated Code Review Effort

🎯 2 (Simple) | ⏱️ ~10 minutes

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

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