Skip to content

fix(share): ask before sharing from Studio and bind each action to the confirmed review - #8268

Merged
ukimsanov merged 6 commits into
mainfrom
fix/share-confirm-target
Nov 20, 2026
Merged

ukimsanov merged 6 commits into
mainfrom
fix/share-confirm-target

Conversation

@ukimsanov

@ukimsanov ukimsanov commented Nov 20, 2026 •

Copy link
Copy Markdown
Collaborator

What

Before CLI Studio shares anything, it now asks the person to confirm, naming the review the action reaches, its workspace and who can open it. Each action carries the id of the review the person confirmed, and the local share routes refuse any action whose review is missing or no longer matches.

  • Every share action asks first. Create share link, Update shared version, Save access, Turn link on, Turn link off and Retry with video only all go through one confirmation (shareConfirm.ts). Sign in does not.
  • The review is named. The share status now carries reviewId and reviewTitle. That includes a folder whose .hyperframes/review.json names a review it never finished opening, which is the state a received folder can arrive in. In that case the dialog says the folder is already linked to an existing review and tells the person to cancel if they didn't share it. The title is shown on one quoted line, so a title can't add fake lines to the dialog.
  • The server checks it. POST /api/share/actions needs confirmedReview: the review id, or null for "no existing review". A missing value is refused with confirmation_required. A value that doesn't match the project's review now is refused with share_target_changed, and nothing is changed. After that refusal Studio reloads and drops the earlier audience choice.
  • Docs: export-and-share.mdx describes the confirmation and received folders, and now says project files are included only when the person chooses them (the old line said "when available").

Before

main, CLI Studio signed in, a folder whose .hyperframes/review.json names a review (a fake id, so nothing could change): choosing Create share link sends the share request straight away. No question is asked and the review is never named.

pr8268-before

After

This branch, same folder, same click: the confirmation says the folder is already linked to an existing review, names it and who can open it. Cancel sends nothing.

pr8268-after

Why

The local share routes acted on whichever review .hyperframes/review.json named, with the audience from the request, and never showed the person the target. A folder someone sent could carry a record pointing at an existing review, so a first "Create share link" could add a video to that review and change who can open it.

Related work

#7846 (Studio's preview sealed by default) is the other half of this work and lands separately.

Not in this PR:

  • hyperframes share in a terminal follows the project's review record without a prompt, as it does today.
  • A record that holds an unfinished registration but no review id is confirmed as a new share.

Test plan

  • fails without the fix:
    • shareRoutes.test.ts, "share actions need the review the person confirmed": each action without a confirmation, a first share whose folder record names a review, a different review, and a non-id value are refused with nothing changed.
    • service.test.ts: "names the review a folder's record points at even before it was ever opened".
    • QuickShare.test.tsx: cancel sends nothing; the access dialog names the review, link, workspace and Now/After; an already-linked folder is called out; a first share confirms null; after share_target_changed the earlier choice is dropped.
  • CLI share tests (route, service, presentation, freshness) and Studio share tests pass. tsc --noEmit passes for cli, studio and studio-server; oxlint, oxfmt, fallow and the comment ratchet pass.
  • Unit tests added/updated
  • Manual testing performed: in a real browser against this branch's CLI Studio, signed in. With a test .hyperframes/review.json naming a review, Create share link showed "This folder is already linked to an existing review…"; without it, "Create a share link for this project?" with the workspace and audience. Cancelling sent no request to /api/share/actions in either case.
  • Documentation updated (if applicable)
  • Comments follow CONTRIBUTING.md "Comments"

A composition's script runs on Studio's origin by default, and a received
folder's .hyperframes/review.json can point Studio at an existing review.
Every share action except sign-in now asks the person first, naming the
review (its link), who can open it, the workspace and whether project files
are uploaded. The request carries the manage link of the review that was
shown, and the server refuses it with share_target_changed when the
project's review no longer matches, so nothing is shared or changed.
… confirmed

Studio now gets the id and title of the review an action reaches, including a folder
whose record names a review it never opened (a received folder can ship one). The
confirmation names that review, its workspace and who can open it, and says plainly
when a folder arrives already linked. Actions carry the confirmed id; a missing one is
refused as confirmation_required and a different one as share_target_changed, and
after that refusal Studio drops the earlier choice. The docs describe the
confirmation and that project files are included only when chosen.
@mintlify

