Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

[Beta]: Typing in a preview view of the Authored Changes example throws "A preview view does not take this write." on every key

Aperta
#5,274 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
3/5
Tempo stimato
1-2 giorni
Idoneità per principianti
66/100
Tipo di issue
Bug
Chiarezza
Abbastanza chiara
Stato di attività
Attiva
Stack tecnologico
react, typescript

Direzione di ricerca

Start with apps/www/src/app/(app)/examples/plite/_examples/authored-changes.tsx and reproduce the issue in the Authored Changes example by typing in each preview view. Then read packages/plitejs/src/authored/authored.ts around the reported throw at lines 1995–1996. Done means native typing in preview views produces no uncaught errors while plain edits sent directly to a preview still follow the documented behavior.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

bug target:beta

Testing lane

  • Repository: udecode/plate
  • Branch: next
  • Release channel: Beta
  • Exact commit/package version: NOT_ENOUGH_INFO

Summary

On /examples/plite/authored-changes, a click in a view that shows Preview accepted or Preview proposed, then any key, throws an uncaught Error: A preview view does not take this write., one per key. The text does not change. The left view, Accepted content, opens in Preview accepted, so this happens on a fresh page. The guide says a preview throws on a plain edit, so the throw itself is documented. What is wrong is that the example lets native typing reach that write, so every key ends in an uncaught error. With Read-only proposed view ticked, the same preview view takes the key with no error.

Reproduction

The page shows two views of one shared document: Accepted content on the left and Proposed content on the right. Each has the buttons Suggest, Edit, Preview accepted, Preview proposed, Undo and Redo. The left view starts in Preview accepted and the right one in Suggest. The default sample is Paragraphs.

Repro 1: /examples/plite/authored-changes, Chromium

An agent ran this with Playwright on 2026-10-24.

  1. Open https://beta.platejs.org/examples/plite/authored-changes with the browser console open.
  2. In Accepted content, click inside A shared draft..
  3. Type x.
  4. Press Backspace, then Delete, then Enter.
  5. In Proposed content, click Preview proposed, click inside A shared draft. and type x.
  6. For comparison, tick Read-only proposed view, click inside A shared draft. on the right and type x.

In headless Chromium, each key in steps 3, 4 and 5 throws Uncaught Error: A preview view does not take this write. once, five errors in all. Neither view changes, and no card appears under Pending proposals. Step 6 changes nothing and throws nothing.

In Playwright WebKit, x and Backspace in the left view throw the same error, and x in step 5 throws it too. Delete and Enter in the left view throw nothing and change nothing. Step 6 throws nothing.

Expected

  • The Authored Changes guide, section "Configure a view", lists { preview: 'proposed' } and { preview: 'accepted' } with the Writes entry "Plain edits throw; see below", and says: "A preview throws on a plain edit". A plain edit sent to a preview is meant to throw. This issue does not ask to change that.
  • Keys typed into the example's preview views should not end in an uncaught error. The page already behaves this way when the same view is read-only. In step 6 the Preview proposed view takes x with no change and no error. The agent's first run also found that the read-only Markup observer views, shown when Shared document views is 8, block typing with no error. The agent's notes from the first run expect that a preview view takes no native input and throws nothing, for example by blocking it as a read-only view does, or by showing a notice.

Actual

Each key typed into a preview view throws Uncaught Error: A preview view does not take this write. once, and the text stays the same. Nothing on the page shows the error.

Environment

  • Exact next commit/Beta package version: NOT_ENOUGH_INFO. The page does not show its build. The first run used Beta built from next 87b29efbfa, as the agent's notes say.
  • On 2026-10-24 an agent replayed Repro 1 on the live Beta in headless Chromium 149.0.7827.55 and in Playwright WebKit 26.5 (not Safari), driven by Playwright 1.61.0 on macOS with real mouse and key input. Both still throw.
  • An agent first found this on 2026-10-21 (PT), at natamox's request, in the Claude desktop app's built-in Chromium 152 on a desktop. It checked a letter, Backspace, Delete and Enter one key at a time, in Preview accepted on the left and in Preview proposed on the right, and each key threw one error.
  • On 2026-10-22 (PT) natamox retested the page by hand on top of these finds and reported no further problems.
  • natamox's earlier Safari pass on 2026-10-20 (PT) found no defects. Its recorded steps include no typing in a preview view. Nobody has tried Firefox or a phone.

Caveat

From a reading of the code on next (a76732c3be), not checked with a debugger:

  • The error comes from packages/plitejs/src/authored/authored.ts:1995-1996, which throws when the update's view is a preview.
  • The example mounts the left view as <EditorRoot authored={{ preview: 'accepted' }}> without readOnly (apps/www/src/app/(app)/examples/plite/_examples/authored-changes.tsx:603-606). The right view switches to a preview through review.api.setView (:367-384), and its outer EditorRoot is read-only only while the checkbox is ticked (:588-591). The Markup observer views are mounted with readOnly (:656-660).
  • An inference from the above is that native input on a preview view that is not read-only reaches the write, and the documented throw surfaces as an uncaught error. Whether the fix belongs in the example, by making its preview views read-only, or in Plite, by refusing native input on a preview view before the write, is open.

Evidence

  • Repro 1: headless Chromium recording, 32 seconds, with an English step panel beside the page. A readout box at the bottom left, drawn by the test script, shows the count of uncaught page errors, each view's mode, the caret, the pending cards and the keys just pressed. A red box above it, also drawn by the script, shows the last uncaught error. At 0:02 the click lands in A shared draft. in Accepted content, and the readout shows Preview accepted for that view. At 0:04.5 x throws the first error. Backspace at 0:07.1, Delete at 0:09.7 and Enter at 0:12.2 each add one, and the count reaches 4. From 0:14.8 the right view switches to Preview proposed, and x there makes the count 5. From 0:18.8 Read-only proposed view is ticked and x is typed on the right, and the count stays 5. The text of both views never changes. The result shows from 0:22.8 to the end.
Repro 1 — Chromium, /examples/plite/authored-changes

https://github.com/user-attachments/assets/7d4ed8cb-2b1e-4cba-88e4-1a5237e19647

Related

  • #5275: In Preview proposed, a click past the end of a line with a pending insertion throws and the caret stays.
  • #5276: After deleting the only media block in Suggest, typing throws and inserts nothing.
  • #5277: In Suggest, typing or deleting in a code block throws a schema error and records nothing.
  • #5282: Pending deletions of a mention or a media block, and pending splits and joins, show no mark in the text.
Lingua principale
TypeScript
Stelle
16.6k
Fork
993
Merge medio
20h 1m
PR unite (30g)
60

Preparare l'ambiente

Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di udecode/plate

Tutte le issue di udecode/plate

Issue simili

Altre issue su TypeScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.