Skip to content

Bring back preview links as a Share dialog in the header - #4448

Draft
shaunandrews wants to merge 1 commit into
stu-2162-single-sync-buttonfrom
stu-2162-share-dialog
Draft

Bring back preview links as a Share dialog in the header#4448
shaunandrews wants to merge 1 commit into
stu-2162-single-sync-buttonfrom
stu-2162-share-dialog

Conversation

@shaunandrews

Copy link
Copy Markdown
Contributor

Related issues

⚠️ Visual change: needs human review in light + dark mode.

How AI was used in this PR

Claude Code built this on top of the header stack and iterated on it live in the running app; verified with typecheck and unit tests (the Share dialog's own test passes as-is).

Proposed Changes

Preview links — dropped from the header in the first PR of this stack — come back as a Share button in the header, opening a dedicated dialog. Sharing a site isn't a sync (it publishes a throwaway copy on WordPress.com), so it sits beside the primary action rather than inside the sync flow.

The dialog has two divided sections:

  • Live — every WordPress.com site this Studio site is connected to, each with a copy button.
  • Preview links — the temporary hosted copies, each with copy, open, and delete in an overflow menu, plus the account's preview-link quota and a New preview action.

Rows are flat and divided by a hairline rather than boxed, so the list reads as a list. The Sync dialog is also pinned to the same 480px width as this one, so the two header dialogs match.

Delete needed a small addition: a deletePreviewSite(hostname) connector method (wired to the existing snapshot-delete IPC / local route) and a useDeletePreviewSite mutation, plus an aboveOverlays option on the menu so an overflow opened inside the dialog isn't trapped behind its scrim.

Testing Instructions

  1. Open a connected site → click Share in the header.
  2. Confirm the Live section lists the connected WordPress.com sites with working copy buttons.
  3. Confirm Preview links lists existing previews; try copy, open, and delete (⋮) on one, and confirm the quota and New preview work.
  4. Open the Sync dialog and confirm it's the same width as Share.
  5. Both light and dark.

Pre-merge Checklist

  • I have considered if this change warrants user-facing release notes and have added them to RELEASE-NOTES.txt if necessary.
  • I have added or updated tests to cover my changes, if applicable.
  • I have tested my changes in both light and dark mode.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
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