Commit Graph
11790 Commits
Author SHA1 Message Date
DarkSky 38b9e02f9e fix(editor): preserve desktop table controls and use V2 colors 2026-12-02 22:25:11 +09:00
DarkSky ab7ef04aa9 fix(editor): align database controls and embedded toolbars
Correct database calculations and show hints over empty footers.
Keep code tools in the canvas when a note nears the top edge.
Preserve linked documents when the desktop directory replays a create request.
2026-12-02 21:36:49 +09:00
DarkSky cb3e658654 fix(editor): show link popups in active notes
Use the note camera to hit inline links and document references.
Show Copy link to block in the code block More menu.
2026-12-02 21:22:12 +09:00
DarkSky 81870088c2 fix(desktop): restore workbench input and layout
Use the shaped Quick Search line for pointer input and IME bounds.
Support copy and cut in Quick Search.
Close the narrow sidebar drawer after navigation from Quick Search.
2026-12-02 20:52:49 +09:00
DarkSky 1282738ec1 feat(database): reorder Kanban lanes by dragging headers
Keep the full lane order, including the ungrouped lane.
Use the preview position when a peer reorders lanes during a drag.
Keep date values visible while the date picker owns edits.
Clear stale hover when the database search closes.
2026-12-02 20:46:58 +09:00
DarkSky 48b5f3005e perf(desktop): streamline local workspace writes and editor sync 2026-12-02 20:44:50 +09:00
DarkSky a3a7496b4c perf(blocksuite): eliminate snapshot ID leaks and table/toolbar hot-path work
Remove harness snapshot ID literals from production Wasm Section 11 across 36 prefixes.
Extend `check-snapshot-prefixes.mjs` to lock those 36 prefixes and bare container IDs at zero.

- Clip table grow preview to visible viewport rows and columns in one pass.
- Defer page table cell focus label formatting behind lazy evaluation.
- Compare derived four-state table edge zone on pointer hover to skip center redraws.
- Reuse shared `toolbar_chrome` geometry constants and color tokens in edgeless chrome.
- Replace multi-pass selection scans and `rotate().transform_point()` math with single passes.
2026-12-02 20:36:12 +09:00
DarkSky 2cbee4060d fix(web): replay IndexedDB writes after quota recovery 2026-12-02 20:15:38 +09:00
DarkSky 65460a7f13 fix(editor): cancel stale code toolbar clicks 2026-12-02 19:26:22 +09:00
DarkSky 9def8ed791 fix(desktop): sync linked documents and media across panes
Use the workspace directory for mentions and persist documents created in the editor.
Share media bytes within each workspace so split panes and previews can display them.
Use the browser date for journals and link the Outline to heading blocks.
2026-12-02 18:47:28 +09:00
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