[Beta]: Typing in a preview view of the Authored Changes example throws "A preview view does not take this write." on every key
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
- Ambito
- frontend, testing-qa
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
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.
- Open https://beta.platejs.org/examples/plite/authored-changes with the browser console open.
- In
Accepted content, click insideA shared draft.. - Type
x. - Press Backspace, then Delete, then Enter.
- In
Proposed content, clickPreview proposed, click insideA shared draft.and typex. - For comparison, tick
Read-only proposed view, click insideA shared draft.on the right and typex.
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 proposedview takesxwith no change and no error. The agent's first run also found that the read-onlyMarkup observerviews, shown whenShared document viewsis8, 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
nextcommit/Beta package version:NOT_ENOUGH_INFO. The page does not show its build. The first run used Beta built fromnext87b29efbfa, 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 acceptedon the left and inPreview proposedon 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' }}>withoutreadOnly(apps/www/src/app/(app)/examples/plite/_examples/authored-changes.tsx:603-606). The right view switches to a preview throughreview.api.setView(:367-384), and its outerEditorRootis read-only only while the checkbox is ticked (:588-591). TheMarkup observerviews are mounted withreadOnly(: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.inAccepted content, and the readout showsPreview acceptedfor that view. At 0:04.5xthrows 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 toPreview proposed, andxthere makes the count 5. From 0:18.8Read-only proposed viewis ticked andxis 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
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di udecode/plate
-
bug target:beta triaged
Difficoltà 2/5 1-3 ore Idoneità per principianti 84/100
I maintainer di solito rispondono entro 1 giorno
-
bug plugin:link target:beta triaged
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
I maintainer di solito rispondono entro 1 giorno
-
bug mobile target:beta triaged
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
I maintainer di solito rispondono entro 1 giorno
-
bug target:beta triaged
Difficoltà 2/5 1-3 ore Idoneità per principianti 84/100
I maintainer di solito rispondono entro 1 giorno
-
bug target:beta triaged
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di udecode/plate
Issue simili
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 62/100
Merit-Systems/x402scan#1312 ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
I maintainer di solito rispondono entro 1 giorno
-
Native Web
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 80/100
digitalfabrik/integreat-app#4517 ·
I maintainer di solito rispondono entro 2 giorni
-
TLS guide repeats certs/ in the certificate directoryForse già presa @maheshrijal l’ha presa oggi. Aperta
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 92/100
prometheus/docs#3156 ·
I maintainer di solito rispondono entro 2 giorni
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 83/100
medusajs/dtc-starter#90 ·
I maintainer di solito rispondono entro 1 giorno