Commit Graph
11780 Commits
Author SHA1 Message Date
DarkSky dfc8446ba2 fix(editor): guard code menu actions and translate pane input bounds 2026-12-02 18:13:38 +09:00
DarkSky 155f30f3b8 fix(blocksuite): reduce table and toolbar overhead
Release cached table axes when a block leaves the document.
Read label marks from the shared text delta.
Reuse pending toolbar timers and keep the final frame.
Convert pasted string labels to shared text.
Share the transaction code for compound edits.
2026-12-02 18:13:38 +09:00
DarkSky 05b5f3e21d fix(web): preserve post-delete writes when earlier IndexedDB ops retry
Let a committed delete supersede earlier failed operations on the same document.
Retry failed operations on other documents and preserve later updates.
2026-12-02 18:10:53 +09:00
DarkSky f5002e1eda perf(database): borrow database data and delete rows in one pass
Build the Table row bands in one pass over the hits. Each row id links
its bands, so a cell finds its band in constant time.

Read the database data and the view state of a block by reference on
the hover, drag, key and click paths. These paths no longer copy the
whole database.

Delete many rows with one read of the block graph. Each run of adjacent
rows is removed with one array edit, in one undo step. Row selection
and the Kanban lane menu use this path.

Look up a fresh row id in the blocks map instead of a decoded page
snapshot.

Format and lay out the hidden fields of a record only while their
section is open.

Open record URLs through the shared editor URL handler. Build the
snapshot ids of record notes and Calendar resize handles lazily. Use
the accent foreground token for the today button.
2026-12-02 17:51:02 +09:00
DarkSky 77d76401a2 fix(editor): anchor Callout emoji candidates to the caret 2026-12-02 15:31:12 +09:00
DarkSky 8e1e32acdf feat(edgeless): add note headers and canvas navigation
Scale Page Note headers and their controls with the Note and camera.
Use the Note screen bounds to size the header.
Clip collapsed Notes to their stored canvas bounds and fit the
camera to those bounds.

Save the title fold and canvas height in one edit. Keep the stored
clip height on expand. Show the bottom clip control only on Notes
without a Page header.

Open linked documents from the header and route canvas navigation
through the desktop editor host.
2026-12-02 15:31:12 +09:00
DarkSky 445a1092e9 feat(desktop): keep Web Desktop workspaces in IndexedDB
Read and write each workspace through its IndexedDB v3 store.
Keep document edits and deletions in order across retries and reloads.
Seed empty workspaces under the startup lock and release it if a write
cannot start or the connection closes.

Wait for pending transactions and read the stored clocks before each
retry. Cancel queued retries when the connection closes. Compact a
document only when its snapshot and all source updates still match.
2026-12-02 15:10:57 +09:00
DarkSky f5df9b27be feat(editor): complete code toolbar copy actions
Add Markdown and block link copy actions to the code toolbar menu.
Use window coordinates to hit-test the More button in embedded panes.
2026-12-02 15:10:56 +09:00
DarkSky 4e2ad7d416 fix(edgeless): support Page controls in active notes
Map Page block controls, table editing, and block moves through
the Active Note camera. Share the database view state between
the Page flow and the Note paint pass.

Place database popovers within the editor pane. Use window
coordinates for paint, pointer hits, scrolling, and IME.
Position popover hitbox elements relative to the pane.

Support media and caption editing inside active notes. Capture
mouse moves and release during image resize as soon as the drag
starts. Keep database and media writes behind read-only gates.
2026-12-02 15:10:56 +09:00
DarkSky 3b972c667a feat(edgeless): add selection toolbar actions
Add font controls and a shape drag handle. Show the short shape color
palette, and keep toolbar dividers within their rows. Add frame, group,
and clipboard actions to the More menu.

Copy selection links with the workspace origin. Encode document blocks
and surface elements in their own query parameters.
2026-12-02 14:59:13 +09:00
DarkSky 04db94c6d1 feat(database): add date picker, row selection, search and statistics
Open a month picker for date cells and stretch one-day calendar events.
Select visible table rows and delete them in one undo step.
Move table focus with the keyboard.
Add named Kanban groups from the board.
Filter each view with Search and save footer statistics per column.
2026-12-02 14:59:13 +09:00
DarkSky 7453b4aee2 feat(editor): add Callout emoji search
Place the search caret at the clicked character. Keep the picker and toolbar menus mutually exclusive.

