Files
AFFiNE/packages/frontend/scripts
DarkSky 24ed5ec97f fix(editor): keep dynamic snapshot IDs out of production Wasm
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.
2026-12-03 03:32:46 +09:00
..