pcbjam/features/yjs-bridge
Repository files (latest commit first)
Filename Latest commit message Latest commit date
Gergő Törcsvári 9f8628cfb2
fix(eeschema): collab converges on big drags — emit a post-settle snapshot diff
The batched-emit fix still lost segments on a large connected drag (peer
dropped the P3-C1 wire). Deeper cause: the SCHEMATIC_LISTENER fires in
pushSchEdit BEFORE RecalculateConnections (sch_commit.cpp ~402 vs ~430), so
every emit was pre-cleanup RAW geometry; the cleanup that follows (merge
collinear wires, drop/split junctions) was never broadcast. The peer rebuilt
the raw edit and ran its own cleanup over a different dirty scope, so the two
peers cleaned up differently and the peer lost segments.

Replace the listener-list emit with a post-settle full-model snapshot DIFF
(snapshotByUuid), flushed via CallAfter once Push (cleanup included) returns —
capturing tab A's final, already-clean geometry. The peer applies that and
re-cleaning already-clean geometry is idempotent, so they converge. The native
listener is now just a change trigger. g_baseline holds the last-broadcast
state; doApply and kicadCollabSnapshot rebaseline so applied/seed items aren't
re-broadcast (echo). Mirrors pl_editor's snapshot-differ; no kicad-fork change.

Verified two-tab, rigorously (real edit: tabA state changed AND tabA===tabB
byte-for-byte): a wire reroute plus U1A/U1B/C2 symbol drags all converge
exactly. eeschema-collab + eeschema-ui suites green.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-05 13:59:21 +02:00
..
0001-general-bridge-design.md docs(yjs-bridge): add collaborative Yjs bridge design 2026-06-05 13:56:41 +02:00
0002-pl-editor-bridge.md docs(yjs-bridge): record commit-2 as built (bridge in wasm layer) 2026-06-05 13:56:41 +02:00
0003-eeschema-bridge.md docs(yjs-bridge): add collaborative Yjs bridge design 2026-06-05 13:56:41 +02:00
0004-pcbnew-bridge.md docs(yjs-bridge): add collaborative Yjs bridge design 2026-06-05 13:56:41 +02:00
0005-eeschema-apply-bugfix-prompt.md docs(yjs-bridge): next-session init prompt for eeschema apply bugfixes 2026-06-05 13:56:42 +02:00
0006-eeschema-apply-findings.md feat(eeschema): collab SCH_SHAPE emit + defensive text; defer shape/symbol add (asyncify trap); un-skip apply e2e 2026-06-05 13:56:42 +02:00
0007-eeschema-essential-ops-findings.md fix(eeschema): collab converges on big drags — emit a post-settle snapshot diff 2026-06-05 13:59:21 +02:00
0007-eeschema-essential-ops-prompt.md fix(eeschema): wasm dialog positioning (web .window CSS) + collab SCH_SHAPE add via coroutine fiber stack 2026-06-05 13:56:43 +02:00