Skip to content

feat(web): Blocks v8 site editor — content backends, deco serve, hosted Publish, Versions and site tokens - #7888

Closed
tlgimenes wants to merge 3 commits into
fold/v8-apifrom
fold/v8-web
Closed

tlgimenes wants to merge 3 commits into
fold/v8-apifrom
fold/v8-web

Conversation

@tlgimenes

@tlgimenes tlgimenes commented Oct 13, 2026 •

Copy link
Copy Markdown
Contributor

Stacked on #7887, the API PR. This is the editor side of Blocks v8 (part 2 of 2).

Together with #7887, this replaces the v8 stack (#7877, #7800–#7825, #7803–#7840, #7841–#7843, #7871–#7878), whose PRs are closed with a link here; their branches are kept. Before main moved on, the final tree of this branch equalled the stack's top, split/51-v8-per-site; it is now rebased on main (below).

Decision model (PO, 2026-10-12)

The editor waits until it has both a schema and the content for its mode. Then it decides with isV8Schema, and never renders the v7 path first.

Mode When Schema from v8 not v8
Localhost a deco serve connection is chosen, or the account-less /site-editor the deco serve content protocol on the deco serve guided "not v8" state
Sandbox the session has a sandbox the sandbox working tree, through Studio's /sandbox/:id/:branch/rpc (#7887) content protocol over the daemon's fs routes the existing v7 sandbox path
GitHub otherwise main, through schema.get on /decofile/:id/main/rpc main + CDN draft (hosted CMS) content from the branch, as on main
  • A schema that can't be read counts as v7, unless the server last found the site v8 (the blocksMajor marker). In that case the editor waits and retries.
  • The marker is only a hint. It never makes a site v8.
  • No sandbox: a session without a sandbox gets a 404 on the sandbox route, which is read as v7 straight away.

What's in it

  • Content backend:
    • selectContentBackend / useContentBackend pick GitHub, a sandbox, or a local deco serve.
    • One content-protocol client feeds the sections editor, the Content tab and Preview.
    • v8 variant previews go through the draft pointer.
  • v8 editing:
    • v8 schema shapes and a schemaless editor.
    • Protocol fields with secrets encrypted in the browser, and asset uploads. Uploads go to S3 in project mode; only Localhost and /site-editor upload through deco serve.
  • deco serve:
    • The editor finds a running deco serve on localhost.
    • Connect links, a first-run guide and notices.
    • The Local draft option, and the account-less /site-editor on the org rail.
  • Hosted v8 projects:
    • Publish, the Versions (releases) tab, and site tokens in settings.
    • A guided state when another project owns the site.
    • Every message is in business language, one toast per action.
  • Shared:
    • The releases sidebar view, plus its generated tool contracts.
    • The web halves of the v8 detector guard test.
  • e2e:
    • The content protocol over GitHub, using a stubbed Git Data API.
    • The content protocol over a deco serve stand-in built from @decocms/blocks.
    • Drafts, and hosted Publish against a stub delivery bucket.
    • The v8 gates.
    • @decocms/blocks is allowed in e2e as the published wire contract.
  • .gitleaksignore: a fingerprint for the synthetic site token in site-token-section.test.tsx, recorded for this PR's commit.

Discard on hosted v8 projects (PO decision)

The v8 draft is a sparse map of the blocks that differ from main ({set, delete} in apps/api/src/hosted/draft-store.ts), layered over main's current snapshot whenever it is read (layerDraftFiles).

  • Discard = remove those blocks from the draft. It always calls POST …/git/discard (draftGitDiscard drops the entries from set and delete). There is no main sync: nothing reads main's diff or writes main's body back.
  • Without the entry, the editor and the preview show main as it is now, and follow main when it moves later.
  • It runs in the editor's per-block write queue (runContentDiscard): armed autosaves of the discarded blocks are dropped, and it lands after writes already in flight. Then comes the shared refresh: blocks re-read, draft pointer → preview reload, git status, change list, form re-seed. The header and the preview show the shared saving/reloading state.
  • The server's "same as main → no entry" rule (sameAsMain in applyAttemptToDraft, feat(api): Blocks v8 server side — content protocol (GitHub + sandbox over the daemon's fs routes), hosted releases and site tokens #7887) stays, for an edit typed back to main's exact value. Discard no longer depends on it.
  • v7 discard is unchanged.

Releases: Reapply version and Latest (PO decisions 2026-10-14)

The API side is in #7887. This supersedes the earlier "Go live" and "Republish" wording; none of it is left.

  • Action: Reapply version (pt-BR Reaplicar versão) in a version's ⋮ menu, on every version with a release except the Latest one.
    • The dialog is calm and asks once.
      • Title: "Reapply this version?"
      • Body: "This publishes a new version with the same content as “”. Changes made since will be replaced on your site."
      • Button: Reapply
    • If that version was made for an earlier design of the site, the dialog adds one line: "If something doesn't look right afterwards, reapply the version you have now to go back."
      • The line comes from GET …/reapply, which is read while the dialog is open. The button never waits for it, and a failed read leaves the line out.
      • There is no second confirmation and no warning.
    • Toasts:
      • "Reapplying…"
      • Then "Reapplied. Your site will show it shortly." It adds "If something doesn't look right, reapply the previous version to go back." only when the schema changed.
      • On failure, "Couldn't reapply this version." with Try again.
    • Other outcomes:
      • Saved but not released: Publish's Try again (releases/retry).
      • A concurrent publish: a guiding warning.
      • Content already there: "Your site already has this version's content."
  • Rows: the new row reads "Reapply: " (pt-BR "Reaplicação: …").
    • A version that had no note gets a dated label instead.
    • A "Same content as the version from " link scrolls to the original.
  • Pill: Latest / Mais recente marks the version latest.json names. It says nothing about what visitors see this second.
    • No served-revision reads, no polling, no "Going live…".
    • The header says "Last published ." or "Nothing published yet".
  • Copy guard: site-editor-copy.test.ts keeps "live", "no ar", "republi…" and "anyway / mesmo assim" out of every releases.* string, on top of the existing git-word ban.
  • Content-change kind: reapply.
  • e2e (content-protocol-github.spec.ts):
    • The GET check says schemaChanged: false.
    • Reapplying the first version makes a new top version (Reapply: Publish One, reapplyOf = first). Its stored content equals the first one's, main holds it, and latest.json names the new commit with a newer publishedAt.
    • Reapplying again is up-to-date.
    • A commit with no release gives 404 on both the GET and the POST.
    • releases/current gives 404.
    • A later Publish lands on the restored content.
    • releases/retry releases main's head.

PO decisions on differences a v7 user can see (2026-10-14)

A5 and A14–A18 were found in the same audit and are fixed in this tree: v7 picks the legacy backend with no probes, and v7's Advanced → Local is main's.

Rebased on main 1a6b3da (2026-10-17)

Stacked on #7887 at 9661c28a7, which is rebased on origin/main at 1a6b3da99. The web commits are replayed one by one with the same subjects; the four merges of fold/v8-api into this branch are gone (their content is in the new base). The previous history is on backup/fold-v8-web-2026-10-17 (and feat/blocks-v8-hosted on backup/feat-blocks-v8-hosted-2026-10-17). One conflict, in the first web commit: apps/web/src/lib/localstorage-keys.ts, where main's #8031 added the preview device size, editing mode and array-field layout keys next to this branch's deco serve keys; both are kept. Apart from that, the branch's diff against #7887 is the same as before. feat/blocks-v8-hosted points at this branch's head.