Keep one full emoji row above the phone keyboard.
2026-12-02 14:51:59 +09:00
DarkSky b7fcc03540 feat(edgeless): add toolbar tooltips and brush transitions
Show tooltips on creation, shape, brush, and zoom controls. Select
static shortcut labels for Apple platforms and other hosts.

Give pressed backgrounds priority over hover backgrounds. Clear pressed
feedback when the panel closes or the brush mode changes.

Animate transitions between Pen and Highlighter. Show the width for
the active drawing tool and use a crosshair for creation tools.
2026-12-02 14:51:59 +09:00
DarkSky 6c38ad1209 feat(edgeless): format canvas labels in place 2026-12-02 14:51:59 +09:00
DarkSky 83e48abd64 fix(editor): preserve imported table axes during edits
Resolve row and column descriptors by their stored IDs. Reserve descriptor
and cell keys before insertion. Scan the current table during open
transactions because the revision changes only on commit.

Remove empty trailing axes together. Match column previews to the final cell
layout. Hide canvas controls when their selection leaves the viewport.
2026-12-02 14:51:59 +09:00
DarkSky 97a7fe4bd3 fix(editor): render attachment toolbar icons and hide citation downloads
Use static ChromeIcon::Download and ChromeIcon::Edit in
attachment_toolbar.rs instead of missing ui-tokens icon names.
Hide the download action when prop:style equals citation or
prop:footnoteIdentifier holds a value to match BlockSuite 0.27.5.
Add unit tests for attachment toolbar icon SVGs and action sets.
2026-12-02 14:48:05 +09:00
DarkSky 72af0e4117 ci(frontend): warm Chromium and add iOS smoke diagnostics
1. Warm Chromium before the browser tests in the js-room-coop and
   preview-wasm-workers jobs. Use a temporary profile and a 20-second
   timeout. If Chromium fails to start, continue to the tests.

2. Run the ios-device-check job in parallel with the ios-host job on
   macos-15. Check both ui and affine-ios-host for aarch64-apple-ios.
   Use standard Rust cache keys and keep only aarch64-apple-ios-sim in
   ios-host.

3. When the iOS smoke test fails, show the last two minutes of WebKit
   logs from the simulator. A 15-second alarm stops the log command.
   Exit with the status code from the smoke test.

4. Show the monotonic time and the step duration in milliseconds on each
   smoke test line. Flush stdout after each line.

5. In requireS3 and the unhandled error handler in
   IosHostS3SmokeTest.swift, call smokeLog and flush stderr before
   _exit(1). Keep the original stderr messages.
2026-12-02 13:27:44 +09:00
DarkSky 2ecdd5a6ef perf(edgeless): reduce scene and text lookup costs
Read canvas block flags when the scene collects them.
Read the text block and its children on blur.

Check live mindmap membership before a drag changes node positions.
Check group locks across all surfaces on the page.
Stop the drag at a locked branch.
2026-12-02 11:00:19 +09:00
DarkSky 5465a17d33 perf(editor): defer block snapshot IDs
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.
2026-12-02 09:25:12 +09:00
DarkSky 1678891fb5 ci(frontend): run Wasm and Linux checks in parallel
Reuse Cargo dependencies between tests and the harness build.
Use the iOS main run loop for the smoke tests.
Disable the GPU for the IndexedDB save test.
Record Chromium startup errors before cleanup.
2026-12-02 09:25:04 +09:00
DarkSky 56b8204000 perf(harness): run audits on parallel threads
Keep each audit case on its own session. Replay earlier frames at the same
window size before a selected gallery shot. Test the slash menu audit
with two threads.
2026-12-02 09:14:07 +09:00
DarkSky 2814923c96 perf(playground): parse block links with the browser URL on the Web
On the Web, read block links with the browser URL parser. Other targets
keep the url crate. Both targets share the path, query and encoding
rules, so the playground crate drops percent-encoding.

The Wasm bundle drops url, IDNA and Unicode normalization tables.
Block links keep the same WHATWG origin, path and query rules.

Send read-only link taps on Page and Edgeless through the block link
host. Format Markdown from the current text when the user clicks Copy
as Markdown. Cancel a pending copy if the active document changes.

