Skip to content

[Website] Open the Reprint clone form from a site link - #4552

Merged
adamziel merged 5 commits into
trunkfrom
reprint-clone-link
Nov 3, 2026
Merged

adamziel merged 5 commits into
trunkfrom
reprint-clone-link

Conversation

@adamziel

@adamziel adamziel commented Nov 3, 2026 •

Copy link
Copy Markdown
Collaborator

Make New Playground → Clone a live site available without the ?reprint flag. Use ?clone-site=<url> to open the form with an editable address. Opening the link does not contact the source.

Field Notes accepts public, read-only Reprint POST requests. Reprint v0.11.6 still expects a credential option, so Playground passes the demo's ignored public-demo placeholder instead of generating a migration key. The demo export has no admin account; Playground creates one in the local copy. Other sites keep the normal key setup.

Screenshots

Before, the demo link opened the default Playground. Now it opens the clone form with Field Notes filled in.

Viewport Before After
Desktop Default Playground on desktop Clone form with the Field Notes address on desktop
Mobile Default Playground on mobile Clone form with the Field Notes address on mobile

Test

  1. On a build with this change, open the Field Notes clone link and choose Clone site. No account or key should be requested.
  2. When the transfer finishes, choose Open site. The Field Notes homepage and its photo should load, and the copy should be editable.
  3. Open the link again and change the address to another site. The form should offer Check site instead.

Summary by CodeRabbit

  • New Features
    • Added a “Clone a live site” option to the Playground creation flow, available without a special URL parameter.
    • Clone links can open the form with a site URL prefilled. The source site is contacted only after selecting Check site.
    • The public Field Notes demo can be cloned without a key. A local administrator is created if the imported site has no administrator.
  • Bug Fixes
    • Improved validation for demo URLs to reject lookalike addresses that are not the public demo.
  1. With the prefilled form open, use the Dock’s New Playground button, then Clone a live site. The new form should start blank.

@coderabbitai

coderabbitai Bot commented Nov 3, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

No actionable comments were generated in the recent review.

Walkthrough

The clone flow now accepts a URL from the clone-site query parameter. The transfer panel supports keyless pulls of the public Field Notes demo and can create a local administrator when needed. Documentation and tests reflect the clone flow and sandbox-origin rule.

Changes: Clone-site flow

Layer / File(s) Summary
Clone URL startup state
packages/playground/website/src/lib/state/redux/slice-ui.ts, packages/playground/website/src/components/saved-playgrounds-panel/index.tsx
Clone request state can include a URL. Outside seamless mode, clone-site opens the Dock transfer section with the URL. Initial site selection preserves the request, and the clone launcher is available without the reprint query parameter.
Public-demo transfer panel
packages/playground/website/src/components/site-manager/site-transfer-panel/*
The transfer panel handles public-demo pulls and clones without a migration key. It uses a null key pair for public-demo handoffs, shows pull requirements, and retains key-based behavior for other URLs.
Public-demo pull and authentication
packages/playground/website/src/lib/reprint/bridge.php, packages/playground/website/src/lib/reprint/bridge-test.php, packages/playground/website/src/lib/reprint/reprint.ts, packages/playground/website/src/lib/reprint/reprint.spec.ts
The public Field Notes demo can be pulled without a private key. The import flow can create a local administrator when the export has none. Bridge authentication uses a public-demo secret when no key is supplied. Tests cover URL validation and bridge key handling.
Clone-flow instructions and coverage
packages/playground/website/src/lib/reprint/README.md, packages/playground/website/playwright/e2e/*, packages/playground/website/src/components/site-manager/site-transfer-panel/index.spec.tsx, packages/playground/website/src/lib/reprint/release.json, packages/playground/website/playwright/reprint-site/serve.sh
Instructions describe the clone-site parameter, source contact after Check site, and keyless cloning. Tests cover clone URL handling, public-demo clone handoff, updated authorization steps, and routes without the reprint parameter. Reprint release metadata and the server archive digest are updated.

Sandbox-origin documentation

Layer / File(s) Summary
Origin rule and deployment verification
AGENTS.md, packages/playground/website-deployment/wordpress-frame/README.md, packages/playground/website/README.md, packages/playground/website/bin/wordpress-frame/README.md, packages/playground/website/playwright/e2e/sites-api.spec.ts
The documentation states that WordPress frames use the configured sandbox origin without distinguishing ?reprint. Deployment verification no longer requires checking both query-parameter states. A test comment refers to startup parameters generally.

Estimated code review effort: 3 (Moderate) | ~25 minutes

Change: Feature

Sequence Diagram(s)

sequenceDiagram
  participant Browser
  participant ReduxSliceUI
  participant SiteTransferPanel
  participant pullSite
  participant reprint_auth_options
  Browser->>ReduxSliceUI: load clone-site URL
  ReduxSliceUI->>SiteTransferPanel: open transfer form with URL
  SiteTransferPanel->>pullSite: submit public demo URL and null key
  pullSite->>reprint_auth_options: request authentication options
  reprint_auth_options-->>pullSite: return public-demo secret option
Loading
Merge Risk: Minimal · up to 69124

The clone flow has no established current-head defect that should block merging.

Pre-merge checks: Passed 5
Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title "[Website] Open the Reprint clone form from a site link" matches the main change. The PR adds a ?clone-site=<url> link that opens the "Clone a live site" form with a prefilled, editable ad…
Docstring Coverage Passed Docstring coverage is 91.67% which is sufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentati…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Title check

Explanation

The title "[Website] Open the Reprint clone form from a site link" matches the main change. The PR adds a ?clone-site=&lt;url&gt; link that opens the "Clone a live site" form with a prefilled, editable address, without requiring ?reprint. The changeset also covers the public demo path, the bridge auth changes, and the cloneRequested state update. The title describes the primary user-facing change and leaves out those secondary details, which is expected.

Full details: Docstring Coverage

Explanation

Docstring coverage is 91.67% which is sufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 12 functions across 12 files. (1 skipped: 1 unsupported.)

Finishing Touches
Generate docstrings
  • Commit to this branch
  • Create a new PR
Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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
Recent review info
Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 0b5a26c2-be8b-4143-a77c-06880b233657
Commits

Reviewing files that changed from the base of the PR and between a5efbc1 and 6912453.

Files selected for processing: 7
  • packages/playground/website/playwright/e2e/reprint-import.spec.ts
  • packages/playground/website/playwright/e2e/reprint-ui.spec.ts
  • packages/playground/website/playwright/reprint-site/serve.sh
  • packages/playground/website/src/components/site-manager/site-transfer-panel/index.spec.tsx
  • packages/playground/website/src/components/site-manager/site-transfer-panel/index.tsx
  • packages/playground/website/src/lib/reprint/README.md
  • packages/playground/website/src/lib/state/redux/slice-ui.ts
Files skipped from review as they are similar to previous changes: 1
  • packages/playground/website/src/lib/reprint/README.md

Included review availability: This review used your included allowance. Your plan provides up to 4 included reviews per hour; 3 remain after this review.

@coderabbitai coderabbitai Bot left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

  • Fix comments: Fix CodeRabbit comments on this PR

@coderabbitai coderabbitai Bot left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

  • Fix comments: Fix CodeRabbit comments on this PR

@adamziel
adamziel merged commit c5aec8f into trunk Nov 3, 2026
62 checks passed
@adamziel
adamziel deleted the reprint-clone-link branch November 3, 2026 23:52
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.

1 participant