mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-12-05 11:15:01 +03:00
Add `ui::SnapshotId` and the `ui::snap_id!` macro. Under `harness`, the macro formats its arguments into the ID. In other builds, `SnapshotId` has zero size. The macro type-checks its arguments in a branch that never runs, so no ID text gets into the binary. `SharedString` gets `From<SnapshotId>`, so `snapshot` keeps its signature and literal IDs need no change. The toolbar icon button, the toolbar menu row, the context menu row, the block menu row and the image lightbox control take a `SnapshotId`. A caller that gives a plain string does not compile. Remote cursors and selections, presence badges, the doc panel, the record sheet and the block toolbars now build their dynamic IDs with `ui::snap_id!` instead of `format!`. `check-snapshot-prefixes.mjs` checks the prefixes of these IDs and accepts more than one Wasm file.