Clamp a stored toolbar scroll offset when its row gets narrower. Clear
toolbar measurements, block toolbar submenus and the table axis menu
scroll when the document changes.

Skip the redraw if the table axis menu scroll stays in place.
2026-12-02 09:09:29 +09:00
DarkSky 1fb17ea47d fix(web): isolate pane embeds and cancel stale previews
Track HTML embeds by pane. Hide the embeds in a pane while its overlays are open.
Clear desktop pane and peek embeds on routes without documents.

Keep code preview requests pending until SVG decode completes.
Settle pending requests when their worker stops. Release Blob URLs when decode or worker startup fails.
2026-12-02 09:09:29 +09:00
DarkSky b3152da6d7 perf(mobile): virtualize home document list and clamp scroll
The mobile Home tab caches favorites and non-trashed documents in a revision-keyed model. Warm frames reuse this cache without cloning document records.

The Home document list mounts only visible rows plus overscan with exact spacers. Fixed row heights and line clamping keep list coordinates deterministic across deep scrolls and long previews.

Home geometry includes the empty favorites section header height across all viewport sizes. The Home view clamps scroll offsets before rendering, and workspace switches reset Home and Search scroll offsets to zero.

The accessibility tree reads the cached Home model and visible window without mutating scroll state. Scale tests verify fixed row geometry, bottom reachability without favorites, and bounded row counts.
2026-12-02 07:31:19 +09:00
DarkSky 717cd97542 perf(desktop): write shell commands through the connected session
Save shell commands through the active workspace session. Seed its clock
at connection time and update folder rows after the session accepts them.

Cache document views and mount the visible sidebar rows. Clamp scroll
after the tree shrinks and reset it when the workspace changes.

Reuse the SQLite read connection for each backing and close it when
the last handle drops.
2026-12-02 06:23:12 +09:00
DarkSky 3846e325a3 perf(store): advance pushed_clock from row slots and reload evicted docs
SQLite is now the only clock writer for document updates. Each row takes
the event time or 1 ms after the document clock, whichever is later. The
session no longer keeps its own copy of the clock and gives SQLite the
event time of each update.

Each committed row reports its slot: the document clock before the write
and the row time. A row that the server holds moves pushed_clock when
the row took the slot right after the current pushed_clock.

A row from the server holds this proof when SQLite writes it. A local
row holds it when the server acknowledged its push and every earlier
push of the document.

The session keeps the slots of the other committed rows until the server
holds them. The flush checks only peer_clocks and clocks in its write
transaction, and it reads no row data.

Thus a remote update on a pushed document that the session never opened
moves pushed_clock in the same transaction. The next start no longer
loads and pushes that document again.

A row of another writer between two own rows stops pushed_clock. When
the server holds the whole in-memory state of that document, a content
check runs after the commit in one deferred transaction.

The same transaction reads the rows and writes pushed_clock. If another
connection writes first, SQLite returns SQLITE_BUSY_SNAPSHOT, the
transaction rolls back, and the next flush tries again.

A SQLite-backed session drops the staged broadcasts of the oldest
unknown document above the 64 document or 1 MiB limit. It now keeps the
ID of that document in a queue of up to 1024 IDs. The next flush looks
up these IDs in SQLite in one query.

A document that another writer added becomes a disk document that the
session loads and reconciles with the server, so the dropped changes
come back. The flush drops the other IDs.

On a page with 10,000 blocks, the flush after 20 acknowledged edits
takes 7.5 ms instead of 432 ms. The flush after 50 remote updates takes
12.3 ms instead of 1,024 ms.
2026-12-02 06:09:18 +09:00
DarkSky af83a5a38c perf(mobile): mount visible explorer rows and drop deleted documents
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.
2026-12-02 05:41:17 +09:00
DarkSky be8602af63 perf(client): log draft edits and index folder trees by parent
Write one log record per draft edit. Fold the shared log into the
snapshot under a file lock to preserve changes from all writers.

Index child folders by parent to reduce repeated scans during traversal
and deletion.
2026-12-02 05:32:00 +09:00
DarkSky 0a6b62c972 feat(database): edit record notes and preserve calendar event times 2026-12-02 05:20:48 +09:00
DarkSky aec71dfe29 perf(editor): keep math and link checks off the frame path
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.
2026-12-02 05:06:49 +09:00
DarkSky f19211e6f4 fix(edgeless): preserve canvas link targets and edits during collaboration
Rotate quick-connect handles with their shapes. Use pointer hits for card
actions and keep document share parameters on pasted cards.

