Skip to content

fix(manager): restore share popover with QR code#34920

Closed
leno23 wants to merge 1 commit into
storybookjs:nextfrom
leno23:fix/share-tool-restore-qr-34907
Closed

fix(manager): restore share popover with QR code#34920
leno23 wants to merge 1 commit into
storybookjs:nextfrom
leno23:fix/share-tool-restore-qr-34907

Conversation

@leno23

@leno23 leno23 commented May 26, 2026

Copy link
Copy Markdown

Summary

Fixes #34907

Storybook 10.4 replaced the share popover with a single isolation-mode button. The QR/copy-link UI components remained in share.tsx but were no longer wired up.

This restores the pre-10.4 shareTool popover with:

  • Copy story link
  • Open in isolation mode
  • Network QR code for mobile testing

Changes

  • Restore shareTool in share.tsx (replaces isolationModeTool)
  • Re-register shareTool in preview toolbar defaults
  • Re-add SHARE_STORY_LINK / SHARE_POPOVER_OPENED core events + telemetry

Surface area

  • Manager preview toolbar share UI only

Validation

  • Pre-commit lint/format passed locally
  • Behavior matches Storybook 10.3 share popover (see v10.3.0 share.tsx)

Closes #34907

Made with Cursor

Summary by CodeRabbit

  • New Features

    • Unified share menu now consolidates copy story link and isolation mode options in a single interface.
    • Added visual confirmation feedback when copying story links.
  • Analytics

    • Implemented tracking for share menu interactions.

Review Change Stack

The 10.4 share-tool refactor replaced the share popover with a single
isolation-mode button, leaving QR/copy-link UI unused. Restore the
pre-10.4 shareTool so mobile testing via network QR works again.

Fixes storybookjs#34907

Co-authored-by: Cursor <cursoragent@cursor.com>
@github-actions

Copy link
Copy Markdown
Contributor
Fails
🚫

PR is not labeled with one of: ["cleanup","BREAKING CHANGE","feature request","bug","documentation","maintenance","build","dependencies"]

🚫

PR is not labeled with one of: ["ci:normal","ci:merged","ci:daily","ci:docs"]

🚫 PR title must be in the format of "Area: Summary", With both Area and Summary starting with a capital letter Good examples: - "Docs: Describe Canvas Doc Block" - "Svelte: Support Svelte v4" Bad examples: - "add new api docs" - "fix: Svelte 4 support" - "Vue: improve docs"
🚫 PR description is missing the mandatory "#### Manual testing" section. Please add it so that reviewers know how to manually test your changes.

Generated by 🚫 dangerJS against 58a857d

@coderabbitai

coderabbitai Bot commented May 26, 2026

Copy link
Copy Markdown
Contributor

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: cdd6ebee-2c1e-4ccb-bb21-46143d4bd909

📥 Commits

Reviewing files that changed from the base of the PR and between ac3a378 and 58a857d.

📒 Files selected for processing (5)
  • code/core/src/core-events/index.ts
  • code/core/src/core-server/server-channel/telemetry-channel.ts
  • code/core/src/manager/components/preview/tools/share.tsx
  • code/core/src/manager/container/Preview.tsx
  • code/core/src/manager/globals/exports.ts

📝 Walkthrough

Walkthrough

This PR consolidates share and isolation-mode UI into a unified ShareMenu component with new telemetry events. Two new core events (SHARE_STORY_LINK, SHARE_POPOVER_OPENED) are defined, exported globally, and wired to telemetry handlers. The share tool is refactored to emit these events and include story-link copying, isolation-mode opening, and QR display in one popover menu, removing the separate isolationModeTool.

Changes

Share tool UI consolidation and event telemetry

Layer / File(s) Summary
Share event contracts and exports
code/core/src/core-events/index.ts, code/core/src/manager/globals/exports.ts
Two new share-interaction events (SHARE_STORY_LINK, SHARE_POPOVER_OPENED) are added to the core-events enum, exported via destructuring, and registered in the global event exports.
Telemetry handlers for share events
code/core/src/core-server/server-channel/telemetry-channel.ts
initTelemetryChannel imports and wires the new share events to telemetry handlers that track popover-open and link-copy actions.
ShareMenu component and tool consolidation
code/core/src/manager/components/preview/tools/share.tsx
Share UI is refactored into a memoized ShareMenu component that emits the new events, combines story-link copying, isolation-mode opening, and QR display with popover and keyboard-hint support; isolationModeTool export is removed and shareTool is updated to render the consolidated menu.
Preview container tool registration
code/core/src/manager/container/Preview.tsx
The preview container imports the refactored shareTool and updates the default tools list to include shareTool and remove isolationModeTool.

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related PRs

  • storybookjs/storybook#34413: Share-event additions and telemetry wiring are directly tied to the same "redesign share tool + share onboarding" changes.
  • storybookjs/storybook#32661: Both PRs modify the share.tsx ShareMenu component with event emissions and QR URL/text adjustments.
  • storybookjs/storybook#33766: The share UI and telemetry additions extend the new core events and telemetry handlers introduced in this related PR.

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.

@Sidnioulz

Copy link
Copy Markdown
Contributor

AI spam

@Sidnioulz Sidnioulz closed this May 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: The QR code with the story link is missing in the shareTool since 10.4.0 version

2 participants