Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

Real-time co-editing: presence and selection events for admins over Mercure

Đang mở
#559 4 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

@silverbackdan đang làm issue này rồi.

Từ ngày 21/10/2026.

  • #560 của @silverbackdan — đang mở

Đánh giá

Độ khó
5/5
Thời gian dự kiến
Hơn một tuần
Mức phù hợp với người mới
20/100
Loại issue
Tính năng
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Đình trệ
Công nghệ
php, symfony

Hướng nghiên cứu

Start by reading MercureResourcePublisher and PublishableAwareHub, then trace how the subscriber cookie and private draft updates are created. Check whether draft updates arrive during the module's save behavior, which the payload does not specify. Define and implement the admin presence events, expiry or heartbeat, and rate limits; confirm subscribers are limited to admins and presence works across PHP pods. The linked pull request #560 is already open.

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

Mô tả

enhancement

Editors working on the same site at once should see each other: who is editing, which component they've selected, and their changes as they make them. Mercure is already CWA's real-time hub, and the bundle already publishes every write, with a private ?draft=1 update for admins (MercureResourcePublisher, PublishableAwareHub). So co-editing needs a few new events over the same hub, not a new transport.

Companion issues: the module side and the template's TipTap example (linked below once filed).

What the bundle would add

  1. Presence events for admins. An endpoint an admin's browser calls to say what they're doing, published as a private update that only admins can receive:

    • joined or left a page (route or page IRI);
    • selected or deselected a component (component IRI, plus the position IRI so the same component in two places is told apart);
    • started or stopped editing a component.

    The payload carries the user's id and display name (username, or a name field if the app has one), never the email address.

  2. A topic that only admins can subscribe to, using the subscriber cookie the bundle already sets at sign-in and refresh (the JWT mercure.subscribe claim). Visitors must never receive presence events.

  3. Leaving without saying so. A heartbeat, or an expiry on each presence event, so a closed tab or a lost connection drops that editor after a short time.

  4. Draft changes as they're saved. Admin edits already save as drafts, and each save already publishes the private draft update. Check that this is enough for another admin's screen to follow along, including while a component is being typed into. If the module saves on a debounce, say what the delay is, so the module can show changes at a sensible rate.

Questions

  • Should presence be stored at all (for a "who's here" list on first load), or only published? Publishing only is simpler; a late joiner would see others after their next event or heartbeat.
  • Rate limits on the presence endpoint, so a stuck client can't flood the hub.
  • Scaled mode: Mercure is one hub (standalone in scaled mode), so presence should work across php pods without anything shared beyond the hub. Confirm.

Out of scope

Two people typing in the same field at the same moment (character-level merging, such as Yjs). The first version can show who's editing and lock or warn on the component someone else is editing.

Ngôn ngữ chính
PHP
Star
32
Fork
8
Merge trung bình
1 giờ 1 phút
Pull request đã merge (30 ngày)
193

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

Dự án này không cung cấp dev container, Dockerfile hay hướng dẫn đóng góp, nên bạn cần tự thiết lập môi trường: hãy bắt đầu từ README và xem hướng dẫn đóng góp lần đầu của chúng tôi để biết các bước chung.

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 components-web-app/api-components-bundle

Tất cả issue của components-web-app/api-components-bundle

Issue tương tự

Thêm issue về PHP

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.