Move the selected mindmap subtree and keep positions that peers set on
other branches. Remove an empty text frame with its local deletions so
one undo restores its paragraphs.
2026-12-02 04:29:19 +09:00
DarkSky 624e987d43 feat(web): mount the desktop workbench with worker previews 2026-12-02 03:52:43 +09:00
DarkSky 4bcbca66cb perf(store): tighten blob liveness, sync queues, and share ingest
Add SqliteDocStorage::has_active_blob to check blob existence without
reading blob payload overflow pages during ingestion.

Remove the redundant pre-check loop for generated media block IDs and
retry only when PageDocSession::insert_block reports a duplicate key.

Store SpaceSyncEngine outbound items in a VecDeque, peek before send in
WorkspaceSession, disconnect immediately on send failure, and clear
stale frames on disconnect.

Drop passive remote broadcasts for unknown documents without local
baselines or active loads in an in-memory session, bound in-flight load
staging with a reload flag, and clear load leases on failure,
disconnect, or deletion.

Another writer of the same SQLite file can add a document after a
session opens. Thus a SQLite-backed session stages passive broadcasts
for unknown documents, up to 64 documents and 1 MiB.

The next flush persists the broadcasts for documents that SQLite has
and drops the others. Above the limits, the oldest document loses its
staged broadcasts and needs a reload.

Split share receipt persistence into a sibling module and reject shares
targeting tombstoned documents before any write.

Keep only the written sidecar keys and their previous entries for
rollback. When COMMIT fails, take a new write lock and read the
sidecar again.

Restore only the keys that still hold this attempt without a committed
import. Thus receipts that another writer committed after SQLite
released the lock stay.

Migrate a legacy receipt of a permanently deleted document without a
witness, so the migration does not recreate its doc properties row,
and count that receipt as committed while the document stays deleted.

Reclaim oldest complete quarantine groups in ShareDiskInbox when old
quarantine files block valid batches under the 128 MiB cap.
2026-12-02 03:20:04 +09:00
DarkSky e85ab555be fix(editor): open workspace block links and keep toolbar actions in reach 2026-12-02 02:26:12 +09:00
DarkSky 6429aead71 perf(native): refresh only the caption block after a caption commit
A caption keystroke read the whole page again from the document. On a
page with 10,000 blocks, each key took about 300 ms.

The caption editor now writes the committed caption into the page
snapshot. It changes the typed caption and the raw `prop:caption` of
the block. If the block is not in the snapshot, or its stored caption
is not a plain string, the editor refreshes the whole document.

`mark_caption_dirty` replaced a pending full layout pass with a pass
over the caption block only. A remote update that arrived in the same
frame as a caption event then kept its old layout. The function now
keeps a pending full pass.
2026-12-02 00:54:06 +09:00
DarkSky 539938daae fix(editor): preserve table data and correct database and canvas controls
Check block IDs in the document map. Use one sequence per table for
row and column IDs. Reject duplicate axes before changing cells.

Keep database menus on the selected row or lane. Correct calendar
editing, daylight saving time conversions, scrollbars, and canvas
toolbar placement. Commit active captions before toolbar actions.
2026-12-02 00:35:55 +09:00
DarkSky a83ea1e1a3 fix(preview): bound PDF wait eviction, native open tracking, and session cleanup
Retain failed PDF tombstones in `refresh_pdf_previews` only while a card or the viewer shows that source. This stops retry loops while shown and drops byte references once removed.

Track each active native PDF open by monotonic `open_id` and payload bytes in `DocTable`. Each `(scope_id, source_id)` targets at most one payload at a time. Switching to different bytes clears stale results and waits before cache lookups, cancelling unstarted opens with no remaining waiters. Two live scopes with colliding keys never evict each other. Notify `cv_idle` whenever job pruning or scope cleanup leaves the queue idle.

Harden `WasmPdfState` without changing its interface or keeping PDF byte buffers. Skip `counts` writes for out-of-range sizes. Clear `in_flight` on session close or open cancel. Close idle zero-page and first-open failures while keeping known counts on reopen failure. Verify `doc_id` ownership in `answer` and `admit`.