New on top, from the e2e run after the rebase:

  • b5d79797a test(e2e): the hosted session read answers changedBy next to the draft pointer. Since feat(api): Blocks v8 server side — content protocol (GitHub + sandbox over the daemon's fs routes), hosted releases and site tokens #7887's 0d8ce2bdf the session GET of a hosted v8 project answers { draft, version, changedBy }; the draft pointer test still expected exactly { draft, version }. It now expects changedBy: {} before any save and the saved block's { userId, at } after the first one.
  • 695fca387 test(e2e): the GitHub conformance run opens one socket per request. The conformance suite's oversize-body case is answered 413 before the body is read; the preview server's proxy then breaks that socket (EPIPE), and the next request that reused it failed with ECONNRESET (once in three runs). The suite's fetch now sends connection: close.
  • The first web commit's site-token test fixture (a synthetic JWT whose parts decode to {"alg":"EdDSA"}, {"site":"acme-store"} and "signature") now carries a gitleaks:allow marker and a comment saying so. Gitleaks' history scan had flagged it on this PR since the 2026-10-16 squash.

Earlier rebase on main f3dffbf (2026-10-16)

Stacked on #7887 at 3914dd50e (head 10684efe8), which is rebased on origin/main at f3dffbf3e. The old merges of fold/v8-api and main are gone, and the branch is now:

  1. acf7aed67 feat(web): the v8 site editor, hosted Publish, Releases and site tokens: a squash of the 23 web commits that predated fix(decofile): stop stale editor copies from reverting other drafts' block changes #7909 (they were written before it and would each have had to be redone on main's save path; the list is in the commit message, and the old history is on backup/fold-v8-web-2026-10-16).
  2. 519b66e20 test(e2e): the e2e parts of those commits.
  3. 193f9b992 test(web): the A9 six-level menu test.
  4. The six later commits, replayed with their own subjects: b01564e93 (v8 stale-save protection, below), 475e58012 (Settings no longer creates CMS.json), 88fcbc9d4 (deco serve e2e on a production build), 32edcd153 ("." on a page opens that page), c80bd99d9 (no uncaught AbortError from a skipped preview transition) and be3506b16 (a section form saves one change at a time).
  5. ff469ff01 fix(web): a deep link to Releases waits for main's schema instead of bouncing to Settings. With fix(web): keep loading states on the widget that is loading #8002 the tab bar no longer suspends on the dev MCP client, so the deep-link check ran before main's schema read had landed and sent /releases to Settings; the schema read is now a pending state for Releases, like the assets and site-access probes.
  6. 05d4ae549 fix(web): a merge never swaps a field under the user's cursor (below).
  7. f9bcd8460 fix(web): what a user types after "The latest version was kept" is saved (below).
  8. 894e51697 test(e2e): the CMS settings guard test holds the editor's polls.
  9. 8fa2ab3c5 fix(web): typing the same text again after "The latest version was kept" saves it (below).
  10. 10684efe8 test(e2e): stale-form toasts are counted as they appear.

The final tree equals a plain merge of the old head with main. What main changed under this branch, and how it is kept:

v8 saves get the same protection (b01564e93):

  • What is compared: the content protocol's per-entry version. blocks.apply with ifMatch: { <block>: <version> } writes only while the entry's current version (any spelling) is still that one; otherwise it writes nothing and answers Conflict.
  • Where the version comes from: the editor keeps each block's version next to the blocks cache, from full blocks.list reads and from each blocks.apply answer; after a refusal, from changes.get. A block being saved keeps its last landed version through polls.
  • Section form: the form's starting point becomes the SaveGuard's ifMatch (formSaveGuard, form-base.ts). A saved block expects the version the form's copy was checked against, moved by each landed save of the form; a page expects its cached version. Both are read when the save runs, after the branch's earlier saves land.
  • A refused save behaves like fix(decofile): stop stale editor copies from reverting other drafts' block changes #7909's 409: the block is read again (the stored copy and its version replace the edit in the cache), there is no optimistic rollback, and the save fails with the same BlockConflictError and copy, so the form retries once on the stored block (applying its edits on top, with fix(decofile): stop stale editor copies from reverting other drafts' block changes #7909's "This block was updated while you were editing" toast) and otherwise reloads with "This block changed while you were editing and could not be saved. The latest version is loaded."
  • Other v8 editors (SEO sheets, Settings, app editors) keep their current guards; Settings' create-only guard is unchanged.

Same-field conflicts: the user chooses (PO decision 2026-10-16)