mintlify Bot commented Nov 20, 2026 •

Copy link
Copy Markdown

Preview deployment for your docs. Learn more about Mintlify Previews.

Project Status Preview Updated
hyperframes 🟢 Ready View Preview Nov 20, 2026, 3:21 AM

💡 Tip: Enable Automations to automatically generate PRs for you.

@github-actions

github-actions Bot commented Nov 20, 2026 •

Copy link
Copy Markdown
Contributor

Edit accuracy: accurate 271 (base branch 271), smooth 62 of those

The gate passes.
Smoothness is reported in the artifact, not gated. A case fails only if it fails 2 of 3 runs.

Quarantined, measured but not gated (0)

Unstable (4)

  • seqinflight-none-pct-r0-root-z100: tracking 0.05, pressJump 0, drop 0, reload 0, render 0.03, renderKey -, undo false, teleport true / tracking 0.05, pressJump 0, drop 0, reload 0, render 0.03, renderKey -, undo true, teleport true / tracking 0.05, pressJump 0, drop 0, reload 0, render 0.03, renderKey -, undo true, teleport true
  • seqplainkeys-none-pct-r0-nested-z100: tracking 0.05, pressJump 0, drop 0, reload 0, render 0.02, renderKey -, undo false, teleport true / tracking 0.05, pressJump 0, drop 0, reload 0, render 0.02, renderKey -, undo true, teleport true / tracking 0.05, pressJump 0, drop 0, reload 0, render 0.02, renderKey -, undo true, teleport true
  • seqresizeundo-none-pct-r0-root-z100: tracking 0.06, pressJump 0, drop 0, reload 0, render 0.03, renderKey -, undo false, teleport true / tracking 0.06, pressJump 0, drop 0, reload 0, render 0.03, renderKey -, undo true, teleport true / tracking 0.06, pressJump 0, drop 0, reload 0, render 0.03, renderKey -, undo true, teleport true
  • seqab-none-center-r0-root-z100: tracking 0.03, pressJump 0, drop 0, reload 0, render 0.02, renderKey -, undo true, teleport true / tracking 0.03, pressJump 0, drop 0, reload 0, render 0.02, renderKey -, undo true, teleport true / tracking 0.03, pressJump 0, drop 0, reload 0, render 0.02, renderKey -, undo true, teleport true

@eddy-heygen eddy-heygen left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

(Eddy's agent) Reviewed by Eddy's Claude agent at commit cd9325f (non-test diff read by me).

Verdict: approve. This is the confirmation half; as the description says, it protects the person's own clicks, and a script running in the page is stopped only by the sealed-preview half.

Summary
A project folder can arrive with its own review record pointing at an existing shared review, so pressing Share could add to, re-open or change a review the person never created. Every share action in Studio now asks first and names the review, the link, the workspace and who can open it, with an explicit warning when the folder is already linked. Each action carries the review id the person confirmed, and the local server refuses a missing or different one before anything changes.

What I checked

  • Server: every action except sign-in must carry confirmedReview; a missing one is a 400, and one that differs from the review the project points at now is a 409, both before the action runs. The value must be null or a short id; any other shape is refused with the rest of the input.
  • The status now reports the review id and title, taken from the active share or, failing that, the folder's review record, so a folder-supplied link is visible before anything is shared.
  • Client: the confirmation text is built from that status; the review title has control and separator characters collapsed and is cut to 80 characters, so a crafted title cannot push the rest of the message out of view.
  • The "turn link off" prompt moved into the same confirmation path, so it is still asked.

Non-blockers

  • The confirmation is a page dialog and the confirmed id is supplied by the page, so code running in the page can still supply both. That is the stated remainder until the preview is sealed.
  • The title lookup for a folder-recorded review that fails is shown as "title not available"; the warning text still appears.

A question I cannot answer from this repository

  • Whether register idempotency on the review service is scoped to the calling account lives in that service, not here; it needs its owner.

CI: 51 pass, 40 skipped, none failing or pending.

@ukimsanov
ukimsanov added this pull request to the merge queue Nov 20, 2026
Merged via the queue into main with commit 2c34270 Nov 20, 2026
225 of 227 checks passed
@ukimsanov
ukimsanov deleted the fix/share-confirm-target branch November 20, 2026 06:43
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.

2 participants