Track queued `waiters` per entry in `pdf-client.js` so concurrent opens over 64 documents never evict waiting entries. Trim idle known entries back to 64 as requests close or settle. Wake and reject waiters at once when bytes change or the client disposes. Keep transient worker fetch errors retryable with no negative error cache.
2026-12-01 23:46:24 +09:00
DarkSky 6dbd463e67 feat(frontend): connect workspace sync to the native shells and fit embedded editors 2026-12-01 23:05:25 +09:00
DarkSky c83b777af8 perf(editor): defer toolbar snapshot formatting and remove scratch allocations
Pass lazy snapshot identifiers directly into `Div::snapshot` from the four `ToolbarChrome` helpers. Non-harness builds now drop the formatting work and static snapshot strings.

Switch dynamic toolbar snapshot IDs across the eight floating overlay toolbars to `format_args!`. Borrow displayed text for `snapshot_text`. Keep all interactive element IDs and layout geometry unchanged.

Store static string slices in `ToolbarTooltip` and read `palette.link` directly in `chrome_link_color`. Replace scratch `group_widths` vectors with stack accumulators. Compute link popup label width and flags once per frame without cloning `LinkPopupTarget`.
2026-12-01 22:47:28 +09:00
DarkSky 7c96dfbabf perf(editor): stream layout fingerprints and defer overlay snapshot strings
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`.
2026-12-01 21:50:52 +09:00
DarkSky 15a7ac42fe perf(client,store): remove hot-path copies, scans, and redundant queries in sync and storage
Remove unnecessary allocations, scans, and repeated SQLite queries across document sync, media ingestion, and workspace table storage:

- Replace the full-page snapshot read and ID set scan in `next_available_media_block_id` with bounded O(1) read-only lookups against the root `blocks` map, keeping explicit block IDs in `ingest_media_into_doc_session` strict.
- Avoid cloning broadcast update payloads when a document is not in `LoadingRemote`, isolate per-update apply errors across live broadcasts and staged `DocLoaded` replays while triggering a single reconciliation and holding `remote_ts` on failure, skip unmanaged entries during timestamp sync, remove the unused `observed_remote_ts` state, and unify root, table, and page reconciliation dispatch in `doc_sync`.
- Encode `YjsTableDoc` state vectors and diffs directly via `y_octo::Doc::get_state_vector` and `encode_state_as_update_v1` instead of round-tripping full V1 updates.
- Cache per-document tombstone checks and monotonic clock watermarks within a single `BEGIN IMMEDIATE` write transaction in `sqlite/doc.rs`.
- Replace the two-query in-memory `HashMap` join in `list_unpushed_doc_clocks` with a single SQLite `LEFT JOIN` query while preserving `NaiveDateTime` comparison semantics.
2026-12-01 20:50:32 +09:00
DarkSky f7dc193f9d feat(editor): unify ToolbarChrome, tooltips, page block toolbars, and table hover controls
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.
2026-12-01 19:26:55 +09:00
DarkSky 69cc024e71 feat(edgeless): align element toolbar chrome, note style panel, media actions, and quick-connect preview 2026-12-01 19:13:16 +09:00
DarkSky 2144304032 perf(preview): keep PDF documents open in the worker by docId
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.
2026-12-01 18:55:10 +09:00
DarkSky a8ff41ccdf perf(editor): format code toolbar snapshot ids lazily and rank languages without heap keys
The desktop code toolbar, its More menu and the touch code toolbar now give
`format_args!` directly to the snapshot call. Release builds format no
snapshot ids for these controls. Harness builds record the same ids as before.
The interactive element ids do not change.

`filter_code_languages_ordered` keeps its signature and its order. It gives
each catalog entry the dense order of its first entry in the history. Then it
sorts one integer key for each match on the stack.

The label match compares ASCII bytes without case, so a query makes no
lowercase copy of each label.

A table test compares the new order with the previous sort for all query
prefixes, cases, aliases, duplicates and a history of 65,538 entries.

`Palette` now has `error`, `error_background` and `focus_ring` from the theme
tokens. The More menu and the touch toolbar read these fields. The colors do
not change.

Wheel and touch fling scrolls lend the collapsed block set to the overlay
scene and do not clone it. This change also
removes `ScrollAxis::set_max` and `ScrollAxis::snapped`, which had no
production callers.
2026-12-01 18:35:52 +09:00
DarkSky 67ccd2fc3d feat(editor): add paint-only database hover, cursors, and desktop record peek
Unify Table, Kanban, and Calendar hover state into a paint-only overlay in playground without triggering document relayout or text-cache rebuilds, map all database hit targets and popovers to standard cursor styles with full modal, overlay, and side-panel hover isolation, and invalidate cached hover on document revision changes. A pressed title cell hides the OPEN and more buttons of its row in the same frame, and an open database popover or record peek hides the page block hover under it.

Add a centered desktop Record Peek modal with checkbox fields and an editable title that splices each keystroke into the live row title, like a title cell: peer edits merge, Enter, Escape, an outside click, or closing the peek only end the edit and write nothing, and one undo removes the local typing. A double click on a Calendar event edits its title in place only when its first click opened the peek. Also add 24x24 icon row/card and Kanban lane context menus with the CenterPeek icon, single-transaction atomic Undo row CRUD primitives (insert at slot with group inheritance and immediate title editing in the same undo step, lossless rich-text and reference duplication, and deletion cleaning prop:cells), dual-date-column Calendar resize that keeps the local time of day of the dragged edge across DST changes and the exact timestamp of the other edge, readonly Link cell click pass-through, and Escape/outside-click dismissal for all database popovers.
2026-12-01 17:57:01 +09:00
DarkSky 4057255c50 feat(store,client): add DocSyncCoordinator per-doc sync state machine, content-checked pushed_clock, lazy unpushed subdocs, and sidecar share receipts 2026-12-01 17:13:20 +09:00
DarkSky 36daa68232 perf(native): share PDF pages and parse each document once off the UI thread
Embedded PDF cards that show the same page now share one bitmap.
Twelve cards of one page keep 1 image instead of 12.

A card with a current preview now stops at a pointer check.
The refresh does not hash bytes, touch the document table or call the provider.

The native provider parses each document on a background thread.
Views that open the same content share one parse through a weak table.
Render jobs share the parse without a lock.

This change removes the second parsed copy, the provider cache and the byte copies.
The parse also renders the first page, so one wakeup brings the document and its first page.

The view keeps one LRU table of open documents.
It never evicts what the open viewer shows or what a card waits on.
A card that waits for a free slot opens in a later pass or when the viewer closes.
An open that no card or viewer wants any more frees its slot.

Content identity uses the shared allocation, then a full byte compare.
The sampled hash is only a map key, so new bytes with the same name and length render again.
2026-12-01 16:05:36 +09:00
DarkSky 50ed8a16de ci(web): run Chromium browser test files one at a time
Run the real-browser web host test files sequentially in CI so two cold Chromium and SwiftShader startups do not compete for disk reads and four runner CPUs at time zero.
2026-12-01 15:12:51 +09:00
DarkSky 4a2a44d9b9 feat(editor): unify inline caption editing and code block toolbars
Replace detached caption prompts with direct in-place caption editing across all captioned block flavours, unify the desktop hover code toolbar with 28x28 icon buttons and More menu, and dock a horizontally scrollable >=44pt touch code toolbar on Phone and Tablet viewports.

- Add touch docked code toolbar via place_touch_docked_toolbar with language picker, conditional preview toggle, copy, caption, wrap, line number, collapse, duplicate, and pinned delete controls
- Reserve touch code toolbar height in Page viewport scroll/caret reveal and touch selection visible-band calculations so typing in a focused code block never falls behind the docked bottom toolbars
- Map in-place caption pointer hit-testing, drag selection, and IME selection bounds through Edgeless Note camera/scale transforms alongside Page coordinates
- Report wants_software_keyboard() while the in-place caption editor is active on Page and Edgeless modes, and enforce edgeless_readonly alongside page_readonly
- Preserve non-collapsed selection text when splitting a caption on Enter in Page mode, commit and exit cleanly on Enter in Edgeless mode, and only clear focus when the structural commit succeeds
- Support clipboard paste with newline normalization, word-granularity navigation/deletion, mouse drag selection, and standard line-height placeholder carets in the in-place caption editor
- Update AGENTS.md invariants, headless harness states, and deterministic unit tests
2026-12-01 15:04:12 +09:00