PO: "instead of a toast, add a dialog with accept mine vs theirs and maybe show the diff? … Instead of using these heuristics, let the user decide". This replaces the same-field toast and the heuristics that served it.

  • Values only one side changed still merge silently (with fix(decofile): stop stale editor copies from reverting other drafts' block changes #7909's "This block was updated while you were editing" toast), now item by item inside lists, so two people editing different fields of the same slide no longer clash.

  • Values both sides changed to different things: nothing of the form's is written. Its saves for that section wait, and one dialog opens (never a toast, never two dialogs: a second waiting choice opens after the first is settled):

    One field, the common case (PO 2026-10-19, "Option B: two people, two cards"):

    ┌ Someone else changed the title while you were editing ─────┐
    │ Pick the one to keep. The other is discarded.              │
    │ ┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓ │
    │ ┃ (D) You  Your version · not saved yet                  ┃ │
    │ ┃     Register [today] and Save [Big!]                   ┃ │
    │ ┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┛ │
    │ ┌────────────────────────────────────────────────────────┐ │
    │ │ (o) Someone else  Their version · already saved        │ │
    │ │     Register [now] and Save [Big this Summer!]         │ │
    │ └────────────────────────────────────────────────────────┘ │
    │                                                      [OK]  │
    └────────────────────────────────────────────────────────────┘
    

    Two or more fields: one field per step (PO 2026-10-19 approved the proposal, "good"):

    ┌────────────────────────────────────────────────────────────┐
    │ ━━ ● ●                                              1 of 3 │
    │ Ana also changed the title                                 │
    │ Pick the one to keep. You can go back before saving.       │
    │ ┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓ │
    │ ┃ (D) You  Your version · not saved yet                  ┃ │
    │ ┃     [Huge] Summer Sale!                                ┃ │
    │ ┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┛ │
    │ ┌────────────────────────────────────────────────────────┐ │
    │ │ (AS) Ana Souza  saved 3 minutes ago                    │ │
    │ │     [Big] Summer Sale!                                 │ │
    │ └────────────────────────────────────────────────────────┘ │
    │ [Back]                                              [Next] │
    └────────────────────────────────────────────────────────────┘
    

    The last step (3 of 3): the hint becomes the summary "Title: yours · Cta › Label: Ana's · Cta › Href: yours" and Next becomes OK, which saves the picks:

    │ [Back]                                                [OK] │
    

    Each card is a radio (the whole card; arrow keys move the choice), and the one button, OK, saves the card chosen. With several fields, the same two cards come one field per step: a dot per field (a button named by it; the current one wider, the ones moved on from filled) and "1 of 3", Next keeps the pick and moves on, Back, a dot or the ←/→ keys revisit a step (on a card, ↑/↓ change the pick). Next on every step but the last, OK on the last (PO 2026-10-19: "remove the 'keep yours' label into something like next/next/done", then "instead of done, ok"). Nothing is saved before OK. Fields are named by their form labels. Text shows a word-level diff (the words the other version lacks are highlighted, rich text without tags); images show thumbnails; lists show their size and first item titles; small objects show their fields; Yes/No for booleans. On hosted v8 their card names the person (see the next section).

  • Saving (the dialog's one primary button) writes one save of the chosen values over their version, guarded by that version (Fast Preview expect = its fingerprint, v8 ifMatch = its content-protocol version), and the form shows the result. If yet another change lands while the dialog is open, the dialog shows the newer version in place within a few seconds ("Their version changed again while this was open."), keeping the choices whose two versions didn't change (the other fields go back to yours); with several fields, the dot of each field whose version changed gets a ring until the user visits that step: while a dialog is open the editor reads the stored blocks again every 3 s (15 s after two minutes), on v8 the content protocol's conditional blocks.list (its own poll is 30 s on GitHub), on Fast Preview a conditional GET that answers 304 for an unchanged branch (no new draft grant, so the preview stays put). A save that races it is still refused and asked again the same way. It never retries silently.

  • It must be answered (PO 2026-10-18): "when clicking 'decide later', looks like the ui stops sending or saving and we kind of stay in a frozen state. If the user needs to decide, we need to raise an alert dialog with no close option". The dialog is an alert dialog: no x, and Escape or a click outside don't close it; only saving a choice does. "Decide later", the "aren't saved yet / Choose versions" notice and the paused-saves state behind it are removed. Guarantees kept: nothing is lost, one save at a time, nothing written over a newer version without the user's choice.

  • Yours preselected (PO picked "Must-decide dialog, 'yours' preselected"): your card starts on yours, on every step, so one click on OK keeps the user's edit.

  • Wording (PO 2026-10-18): "'Keep all mine' and 'your version' wording is not a really good match, maybe 'Keep yours' and 'Use theirs'". No "mine" anywhere.

  • Buttons: Next and OK (PO 2026-10-19): "only for the button labels. Remove the 'use theirs for all' button. Also, remove the 'keep yours' label into something like next/next/done", then "instead of done, ok". The single-field dialog's button is OK too, for consistency. "Use theirs for all" and the labels that named the outcome ("Keep yours" / "Keep a mix" / "Use theirs") are removed with their strings; to use theirs, click the other card.

  • Layout: two people, two cards (PO 2026-10-19, "i like the friendliest option b"); several fields one at a time (PO 2026-10-19, "good"). One field: the title names the field ("Someone else changed the title while you were editing"; pt-BR "Outra pessoa mudou o campo “Título” enquanto você editava", which reads naturally whatever the label's gender), "Pick the one to keep. The other is discarded.", then You (your avatar or initials, "Your version · not saved yet") and Someone else ("Their version · already saved"); no dots, no Back or Next. Several fields: "Someone else also changed the title" (pt-BR "Outra pessoa também mudou o campo “Título”"), "Pick the one to keep. You can go back before saving." (pt-BR "Escolha qual versão manter. Dá para voltar antes de salvar."), the last step's summary "Title: yours · Cta › Label: theirs" (pt-BR "Título: a sua · …: a deles"). On hosted v8 the steps name the member ("Ana also changed the title"; "You also changed the title in another tab or window") and the summary says "Ana's" (pt-BR keeps "a deles"). pt-BR buttons: "OK"; several fields "Voltar" / "Próximo" / "OK". The per-field switch layout (the mock's Option A) and its strings ("Yours" / "Theirs", "… changed 2 fields …", "Choose which version to keep for each field.") are removed. Screenshots from the v7 kit (LAN), light / dark: one field light / dark; three fields, step 1 light / dark; step 2 with theirs picked light / dark; the last step with the summary and OK light / dark.

  • Typing while the dialog is open: it is modal (focus is trapped), so nothing reaches the form behind it.

  • Removed: the "Changed while you were editing … The latest version was kept" toasts, mergedFormDisplay "on-leave" and FormBase.displayed / markEditedSinceDisplayed / formValueOnBase (typing on after the toast saved over theirs). Kept: one save at a time per form, the retry backoff, and the on-leave reload for a section replaced or a content sync while typing (not same-field specific).

  • A form save's page, page variant and section variant are now fixed when it is scheduled (FormSaveTarget), so a retry or a later choice writes to the section it was made for.

  • Copy in en and pt-BR (sectionsEditor.formConflict.*); unit tests form-conflict.test.ts (merge plan, choices, pointers, previews, word diff) and form-conflict-dialog.test.tsx (one field: title, cards as radios with yours chosen, diff marks in each card, one OK button saving the card chosen, arrow keys, initials, image previews; several fields: dots as buttons named by the field, "N of M", Next / Back / a dot / the ←/→ keys (not in a text field), ↑/↓ on a card, yours on every step, Back + Next on every step and Back + OK on the last, the last step's summary, OK saving the picks, a double click on Next not saving, the ring on a step whose version changed while open; markTheirsChanged; who and when on hosted v8).

Who made the other change, and when: hosted v8 only (PO 2026-10-16)

PO: "yes, this is pretty important", then (final) "only have metadata and changed by on v8 hosted". On a hosted v8 draft the same-field dialog says who made the other change and when:

┌ Ana changed the title while you were editing ──────────────┐
│ Pick the one to keep. The other is discarded.              │
│ ┏ (D) You  Your version · not saved yet ━━━━━━━━━━━━━━━━━┓ │
│ ┃     Register [today] and Save [Big!]                   ┃ │
│ ┌ (AS) Ana Souza  saved 3 minutes ago ───────────────────┐ │
│ │     Register [now] and Save [Big this Summer!]         │ │
│                                                      [OK]  │
  • One field: the title uses the first name ("Ana changed the title while you were editing"); their card shows the member's avatar, name and "saved 3 minutes ago" (the exact time on hover). The viewer's own change: "You changed the title in another tab or window", card "You, in another tab or window". Only the time known: "Someone else", "saved 5 minutes ago". The button is OK whoever the card names.
  • Several fields: every step names them ("Ana also changed the title"; "You also changed the title in another tab or window"), their card has the avatar, name and "saved 3 minutes ago" as with one field, and the last step's summary says "Title: Ana's" (pt-BR keeps "a deles"). The separate author line above the fields is removed with the switch layout.
  • Nothing recorded: as on v7 ("Someone else", "Their version · already saved"). en and pt-BR.
  • Source: the session read's changedBy, which comes from the draft object's storage metadata (feat(api): Blocks v8 server side — content protocol (GitHub + sandbox over the daemon's fs routes), hosted releases and site tokens #7887). The dialog reads it once per version of theirs shown, so "Their version changed again" reads it again; never per poll. The id is resolved from the org's members (useMembersQuery's cache).
  • Fast Preview (v7), Localhost and sandboxes: no line. Nothing is stamped on any block. The earlier git-history, draft-edits and block-__meta versions are reverted (63ed9b252).
  • Tests:
    • Unit: conflict-author.test.ts (only a hosted draft has a source, spelling match, member resolution, you, time only) and form-conflict-dialog.test.tsx (names on the cards and titles, hover time, the steps' titles and summary with a name).
    • Unit: use-save-block-v8.test.tsx checks a save sends the block exactly as the form holds it, with no __meta and no user id.
    • e2e: the v7 stale-form and deco-serve same-field cases expect "Someone else · Their version · already saved".
    • e2e: content-protocol-github "saves into the CDN draft" expects one object whose JSON is exactly { set, delete } with no editor data, and the names in x-amz-meta-deco-edited.
    • e2e: a new hosted-v8 same-field case expects "You, in another tab or window".
    • The e2e delivery stub keeps x-amz-meta-* and answers it on GET/HEAD. The spike kit runs that stub from its worktree and picks it up when moved to this head; the kit itself is untouched.

Concurrent edits: fixes also proposed for main (#8027)

The second and third bullets below (the on-leave display and typing on after the toast) are superseded by the dialog above.

Found on the spike kit with two people editing one block of a v7 site with Fast Preview, under load. They are main's code (#7909's merge and #8000's retries), so the same fixes are in #8027, a small draft PR against main, so v7 sites get them without waiting for this stack:

  • An edit lost after a refused save (be3506b16): the form could send a second save while the first was on the wire; mutate() reports only the latest call, so after the first was refused the replay counted the user's own edit as a conflict and kept the stored value (and the toast named the wrong field). A section form now sends one save at a time (mutateAsync), and a retry reads the form's value when it runs.
  • Keystrokes appended to the other person's text (05d4ae549): a merge that kept the other editor's value of the field being typed in replaced it under the cursor ("Picks A again" + "holk"), and that mix was saved. While focus is in the form, the form keeps what the user types and re-reads the stored section once they leave it. A sync that rewrites the content (this stack's content epoch) waits the same way.
  • What the user types after "The latest version was kept" was lost (f9bcd8460, 8fa2ab3c5): found by the respike on both v7 and v8. The field still showed the user's text, but the form's baseline stayed the refused copy, so the next keystrokes were merged against it again, dropped with a second toast, and the field flipped to the other editor's value when they left. The form's baseline is now the merge it saved (FormBase.displayed holds what it shows instead): a value the user changes after the notice, even typed back to the same text, is saved over the stored one they were told about; values they don't touch keep the stored value; a change from elsewhere after that is still caught by fix(decofile): stop stale editor copies from reverting other drafts' block changes #7909's check (and ifMatch on v8). Nothing is ever a mix of both texts.
  • Toasts (be3506b16): the form's field labels ("Headline", not "title"), "The latest version was kept." when nothing else of the user's was left to save, and one toast per action.
  • Uncaught "AbortError: Transition was skipped" in the preview (c80bd99d9): all three view-transition promises are handled. A second path found by the QA video (2026-10-19, 8cdb102af, ee7cf18e4): a site with page-to-page view transitions (@view-transition { navigation: auto }) gets one on every reload a save makes, and a new ?__draft= pointer set while the frame still loaded the last one cancelled that load, so the page being left rejected its pageswap transition. A Fast Preview frame now loads one draft at a time (the latest pointer goes in after the frame's load, the ones in between skipped, a load that never fires released after 15 s), and the editor script settles the outgoing page's transition where the site runs it.
  • The open conflict dialog didn't follow their version (QA video 2026-10-19, f27634baf): nothing read the stored blocks while it was open on v7, and on hosted v8 the poll is 30 s. It now polls while open (see the dialog section), and the in-place re-plan is refreshWaitingChoice.

e2e on a production build of 10684efe8: site-editor-stale-form 11/11 in 3 runs with 4 workers (the two new tests fail without the fixes: the stored headline stays "Published headline"); content-protocol-deco-serve, fast-preview-git-sync, decofile-api, site-editor-breadcrumbs and standalone-blocks-panel pass. content-protocol-github's conformance test hit an ECONNRESET from the API twice with 4 workers on a loaded machine and passes 3/3 alone (no API code changed here). The test waits in site-editor-stale-form now allow for main's backoff retry (#8000) under load, and its toasts are counted as they appear (a toast could expire before it was counted). The deco serve test "Settings' first save never replaces a CMS block created meanwhile" holds the editor's polls until its save goes out, so only the ifMatch guard can tell (under load a poll showed the conflict first and the click hung).

Checks

  • Rebase on 1a6b3da99 (2026-10-17, head 695fca387): packages/shared, apps/api, apps/web and packages/e2e typecheck (tsc, single-threaded); oxlint, biome and knip are clean. Unit tier as CI runs it (per-file isolation, --parallel=2, 2 GB cap): the web suite 4819 pass, 0 fail; the api, migrations, packages, plugins and scripts suites 6856 pass, 0 fail. e2e on a production web build (shared Postgres/NATS, clean database and streams per run, 4 workers): site-editor-stale-form + content-protocol-deco-serve 23/23, twice. content-protocol-github + decofile-api + fast-preview-git-sync: the first run had 2 failures, both fixed above (the draft pointer's changedBy, and the ECONNRESET after the 413); then 44/44, and content-protocol-github 22/22 twice more. That includes the hosted v8 "changed by" case ("a field another editor also changed asks whose version to keep, saying who and when"), which runs against the delivery stub's x-amz-meta-* support from 806cea686. On the spike kit (shared Docker infra), smoke-persite.mjs passes every step at 0ac6d127d, which differs from the head only by the test fixture comment. CI at 695fca387: SAST (with Gitleaks) passes on the PR; dispatched on the branch, Checks & Unit Tests 39087013585, E2E 39087015044 and Sandbox 39087016541 all passed.

  • Who and when on hosted v8 (revert 63ed9b252, merge d0188b4b6 of feat(api): Blocks v8 server side — content protocol (GitHub + sandbox over the daemon's fs routes), hosted releases and site tokens #7887's 0d8ce2bdf, 806cea686 web, 2026-10-16): apps/web and packages/e2e typecheck (tsc, single-threaded); oxlint and biome are clean. Unit tests: sections-editor + i18n + sandbox/content 1847 pass. e2e is written but not run yet.

  • Same-field dialog (731befa59, c63ee03c3, 05b411361, 2026-10-16): apps/web and packages/e2e typecheck (tsc, single-threaded), oxlint and biome are clean; sections-editor unit tests 1160 pass, i18n 13 pass. e2e on a production web build (4 workers, shared Postgres/NATS, clean database and streams per run): site-editor-stale-form 12/12 and content-protocol-deco-serve 11/11, three runs each (keep mine, decide later then use all theirs, mixed per-field choices, different fields with no dialog, a third change while the dialog is open, the v8 deco-serve same-field case). The first run had one failure, a test bug fixed in 05b411361: the Keep mine case looked for the form behind the modal dialog with a role locator, and a modal dialog hides everything else from roles (the screenshot shows the dialog open and "Draft headline" in the form). decofile-api 19/19, fast-preview-git-sync 3/3 and content-protocol-github 21/21, one run each.

  • On 10684efe8 (2026-10-16): apps/web and packages/e2e typecheck (tsc, single-threaded), oxlint and biome are clean; sections-editor unit tests 1145 pass. On the spike kit (Vite dev, this head), the respike's stale-save flows pass: v7 different fields / same field / typing on after the notice / mid-typing / mid-typing with a pause, 5 of 5 rounds each; v8 different fields, same field then leave, typing on in the form and typing the same text again. smoke-persite.mjs passes every step.

  • After the rebase: apps/web, apps/api and packages/shared typecheck (tsc, single-threaded), oxlint and biome are clean. Unit tests: the web suite 4771 pass, 0 fail (use-cms-publish-actions.test.tsx expects main's discard call without fastPreview); the api, migrations and shared suites 5946 pass, 1 fail (heartbeatWhileQueued, a timing test outside this stack). e2e was not re-run after the rebase. On the spike kit (this head, with Postgres and NATS run by the kit since chore(dev): replace managed CLI runtime with Compose Watch #8006), smoke-persite.mjs passes every step, including the Releases deep link.

  • Before the rebase: after the merge and the v8 protection: apps/web, packages/e2e typecheck; oxlint, biome and knip are clean. Unit tests: sections-editor 1123 pass, including new content-protocol-versions.test.ts (7), use-save-block-v8.test.tsx (3) and formSaveGuard (7 in form-base.test.ts); the web and shared suites 5579 pass (6 fail only under load in one parallel run, each passes alone). Local e2e (Vite dev server): the new deco-serve test "a section form saved over another writer's change keeps that change" passes (another writer changes the teaser on disk, the form saves its title with the stale version, the save is refused, retried on the stored block, and both changes stay); site-editor-stale-form.spec.ts 6 of 7 pass, the 7th fails locally after page.reload() with ERR_INSUFFICIENT_RESOURCES from the dev server; three deco-serve tests fail locally the same way on fold/v8-web before this merge (b54688cb6), so they are environment, not regressions. CI runs the production build.

  • git diff origin/main -- packages/sandbox is empty (before the rebase, so was git diff --stat origin/split/51-v8-per-site origin/fold/v8-web).

  • Web, e2e and ui typecheck. oxlint, biome and knip are clean.

  • gitleaks git over this PR's range and feat(api): Blocks v8 server side — content protocol (GitHub + sandbox over the daemon's fs routes), hosted releases and site tokens #7887's finds nothing.

  • CI on this branch at 35c2565f3 (includes origin/main at d1a1d7375), dispatched because the PR isn't based on main: Checks & Unit Tests 38442302426, E2E 38442306822 and Sandbox 38442311474 all passed.

  • The stack's top (87ed82439, same tree) passed Multi-Pod 38444814521.

  • After the discard change (172d120e3): Checks & Unit Tests 38495201848 and E2E 38495204785 passed. feat/blocks-v8-hosted (d78a2a58f) is a normal merge with the same tree.

  • Reapply version (c9bca4bd4), dispatched: Checks & Unit Tests 38505661256, E2E 38505663535 and Sandbox 38505665790 all passed. Web typecheck, oxlint, biome and knip are clean. feat/blocks-v8-hosted (4cb4845ad) is a normal merge with the same tree.

  • A9 revert (b54688cb6): web typecheck, oxlint and biome are clean, and the web unit tests pass (4733). feat/blocks-v8-hosted (8c8bb29cf) is a normal merge with the same tree.

  • Must-decide dialog, yours preselected (2e9e5e3b9, PO 2026-10-18; same change as fix(web): concurrent section form saves keep every edit and never type into someone else's text #8027's 3a72b35e2 + 6cf60af63): apps/web and packages/e2e typecheck (tsc, single-threaded), oxlint and biome clean; sections-editor + i18n unit tests 1187 pass. e2e updated (stale-form as on fix(web): concurrent section form saves keep every edit and never type into someone else's text #8027; deco-serve same-field case: Escape and click outside don't close it, the default saves yours; the hosted case saves the default), run on fix(web): concurrent section form saves keep every edit and never type into someone else's text #8027's production build only: stale-form 12/12 there.

  • QA fixes (2026-10-19, 8cdb102af, f27634baf, 1f2d72fdf, ee7cf18e4; the same changes as fix(web): concurrent section form saves keep every edit and never type into someone else's text #8027's 8b46c7acd, e81a12d0a, faa50196f, 7faee67b6, with the Fast Preview head check sending the v7 main-schema header and taking a 409 as moved, and the content protocol's read polled as is): apps/web and packages/e2e typecheck (tsc, single-threaded), oxlint and biome clean; sections-editor + preview + i18n unit tests 1456 pass (poll lifecycle, in-place refresh, pageswap settle, one load at a time). e2e run on fix(web): concurrent section form saves keep every edit and never type into someone else's text #8027's production build only: site-editor-stale-form 13/13 with the new no-click case; CI E2E passes there.

  • Two cards (d6675e1c7, 43b28fd08, PO 2026-10-19; the same change as fix(web): concurrent section form saves keep every edit and never type into someone else's text #8027's be52dec93 + eca6e181d, plus names and avatars on hosted v8): apps/web and packages/e2e typecheck (tsc, single-threaded), oxlint, biome and knip clean; sections-editor + i18n unit tests 1205 pass (new: who and when on the cards, the titles with a name, "You, in another tab or window", time only). e2e on a production web build (clean database per run): site-editor-stale-form + content-protocol-deco-serve 24/24, content-protocol-github 22/22 (the hosted case: "You changed the title in another tab or window", their card "You, in another tab or window" saved now, Keep yours stores it).

  • One field at a time (e533e43eb, PO 2026-10-19 "good"; the same change as fix(web): concurrent section form saves keep every edit and never type into someone else's text #8027's 7929376db, plus names on every step and in the summary on hosted v8): apps/web and packages/e2e typecheck (tsc, single-threaded), oxlint, biome and knip clean; sections-editor + i18n unit tests 1216 pass. e2e on a production web build (clean database per run): site-editor-stale-form + content-protocol-deco-serve 25/25 (new: three steps with Back, ← → and a mix stored as picked; "Use theirs for all" jumps to an unsaved summary), content-protocol-github 21/22 with 4 workers, the one failure the conformance suite's request-size case (HTTP 500 instead of 413 on an EPIPE under load, not the dialog), passing when re-run alone.

  • Next and OK (6f9ab4099, PO 2026-10-19; the same change as fix(web): concurrent section form saves keep every edit and never type into someone else's text #8027's 96c4db3cd, with the hosted author tests reaching the last step by picking theirs on each step): apps/web and packages/e2e typecheck (tsc, single-threaded), oxlint, biome and knip clean; sections-editor + i18n unit tests 1216 pass. e2e on a production web build (clean database per run): site-editor-stale-form + content-protocol-deco-serve 24/24 (OK in every case; the "Use theirs for all" case removed), content-protocol-github 22/22 (the hosted case clicks OK).

🤖 Generated with Claude Code

https://claude.ai/code/session_016ZsmzpZ2zahRBoATBb2tBu

@github-actions github-actions Bot added the claude PR authored by a coding agent label Oct 13, 2026
This was referenced Oct 13, 2026
@tlgimenes
tlgimenes marked this pull request as draft October 13, 2026 17:51
tlgimenes added a commit that referenced this pull request Oct 16, 2026
…nge, and when

Under the dialog's title: "Changed by Ana Souza · 3 minutes ago" with the
member's avatar and the exact time on hover; "You, in another tab or window
· …" for the viewer's own change; "Changed … ago" when only the time is
known. No line while it isn't known (never "unknown"). en and pt-BR.

A Fast Preview session asks Studio's history (GET …/changed-by) once per
version of theirs the dialog shows, never per poll: "Their version changed
again" reads who and when again. A sandbox session shows nothing. The
conflict remembers the block its save writes (a saved block, else the page).
formatRelativeTime comes from the Blocks v8 line (#7888).

e2e (written, not run here): stale-form asserts "You, in another tab or
window" for the same user's other save and "Changed by Dev Person" after a
developer's push while the dialog is open. The GitHub stub gains the
GraphQL commit history (as on #7888) with a path filter, commit dates and
authors, and an admin push; the API's GraphQL URL points at the stub.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016ZsmzpZ2zahRBoATBb2tBu
@tlgimenes
tlgimenes force-pushed the fold/v8-web branch 2 times, most recently from 0ac6d12 to 695fca3 Compare October 18, 2026 01:34
tlgimenes added a commit that referenced this pull request Oct 18, 2026
…nge, and when

Under the dialog's title: "Changed by Ana Souza · 3 minutes ago" with the
member's avatar and the exact time on hover; "You, in another tab or window
· …" for the viewer's own change; "Changed … ago" when only the time is
known. No line while it isn't known (never "unknown"). en and pt-BR.

A Fast Preview session asks Studio's history (GET …/changed-by) once per
version of theirs the dialog shows, never per poll: "Their version changed
again" reads who and when again. A sandbox session shows nothing. The
conflict remembers the block its save writes (a saved block, else the page).
formatRelativeTime comes from the Blocks v8 line (#7888).

e2e (written, not run here): stale-form asserts "You, in another tab or
window" for the same user's other save and "Changed by Dev Person" after a
developer's push while the dialog is open. The GitHub stub gains the
GraphQL commit history (as on #7888) with a path filter, commit dates and
authors, and an admin push; the API's GraphQL URL points at the stub.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016ZsmzpZ2zahRBoATBb2tBu
tlgimenes added a commit that referenced this pull request Oct 19, 2026
…e into someone else's text (#8027)

* fix(web): a skipped preview transition no longer logs an uncaught AbortError

Quick successive saves skip the running view transition; its ready and
updateCallbackDone promises then reject with "Transition was skipped" and
only finished was handled. The swap now settles all three.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016ZsmzpZ2zahRBoATBb2tBu

* fix(web): a section form saves one change at a time, so a refused save can't drop the next edit

Under load the form's autosave could send a second save while a first one
was still on its way. When the first was refused as stale, the second was
built on a copy that never landed: mutate() reported only its outcome, its
starting point was put back to the unsaved first edit, and the replay on
the stored block then counted the user's own edit as a conflict and kept
the stored value. The user's edit was lost and the toast named the wrong
field (seen on a v7 site with two people on one block).

- A section form now has one save on the wire at a time; the next is built
  once that one lands or is refused (mutateAsync, so every outcome is
  heard). A retry after a refusal reads the form's value when it runs.
- The conflict toast names fields by their label in the form ("Headline",
  not "title"), says "The latest version was kept." when nothing else of
  the form's was left to save, and every outcome of one change shares one
  toast.
- With main's #8000, a refused save is retried with backoff (up to 3
  times) before the form reloads; while a retry waits out its backoff the
  form's next saves wait behind it, as behind a save on the wire, and the
  retry carries the form's latest value.

Tests: e2e "a form that saves again while its refused save is on the wire
keeps both edits" (fails before: the headline goes back to the stored one
with a "Changed while you were editing: headline" toast); the same-field
e2e now expects the label and the shorter copy; unit tests for the labels.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016ZsmzpZ2zahRBoATBb2tBu

* fix(web): a merge never swaps a field under the user's cursor

Under load the form's autosave fires while the user is still typing. When
the save comes back merged and the merge kept another editor's value of
the field being typed in, the form showed that value at once, so the next
keystrokes landed after it ("Picks A again" + "holk" ...) and the mix was
saved as the user's edit, over the other editor's value. The reload after
the last retry re-seeded the form under the cursor the same way.

While focus is in the open form, those now wait: the form keeps showing
what the user types (its saves keep merging onto the stored section, so
the field keeps the stored value) and re-reads the stored section once
the user leaves the form and its own saves have settled. Merges that kept
every edit of the form still show at once.

Tests: e2e "typing on after a save kept the other editor's value does not
add the keystrokes to that value" (fails before: the field reads
"Published headline more"); the same-field e2e checks the stored value
after the user leaves the field; unit tests for mergedFormDisplay.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016ZsmzpZ2zahRBoATBb2tBu

* fix(web): what a user types after "The latest version was kept" is saved

When a save kept another editor's value of the field the user is typing in,
the form keeps showing their text until they leave it (05d4ae5), but its
baseline stayed the refused copy. Their next keystrokes were merged against
that copy again, lost to the stored value with a second toast, and the field
went back to the stored value when they left it: the edit was gone.

The form's baseline is now the merge it saved, and FormBase.displayed holds
what the form shows instead. A field the user changes after the notice is
saved over the stored value they were told about; a field they leave alone
keeps the stored value; a change from elsewhere after that is still caught
by #7909's check. Nothing is ever a mix of both texts.

Tests: e2e "typing on after a save kept the other editor's value saves what
the user typed, never mixed with that value" (fails before: the stored
headline stays "Published headline"); unit tests for formValueOnBase and
displayedOverBase. The spec's toast and poll waits allow for main's backoff
retry (#8000) under load, and toasts are counted as they appear.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016ZsmzpZ2zahRBoATBb2tBu

* fix(web): typing the same text again after "The latest version was kept" saves it

After a save kept another editor's value of the field the user is in, the
field still shows the user's text (until they leave the form). A user who
insists, selecting it and typing the same text again, ended with the value
the form already showed, so nothing counted as changed: the save kept the
stored value and the field flipped to it when they left.

Every value the user changes after the merge is now marked in
FormBase.displayed, so it is theirs even when it ends as it was shown.
Values they don't touch still keep the stored value.

Tests: e2e "typing the same text again after the latest version was kept
saves it" (fails before: the stored headline stays "Published headline");
unit tests for markEditedSinceDisplayed.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016ZsmzpZ2zahRBoATBb2tBu

* test(e2e): stale-form toasts are counted as they appear

"a form that saves again while its refused save is on the wire keeps both
edits" counted the toasts on screen after a poll of up to 30 s; on a busy
machine the toast had already expired (count 0). Toasts are now counted by
text as they appear, as in the typing-on test.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016ZsmzpZ2zahRBoATBb2tBu

* feat(web): a same-field edit conflict asks the user whose version to keep

When the user and someone else changed the same values of a section, the
form no longer keeps the stored value with a toast and the "on-leave"
heuristics. Nothing of the form's is written: its saves wait, and one dialog
("Someone else changed this while you were editing") lists each value by
its form label, "Your version" next to "Their version" (a word diff for
text, a thumbnail for images, a summary for lists and objects), with "Keep
mine" / "Use theirs" per field and "Keep all mine" / "Use all theirs".
Apply saves the choice against the stored version the dialog showed (the
save's `expect`); a newer one refuses it and the same choice is asked again
with that version. "Decide later" keeps their version stored and the
user's edits in the form, unsaved, with a "Choose versions" notice. Values
only one side changed still merge silently, now item by item within lists.

Removed: the "Changed while you were editing" toasts, mergedFormDisplay
"on-leave", FormBase.displayed (typing on after the toast saving over
theirs). A save's page, page variant and section variant are fixed when it
is scheduled, so a choice made after the user moved on still writes there.

(Port of 731befa from the v8 stack, without the v8 parts.)

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016ZsmzpZ2zahRBoATBb2tBu

* test(e2e): same-field conflicts go through the choose-versions dialog

site-editor-stale-form: keep mine, decide later then use theirs, mixed
per-field choices, different fields merge with no dialog, a third change
while the dialog is open asks again with the newer version. The hero
fixture gains a Subtitle field.

(Port of c63ee03 from the v8 stack, without the deco-serve case.)

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016ZsmzpZ2zahRBoATBb2tBu

* test(e2e): find the form behind the conflict dialog with includeHidden

The Keep mine case checked the headline after typing into the open dialog
with the form's role locator. The dialog is modal, so everything outside it
is aria-hidden and the locator found nothing ("element(s) not found", the
form showing "Draft headline" behind the dialog in the screenshot). The
check now includes hidden elements.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016ZsmzpZ2zahRBoATBb2tBu

* feat(api): changed-by tells the site editor who made the other change, and when

GET /api/:org/decofile/:project/:branch/changed-by?block=<key> (1 to 5 keys,
signed-in members only) answers { changedBy: { [key]: { name?, email?,
avatarUrl?, at, you? } } } for the "someone else changed this" dialog. The
editor asks once per version the dialog shows, never per poll.

Nothing new is stored: the block file's latest commit on the draft branch
(insights listCommits with a new `path` filter, limit 1: one GitHub call per
block) gives the Co-authored-by trailer the commit coalescer appends, else
the commit author when it is a person, and the commit time. The identity is
mapped to the org member (name, avatar) by email, else the git name; `you`
when it is the viewer. Unknown parts are left out.

Insights commits now carry the message body (where the trailers are), and
insightsClientForProjectRepo opens a project's history client, as on the
Blocks v8 line (#7887).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016ZsmzpZ2zahRBoATBb2tBu

* feat(web): the same-field conflict dialog says who made the other change, and when

Under the dialog's title: "Changed by Ana Souza · 3 minutes ago" with the
member's avatar and the exact time on hover; "You, in another tab or window
· …" for the viewer's own change; "Changed … ago" when only the time is
known. No line while it isn't known (never "unknown"). en and pt-BR.

A Fast Preview session asks Studio's history (GET …/changed-by) once per
version of theirs the dialog shows, never per poll: "Their version changed
again" reads who and when again. A sandbox session shows nothing. The
conflict remembers the block its save writes (a saved block, else the page).
formatRelativeTime comes from the Blocks v8 line (#7888).

e2e (written, not run here): stale-form asserts "You, in another tab or
window" for the same user's other save and "Changed by Dev Person" after a
developer's push while the dialog is open. The GitHub stub gains the
GraphQL commit history (as on #7888) with a path filter, commit dates and
authors, and an admin push; the API's GraphQL URL points at the stub.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016ZsmzpZ2zahRBoATBb2tBu

* Revert who/when in the same-field dialog on main

This reverts commits 9dcf8fb and 46fe475. PO (final): "only have
metadata and changed by on v8 hosted": a v7 (Fast Preview) dialog shows no
"changed by" line. The dialog itself stays. Gone with it: the changed-by
route, commit trailer/author parsing, insights' path filter and message
body, insightsClientForProjectRepo and formatRelativeTime copied for it, the
GitHub stub's history and push, and the GraphQL URL in the e2e config.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016ZsmzpZ2zahRBoATBb2tBu

* fix(web): the conflict dialog reads rich text with the DOM parser, never regex sanitizing

CodeQL flagged the tag stripping and entity decoding (incomplete multi-character
sanitization, double unescaping). Text now comes from DOMParser's textContent;
without a DOM, tags are dropped until none is left and each entity is decoded once.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016ZsmzpZ2zahRBoATBb2tBu

* feat(web): the same-field dialog must be answered, with yours preselected

PO 2026-10-18: "Keep yours" / "Use theirs" wording, and "If the user needs
to decide, we need to raise an alert dialog with no close option" (Decide
later left the form in a frozen state). Picked: must-decide, yours
preselected.

- FormConflictDialog is an AlertDialog with no close button; Escape and a
  click outside don't close it. Only "Save selected versions" does.
- Every conflicting field starts on "Keep yours" (defaultConflictChoices);
  a re-plan (their version changed again) keeps the choices that still
  hold and puts the rest back on yours. "Use theirs" switches every field.
- Removed: Decide later, the "not saved yet / Choose versions" notice,
  conflictDialogOpen, reviewFormConflict, everyConflictChosen and their
  strings. One save at a time and the expected-version guard are unchanged.
- pt-br: "Manter a sua" / "Usar a deles" / "Salvar versões escolhidas".
- Tests: unit (default yours, one click, mixed, switch all, no close
  affordance); e2e stale-form drops the decide-later case, adds Escape /
  click outside, default saves yours, Use theirs for every field.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016ZsmzpZ2zahRBoATBb2tBu

* fix(web): the conflict dialog takes focus when it opens

Radix's alert dialog focuses its Cancel button on open; this one has none,
so focus stayed in the form behind it and keys typed after the dialog
appeared still reached the field (the stale-form e2e caught "Draft
headlinexyz"). Focus the dialog itself: typing stops there, and a space
typed mid-word can't press a button.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016ZsmzpZ2zahRBoATBb2tBu

* fix(web): a skipped page-to-page preview transition no longer logs an uncaught AbortError

A site that opts into cross-document view transitions
(`@view-transition { navigation: auto }`, as the Storefront v7 store does)
gets one on every reload a Fast Preview save makes. When the next save
navigates the frame before that transition starts, Chrome skips it and
rejects the outgoing page's `pageswap` transition `ready` promise with
"AbortError: Transition was skipped". Nothing handled it, so the editor's
page logged an uncaught error (QA-8027, step 8).

The editor script, injected into every preview page on load, now settles
the promises of the outgoing page's transition from a `pageswap` listener
(registered once per page and kept after deactivate), with the same helper
the in-place swap already used.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016ZsmzpZ2zahRBoATBb2tBu

* fix(web): the open conflict dialog follows their version in place

While a same-field dialog was open nothing read the stored blocks again,
so "their version" stayed the copy the dialog opened with; a newer save
only showed after "Save selected versions" was refused (QA-8027, step 5).

While a dialog is open, the editor's own decofile read runs again every
3 s (15 s after two minutes open), one poll however many fields or waiting
saves, stopped when the dialog closes. A tick is skipped while a write is
on the wire, a read is running or just landed, or the tab is hidden. On
Fast Preview the read first asks the branch head conditionally
(`If-None-Match`, the same GET): an unchanged branch answers 304, with no
body and no new draft grant, so the preview pointer (and frame) stays put.
The newer copy goes through the existing render-time re-plan, now
`refreshWaitingChoice`: their version in place, "Their version changed
again while this was open.", picks kept where both versions are unchanged.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016ZsmzpZ2zahRBoATBb2tBu

* test(e2e): the open conflict dialog shows a newer version of theirs with no click

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016ZsmzpZ2zahRBoATBb2tBu

* fix(web): a Fast Preview frame loads one draft at a time

Every save gives the preview a new `?__draft=` pointer, and React set it on
the frame at once, even while the frame was still loading the last one.
That cancels the load (its render is wasted, so quick saves showed nothing
new until they stopped), and on a site with page-to-page view transitions
(`@view-transition { navigation: auto }`) the page being left rejects its
`pageswap` transition with "AbortError: Transition was skipped". Measured
on the kit: the store answered about 0.9 s after a save's navigation, the
next save's pointer came 0.5 s later, before the page committed (QA-8027,
step 8). The editor script settles that promise where it runs, but a v7
site only runs it for the origins its LiveControls trusts.

A Fast Preview pointer that arrives while the frame loads now waits for
the frame's load; then the latest goes in, the ones in between skipped.
A held navigation whose load never fires is released after 15 s. Other
frames (sandbox, Local) follow their src at once, as before.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016ZsmzpZ2zahRBoATBb2tBu

* fix(web): the merge toast says both changes were kept

"Your changes were applied on top of the latest version" read like an
override. When different fields were changed, both edits are kept, so it now
says so: "Someone else also edited this block. Both changes were kept."

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016ZsmzpZ2zahRBoATBb2tBu

* feat(web): the same-field dialog shows two people, two cards

The product owner picked "Option B: two people, two cards" ("i like the
friendliest option b") for the dialog that asks whose version to keep.

One field in conflict, the common case: "Someone else changed the title
while you were editing", "Pick the one to keep. The other is discarded."
Two whole-card choices, stacked: "You" (your avatar or initials, "Your
version · not saved yet") and "Someone else" ("Their version · already
saved"), each with its text and the changed words marked. Each card is a
radio (arrow keys move the choice). Yours is chosen; the one button names
what saving does: "Keep yours" or "Use theirs".

Two or more fields: a row per field with its label, a Yours / Theirs switch
and that side's value. "Use theirs for all", and a button that names the
outcome: "Keep yours", "Keep a mix" or "Use theirs".

Unchanged: it must be answered (no close button, Escape or click outside),
it follows their newer version in place while open, images, lists and
objects keep their previews. Strings the old layout used are removed;
pt-br says "o campo “Título”", which reads naturally whatever the label's
gender.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016ZsmzpZ2zahRBoATBb2tBu

* chore(web): applyLabel is not exported

Only the dialog uses it (knip).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016ZsmzpZ2zahRBoATBb2tBu

* feat(web): several conflicting fields are asked one at a time

The product owner approved "one field at a time" for a conflict on several
fields ("good"), replacing the Yours / Theirs switch per field.

Each field gets a step with the same two cards as the single-field dialog,
yours chosen: "Someone else also changed the title", "Pick the one to keep.
You can go back before saving." A dot per field (a button named by it; the
current one wider, the ones moved on from filled) and "1 of 3" above. Next
keeps the pick and moves on; Back, a dot or the ←/→ keys revisit a step
(not while typing in a text field; on a card, ↑/↓ change the pick). The
last step sums up the picks ("Title: yours · Button text: theirs") and its
button names the outcome: "Keep yours", "Keep a mix" or "Use theirs".
Nothing is saved before that click, and the second click of a double click
on Next doesn't count as one.

"Use theirs for all" stays on every step: it picks theirs everywhere and
goes to the last step, so saving is still one click on "Use theirs".

When their version changes again while the dialog is open, the steps show
the newer values, the picks that still apply are kept, and the dot of each
field whose value changed gets a ring until it is visited
(markTheirsChanged counts the changes per field).

One field is unchanged: no dots, no Back or Next. The switch layout's code
and strings are removed.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016ZsmzpZ2zahRBoATBb2tBu

* feat(web): the conflict dialog's buttons read Next and OK

The product owner asked for plain step buttons: "Remove the 'use theirs
for all' button", the primary as "next/next/done", then "instead of done,
ok".

With several fields, every step but the last shows Next and the last one
OK, which saves the picks as "Keep yours" / "Keep a mix" / "Use theirs"
did. The single-field dialog's button is OK as well. pt-br: "Próximo" and
"OK".

"Use theirs for all" is gone from every step, with its strings, unit test
and e2e case; so is the label that named the outcome and its strings.
Cards, dots, Back, the last step's summary, the arrow keys, the must-decide
dialog, the refresh ring, yours preselected and the double-click guard on
the last Next are unchanged.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016ZsmzpZ2zahRBoATBb2tBu

---------

Co-authored-by: Claude Opus 5.5 <[email protected]>
tlgimenes and others added 3 commits October 19, 2026 14:51
…okens

The site editor on the Blocks v8 content protocol (hosted drafts, deco
serve, sandboxes), hosted Publish and Releases, site tokens, and the v8
parts of the section-form conflict handling: the ifMatch guard on every
v8 section save, and on hosted v8 drafts the conflict dialog names who
made the other change and when ("Ana changed the title…", their avatar,
"saved 3 minutes ago"), read from the draft object's metadata.

Rebased on main after #8027 (concurrent saves and the conflict dialog for
v7) merged as fbb64f0. This branch carried the same dialog/save changes
as cherry-picks (F4-F15); main's version of that shared code is kept
as is, and only the v8 additions sit on top of it. The web side was
squashed (replaying each cherry-pick on top of its own squash was
impractical); it replaces these commits (e2e changes in the next commit):

- feat(web): Blocks v8 site editor, hosted Publish, Releases and site tokens (ee9dc4b)
- test(web): a six-level self-referencing menu renders and edits every level (A9) (d04ba3d)
- fix(web): v8 section saves refuse to overwrite a block someone else changed (5bcaf7f)
- fix(web): opening Settings with no CMS block no longer creates CMS.json (45c2f9c)
- fix(web): "." on a page opens that page, not the catch-all template's (d9faba6)
- fix(web): a skipped preview transition no longer logs an uncaught AbortError (8e30608)
- fix(web): a section form saves one change at a time, so a refused save can't drop the next edit (0462d9b)
- fix(web): a deep link to Releases waits for main's schema instead of bouncing to Settings (38fa751)
- fix(web): a merge never swaps a field under the user's cursor (8d785f4)
- fix(web): what a user types after "The latest version was kept" is saved (6ce2aa9)
- fix(web): typing the same text again after "The latest version was kept" saves it (b3a6d74)
- feat(web): a same-field edit conflict asks the user whose version to keep (6736660)
- feat(web): the same-field conflict dialog says who made the other change, and when (843b212)
- feat(web): a hosted v8 draft's who-changed-what comes from the draft, people from the org (c4af50c)
- feat(web): every save stamps the block's `__meta`; the dialog reads it first (4cd6626)
- Revert the web's who/when from git history, draft edits and block __meta (3c8bcd2)
- feat(web): the same-field dialog says who and when on hosted v8 drafts only (3cb4269)
- fix(web): the conflict dialog reads rich text with the DOM parser, never regex sanitizing (4400428)
- feat(web): the same-field dialog must be answered, with yours preselected (2e9e5e3)
- fix(web): a skipped page-to-page preview transition no longer logs an uncaught AbortError (8cdb102)
- fix(web): the open conflict dialog follows their version in place (f27634b)
- fix(web): a Fast Preview frame loads one draft at a time (ee7cf18)
- fix(web): the merge toast says both changes were kept (580f814)
- feat(web): the same-field dialog shows two people, two cards (d6675e1)
- chore(web): applyLabel is not exported (43b28fd)
- feat(web): several conflicting fields are asked one at a time (e533e43)
- feat(web): the conflict dialog's buttons read Next and OK (6f9ab40)

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016ZsmzpZ2zahRBoATBb2tBu
…lish and Releases

The e2e side of the previous commit: the content protocol over GitHub,
deco serve and its stub, hosted drafts, Publish, Releases and changes.*,
and the v8 cases of the stale-form and same-field dialog specs (who made
the other change on hosted v8). Squashed with the web side; it replaces
these commits plus the e2e parts of the web commits listed there:

- test(e2e): Blocks v8 content protocol, drafts, Publish, Releases and changes.* (463f8cc)
- test(e2e): the deco serve spec follows the UI and its stub, on a production build (9ae3629)
- test(e2e): the CMS settings guard test holds the editor's polls (f54b9bc)
- test(e2e): stale-form toasts are counted as they appear (e725bdb)
- test(e2e): same-field conflicts go through the choose-versions dialog (6ec2500)
- test(e2e): find the form behind the conflict dialog with includeHidden (024b6f3)
- test(e2e): the hosted session read answers changedBy next to the draft pointer (b5d7979)
- test(e2e): the GitHub conformance run opens one socket per request (695fca3)
- test(e2e): the open conflict dialog shows a newer version of theirs with no click (1f2d72f)

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016ZsmzpZ2zahRBoATBb2tBu
api, web and e2e move from 8.2.1 to 8.4.0 (published, latest). Studio
imports only /protocol, /protocol/server, /protocol/storage/fs,
/protocol/keys, /protocol/conformance and /secrets; none of them changed
between 8.2.1 and 8.4.0 (8.3.0/8.4.0 add /image, /preview and /vite, the
NODE_ENV dev default, schema --check and multivariate first-match, and an
optional vite peer), so no code changes. bun.lock gains only the
@decocms/blocks entries. The legacy-secret-guard test no longer points
at a patch that was dropped long ago.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016ZsmzpZ2zahRBoATBb2tBu
@tlgimenes

Copy link
Copy Markdown
Contributor Author

Superseded by #8062

@tlgimenes

Copy link
Copy Markdown
Contributor Author

Superseded by #8062 (API + web in one PR, rebased on main with #8027).

@tlgimenes tlgimenes closed this Oct 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

claude PR authored by a coding agent

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant