Format block snapshot IDs only when the harness records them.
Check live link destinations before popup actions and allow IME offset shifts for read-only actions.
The mobile shell now removes a document when the document leaves the root document in the workspace session. Another session can trash and delete a document permanently. The shell then drops it from the list, the CRDT cache, the history, and the open page. Drafts that exist only in the shell stay. Documents with the same ID in other workspaces stay.
Workspace documents and CRDT caches change only through accessors. Each change gets a revision stamp that is unique in the process. These stamps key the caches for search hits, drawer sections, Explorer rows, breadcrumb snapshots, and the editor directory. A frame without changes rebuilds none of them.
A document lookup by ID now takes constant time. Explorer lists and folder lists mount only the rows inside the viewport plus a small overscan. The lists use ui_kit::VirtualList, and spacers keep the content height. The accessibility tree reads the same rows and the same window.
The bridge syncs the shell to the session by CRDT revision and by changed document IDs. When nothing changed, it reads no cached bytes. The sync timer repaints the shell only when the projection changed what the shell shows. The timer also checks that the bridge that ran the tick is still bound.
The editor directory keys its snapshot by workspace ID, docs revision, bulk revision, and locale. It refreshes in place only when all keys except the docs revision match. A workspace switch, a bulk change, or a locale change rebuilds it. The directory never lists or previews a trashed document.
The page editor reads the trash state directly. It encodes a state vector only when the document revision advances. The Explorer shows the empty trash text only for the trash target. A pending delete confirmation closes only for a document of the active workspace.
The views share one row_dir helper. The palette reads typed theme fields, and pure white uses ui::white(). The mobile-harness scale-probe command reports frame costs and work counts with 10, 100, and 1,000 documents. The invariants script checks mobile views for test branches. It links the ui-tokens test executable for the linker flag check.
Carry the page math flag across a text edit of one block. Compare the math state of the block before and after the edit. Keep the flag when the block had no math before. Set it when the block gets math. Clear the flag when the block loses math, so that the next frame scans the page.
Skip the scan while an equation draft or a code preview is open. Share one block test between the page scan and the edit path.
Read table cell text only when a snapshot asks for it. Builds without snapshots no longer search the page for the table or copy cell text on each frame.
Keep the last hover target in the view. Read it again when the page, the loaded document, the page text, the page titles or the read-only state change. Each view keeps its own targets. A target never goes to another page, document or view. A move inside the same link, also across wrapped lines, reads the text one time.
A move to another line of the same link moves the anchor of the waiting popup to that line. The popup keeps its timer. Confirm an open hover popup against the text one time per text revision. A rename of the target page updates the title and view choices of an open reference popup. Build the overlay scene for a hover only while a link popup is open or fades out. Find the table and canvas ancestors of a reference in one walk.
Format the block scroll bar snapshot ID lazily. Add six toolbar and popup prefixes and the page scroll bar prefix to the production Wasm prefix check.
Stream `Debug` layout fingerprints directly into `DefaultHasher` with a
trailing `0xff` terminator byte in `block_flow/{layout,surface_ref}.rs`
instead of allocating temporary `String` buffers, and add a unit test that
verifies bit-exact hash equality across block content variants.
Defer snapshot ID formatting with `format_args!` across
`overlays/code_lang_picker/render.rs`, `overlays/keyboard_toolbar/render.rs`,
and `overlays/paint_page/{mod,controls,media_controls}.rs`, borrow recent
code languages after the picker open check, reuse `palette.focus_ring` for
the picker focus border, and add `overlay.code_more_menu.` and
`overlay.code_lang_picker.item.` to `check-snapshot-prefixes.mjs`.
Extract shared ToolbarChrome, Tooltip, and HoverController (500ms enter / 250ms leave with hover bridge) under blocksuite-editor overlays.
Align FormatToolbar (Turn into current-block icon and selected row, Align dropdown, score-ordered inline actions, dual-section vertical Highlight list, Create Table, More), Image inner top-right hover/selected toolbar with all four corner resize handles, Bookmark/LinkedDoc/SyncedDoc/ExternalEmbed/Callout toolbars (single-click select, double-click open), Link/Reference hover popup above inline anchor with bridge and dropdowns, and desktop Simple Table hover add-bars (a press counts as a drag only after 4 px of travel along the bar's axis, a forward drag adds at least one row or column, and a drag back to the press point or away from the table adds nothing), three-dot axis pills, and 5px column resize handles.
Unify Page and canvas media downloads onto ImageStore's single set_on_blob_download host channel (with Web anchor fallback), and show the canvas Image and Attachment Download button only when ImageStore::can_deliver_downloads() is true and non-empty blob bytes are cached for that source_id.
Compute document math presence once per page and document revision (snapshot_has_math, memoized on BlockFlow) instead of walking the whole page on every layout, and include database titles, row titles, and rich-text cells in both the math check and the per-block preview fingerprint.
Route /pdf through the media slash path so that a host without a file picker keeps the typed /pdf text, the same as /attachment.
The preview workers now use a linear-memory ABI with four exports:
`memory`, `prepare(len)`, `invoke()` and `output_ptr()`. The host writes
each request into worker memory in one copy and copies each response out in
one copy. The old ABI called an export for every 4 bytes in each direction.
Rust gives out only the addresses of its own buffers, so the crate keeps
`forbid(unsafe_code)`. Buffers larger than 1 MiB go back to the allocator
after each request.
The PDF worker keeps each parsed document under a `docId` that the host
assigns. The frames are `PDF_OPEN`, `PDF_RENDER` and `PDF_CLOSE`.
The bytes of a document go to the worker once per open, not once per page.
Page pixels come back as a compact RGBA buffer that the worker transfers.
The playground bridge has one session table in `wasm_pdf_state.rs`. It
opens at most 8 documents or 256 MiB of source bytes.
To make room, the table closes least recently used idle documents, but only
when that makes the new document fit. Empty documents and documents larger
than 256 MiB never go to the worker.
The table closes a document when the view clears the last scope that used
it, also when no page request claimed it yet. A reopen that fails after a
worker restart keeps the known page count.
The table restarts the worker before the IDs run out.
The bridge no longer keeps 16 copies of PDF bytes.
Each worker event listener ignores events from a replaced worker, so a late
error of an old worker cannot stop the new one. A crash answers each sent
request once, so the count of unanswered requests stays exact.
`pdf-client.js` uses the same protocol and keeps its public methods. It
keeps the same open budget and waits for room before it sends an open.
New bytes for a known `docKey` now open a new document and drop the old
page count and pages. Before, the client returned the old page count.
Four snapshot IDs of the PDF viewer and the attachment toolbar use
`format_args!`, so the production bundle has no copy of their prefixes. The
prefix gate now checks 14 prefixes.
Replace the interactive control check in the dual-shell verifier with a legacy workspace readiness check for @affine/mobile 0.27.5.
The verifier requires a valid workspace document route and a visible editor container with a mounted editor host.
It also requires the legacy shell cookie and no synthetic legacy shell object.
One page check covers these conditions, and it uses the same route parser as Node.
The verifier runs this page check again after each IndexedDB read and before it returns.
A shell that leaves the document route or unmounts the editor before it stores data fails.
The verifier loads yjs on demand so Node tests run without installed packages.
It reads only target document records from local IndexedDB and verifies root catalog and page block state.
Rows must agree with the nbstore schema, and the updates store must have its docId index.
When a fresh profile stops at the workspace home route, it reads one document ID from the catalog.
It then locks that workspace and document and navigates once to the document route.
A redirect to a different document fails the check.
The legacy CLI path now reopens the mounted document in a new tab of the same Chromium profile.
That tab blocks the welcome template, so the shell must load the workspace from IndexedDB.
The local workspace database count must stay the same.
A server that cannot serve the document route directly fails the check.
Limit Chromium browser test file concurrency to two in CI so three browser suites do not overload four runner CPUs during SwiftShader startup.
Add a zero-dependency Node script that scans WebAssembly Section 11 data segments for eleven harness snapshot ID prefixes.
The script also scans Rust sources under blocksuite/crates to confirm that every watched prefix stays active.
The source scan ignores test modules and their child modules.
Wire the source check into packages/frontend/scripts/check-invariants.sh.
Wire the binary check into .github/workflows/native-playground.yml after wasm-opt.
Save the page and its catalog in one IndexedDB transaction.
Use the Chromium harness in four browser checks.
Use one 45-second DevTools handshake for the SwiftShader smoke tests.
Open each new page with one DevTools request.
Stop the process group if the browser exits before the handshake.
Use a short temporary directory if the socket path exceeds the limit.
Check the legacy control on two consecutive frames.
Report startup errors for --legacy-dir.
Wait for the OAuth configuration and provider render on /sign-in.
Run the browser regression tests in CI.
Add inline link and linked-doc 500ms hover popovers, dual-field text+link editing, and Inline/Card/Embed view conversion.
Extend the desktop format toolbar with inline equation, linked-doc creation, More submenu, and block-selection mounting.
Add block-level controls for code blocks (searchable language picker, line numbers, 8-line collapse), block/note LaTeX 2-step editing, image double-click lightbox, bookmark style toolbar, and callout 44px layout with emoji and 9-color toolbar.
Include targeted fixes:
- Flatten H4-H6 in touch Slash menus and hide scrolled-out desktop Slash preview cards.
- Allow Slash Copy in page_readonly mode.
- Preserve nested Y.Map background and readonly guard in Edgeless note slicer, guard locked mindmap descendants on delete, and skip dangling mindmap children.
- Consume click when dismissing active Calendar inline edit and restrict selected-day '+' visibility to touch form factors.
- Expand Page block_selection highlight to cover visible nested subtrees (skipping collapsed children) and align Move Up / Move Down icons in the block menu.
- Track actual presented system keyboard inside MetalHostView.inputView, restore software keyboard on repeat prose taps after dismissal, honor iPadOS hardware Command shortcuts in Modifiers::secondary, and sync UITextInteraction mode synchronously across readonly/mode/form-factor transitions.
- Make mobile KeyboardToolbar visibility declarative on active selection so narrow-to-wide resize, selection clear, and Android cold start never leave a ghost bottom toolbar; deduct docked toolbar height in popover_viewport and forward iOS touches immediately when floating overlays are open.
- Re-validate LinkPopup against live document revisions and sub-ranges so concurrent partial title/text link edits survive Unlink, align full-width and adjacent-link hit-testing, update web-smoke link button geometry for the 11-item format toolbar, and harden preview-workers/sign-in redirect handling.
- Add orthogonal PointerKind, FormFactor, and EditorCapabilities matrix in blocksuite-editor, decoupling database_readonly from edgeless_readonly and enforcing page_readonly across command/toolbar paths
- Attach cross-platform CJK and emoji FontFallbacks to blocksuite-editor text runs so iOS CoreText and Android CosmicTextSystem render CJK and emoji glyphs cleanly
- Wire real WgpuRenderer and CosmicTextSystem into Android ANativeWindow via SwappableAtlas, deterministic ui::clock_now() dispatch_after timer draining, single-JNI UTF-16 reads, surrogate-pair composing alignment, requestCursorUpdates + Matrix CursorAnchorInfo, historical ACTION_MOVE samples, hardware keyboard/scroll forwarding, and zero shadow-buffer pollution
- Frame iOS MetalHostView and SelectionOverlayView inside safeAreaInsets, gate software keyboard responder on PlaygroundView::wants_software_keyboard and pan-slop tap detection, avoid double safe_bottom subtraction on KeyboardToolbar insets, prevent spurious UITextInputDelegate textWillChange/textDidChange echo during IME composition, yield hardware pressesBegan during marked text, and guard UIEditMenuInteraction with explicit actions
- Enable wgpu/cosmic-text for target_os = "android" in packages/ui/ui and add Linux fontconfig/freetype packages to np-mobile CI workflow
Gate wasm-bindgen worker exports per preview target, externalize the four bundled UI/script fonts from the web playground Wasm bundle into static web assets, and validate fetched font bytes through the text system's fontdb loader so empty or HTML fallback responses fail closed with usable-face checks.
Add the zero-dependency ui-tokens crate to export generated theme tokens,
icon definitions, and bundled font bytes without cross-tree include_bytes!
paths.
Add the domain-neutral ui-kit crate with logical geometry helpers, SafeArea,
VirtualList, SwipeDialog, and SwipeMenu state machines backed by scheduler
time and four-rate replay invariance tests.
Extract blocksuite-editor from playground with the WorkspaceDocDirectory
host port, exact substring UTF-16 highlight matching, and LTR/RTL logical
start/end block flow layout. Slim playground to the demo and harness host.
Update workspace manifests, static invariant guards, CI workflows, and
AGENTS.md files.
- Add logical geometry helpers on Edges, Corners, Svg, and scroll offsets, and propagate inherited LayoutDirection through Taffy and fast splice rebuilds with a zero-clone LTR fast path.
- Propagate explicit BaseDirection through LineLayoutCache and all platform shapers (Apple CoreText, CosmicText, and Web), sort visual clusters by x_start, add UAX #9 multi-line soft-wrap bidi reordering, preserve contextual Arabic joining across same-font runs, and align text truncation on shaped glyph-cluster boundaries (`UI_LOC_CEILING = 95200`).
- Add scheduler-clock TouchGestureRecognizer with tap, long-press timer wakeup, pan cancellation, pinch re-anchoring, and closed-form MotionCurve presets including SwipeMenu InOutSine and SwipeDialog cubic-bezier/outQuad.
- Replace Web four-element safe-area probing with a single hidden probe and exact per-edge float comparison, preserving non-double-subtracted IME insets.
- Align the iOS platform stub traits and PlatformInfo, update packages/ui/AGENTS.md, and add aarch64-apple-ios and aarch64-apple-ios-sim compile guards to native-playground CI.