Inserting a synced pattern from the iOS block inserter adds an unsynced copy

Aperta Adatta ai principianti
#884 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à
2/5
Tempo stimato
1-3 ore
Idoneità per principianti
75/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
ios, javascript
Ambito
frontend, mobile

Direzione di ricerca

Inizia da src/components/native-inserter/index.jsx ed esamina insertPattern, quindi confrontane il comportamento con la scheda Reusable blocks dell’inseritore nativo e con l’inseritore di WP Admin. Riproduci i passaggi su iOS con un pattern sincronizzato e verifica che il blocco inserito resti collegato alla sua origine; il problema è risolto quando le modifiche successive al pattern aggiornano il blocco inserito.

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

Descrizione

[Type] Bug
Description

Synced patterns stay linked to their source, so editing the pattern updates every post that uses it. When a synced pattern is inserted from the Patterns section of the native block inserter on iOS, the editor adds a plain copy of its blocks instead. Later changes to the pattern don't reach the post, and nothing tells the user the link was lost.

The Patterns sheet lists the site's own patterns under "Uncategorized", and doesn't show which ones are synced.

Expected: inserting a synced pattern adds a synced pattern block, as WP Admin's inserter does. The native inserter's "Reusable blocks" tab already does this.

Step-by-step reproduction instructions
  1. Create a synced pattern on the site.
  2. In the iOS editor, open the block inserter, then Patterns, then "Uncategorized".
  3. Tap the synced pattern.
  4. The inserted block is a regular block (e.g. Paragraph), not a Pattern block.
Screenshots, screen recording, code snippet
Additional AI-generated details
  • The native inserter's insertPattern (src/components/native-inserter/index.jsx) always inserts parse( pattern.content ).
  • Suggested fix: for a user pattern (pattern.type === 'user') that isn't unsynced (syncStatus !== 'unsynced'), insert createBlock( 'core/block', { ref: pattern.id } ) instead, as core's inserter does. Optionally, pass the sync status to the native sheet so it can mark synced patterns.
  • Android's native inserter has no Patterns section, so only iOS is affected.
  • Related, unverified: the "Reusable blocks" tab (core's reusable inserter category) also lists unsynced patterns, and inserts them as references. Check what WP Admin's inserter shows before changing that.
Environment info

GutenbergKit trunk (5f799a1f), iOS demo app with the native inserter enabled, iPhone 18 Pro simulator (iOS 27.1), local WordPress site. WordPress-iOS enables the native inserter by default.

Please confirm that you have searched existing issues in the repo.
  • Yes
Lingua principale
JavaScript
Stelle
29
Fork
7
Merge medio
2g 11h
PR unite (30g)
81

Preparare l'ambiente

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 wordpress-mobile/GutenbergKit

Tutte le issue di wordpress-mobile/GutenbergKit

Issue simili

Altre issue su JavaScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.