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

Đang mở Phù hợp với người mới
#884 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 1 ngày

Chưa có ai nhận issue này.

Đánh giá

Độ khó
2/5
Thời gian dự kiến
1-3 giờ
Mức phù hợp với người mới
75/100
Loại issue
Lỗi
Độ rõ ràng
Đặc tả rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
ios, javascript
Lĩnh vực
frontend, mobile

Hướng nghiên cứu

Bắt đầu với src/components/native-inserter/index.jsx và kiểm tra insertPattern, sau đó so sánh hành vi của nó với tab Reusable blocks của trình chèn gốc và trình chèn của WP Admin. Thực hiện lại các bước trên iOS với một pattern đã đồng bộ và xác nhận khối được chèn vẫn liên kết với nguồn của nó; vấn đề được giải quyết khi các chỉnh sửa sau đó đối với pattern cập nhật khối đã chèn.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

[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
Ngôn ngữ chính
JavaScript
Star
29
Fork
7
Merge trung bình
2 ngày 12 giờ
Pull request đã merge (30 ngày)
77

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của wordpress-mobile/GutenbergKit

Tất cả issue của wordpress-mobile/GutenbergKit

Issue tương tự

Thêm issue về JavaScript

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.