Commit Graph
12015 Commits
Author SHA1 Message Date
DarkSky bcf9736834 perf(desktop): reduce favorite drag and reorder work
Read favorite anchors by key. Skip writes for unchanged placements.
Keep document views when only the favorite order changes.
Set all favorite flags when the first write copies legacy favorites.
2026-12-05 14:45:31 +09:00
DarkSky 934ad7dc10 feat(editor): create docs in edgeless link picker and edit multiline card descriptions
Add Page and Edgeless creation rows to the edgeless link picker to match Web 0.27.5.

Show CreatePage and CreateEdgeless below matched docs when edgeless allows writes.
Default empty queries to "Untitled" and commit creation with one structural undo step.

Update the bookmark/card alias editor description field to match multiline `<textarea maxlength="500">`.
Support Shift+Enter newlines, Enter save, Up/Down line moves, wheel scroll, and UTF-16 safety.
Keep initial open scrolled to the top, and add Shift+Click extension, cross-line drag selection, and caret reveal on focus.
2026-12-05 14:23:51 +09:00
DarkSky 935a9bd108 fix(desktop): separate cold surface probe cache from metadata revisions
Keep cold SQLite surface probe results and in-flight batches valid across
in-memory metadata updates. Clear and discard cold surface probes only when the
SQLite disk stamp changes.

On transient SQLite read errors, skip inserting permanent negative cache entries
in both synced document loading and surface probing. Back off failed
candidates by pass count with exponential strides so later refreshes recover
after locks clear.
2026-12-05 13:47:19 +09:00
DarkSky ee904768d7 fix(editor): keep reference positions across map updates 2026-12-05 13:02:15 +09:00
DarkSky f4b9fcd559 fix(desktop): load only documents that open panes show 2026-12-05 12:22:26 +09:00
DarkSky e2e6653da7 fix(database): preserve table paste after SVG and MathML 2026-12-05 12:03:26 +09:00
DarkSky 66357cfabb fix(desktop): scroll to the highlighted language 2026-12-05 12:00:27 +09:00
DarkSky e8707a0fdb fix(desktop): isolate linked documents in favorite folders 2026-12-05 11:42:50 +09:00
DarkSky 397994fac8 fix(desktop): publish backups and reduce work in template and trash views 2026-12-05 11:35:08 +09:00
DarkSky dbe1cbae29 perf(desktop): share document IDs with the explorer
Reuse the document slices across frames. Remove the unused document store environment revision.
2026-12-05 11:32:23 +09:00
DarkSky 57b57a2785 perf(ui): reuse headless pipelines on the same GPU device 2026-12-05 11:29:10 +09:00
DarkSky 12bd597e81 fix(desktop): isolate workspace storage across deletion
Close the database if a blocked IndexedDB open succeeds after rejection.
2026-12-05 11:16:56 +09:00
DarkSky 2d38ee5f18 ci(frontend): split desktop-only wasm smoke and macOS gallery gate
Update `native-playground.yml` for `desktop-leaf-only` and macOS checks:
- Skip `playground` Wasm build and `web-smoke.mjs` when `desktop-leaf-only` is true. Keep `affine_desktop` Wasm, `check-snapshot-prefixes.mjs`, and `verify-desktop-persistence.mjs`.
- Narrow macOS desktop tests to `affine-desktop --lib --features harness` while keeping `--all-targets` check coverage.
- Build `bs-harness` and `desktop-harness` together in `macos-headless`, and verify deterministic `desktop-harness gallery` output across two runs (`14` PNG files).

Add seven live desktop snapshot prefixes to `check-snapshot-prefixes.mjs` (`250` to `257`) and update `check-snapshot-prefixes.test.mjs` with a single-bundle CLI test.
2026-12-05 11:11:27 +09:00
DarkSky 9b43941b27 fix(desktop): draw the property name input focus halo 2026-12-05 11:07:13 +09:00
DarkSky fdd43a21a1 feat(store,client,desktop): store favorites in userdata table and reorder in sidebar
Store document, folder, collection, and tag favorites in the userdata$<uid>$favorite table with fractional indices and soft-delete removal.
Fall back to legacy docProperties favorite flags when no favorite table exists, and copy them into the table on the first favorite write.
Load and persist the favorite table across SQLite read-write sessions, read-only workspace opens, Web Desktop IndexedDB stores, and cloud sync.
Render and expand favorite documents, folders, collections, and tags in the desktop sidebar Favorites section apart from the Organize tree.
Add menu actions to add or remove favorites and drag reorder for top-level Favorites rows without changing db$folders order.
Copy the database to a separate path before writing a test -wal sidecar in sqlite_wal_blobs to avoid close races.
2026-12-05 10:51:39 +09:00
DarkSky 75e8e4bdd2 fix(desktop,editor): polish shortcuts and controls 2026-12-05 10:42:23 +09:00
DarkSky 08ee3cb22a fix(desktop): show borders on property name fields 2026-12-05 10:12:54 +09:00
DarkSky cbb91937eb feat(editor): use the 0.27.5 grid in the keyboard tool panels
The More, Turn into and Highlight panels now use the BlockSuite 0.27.5
grid: 4 columns, 12 px gaps, 64 px buttons with 32 px icons and 18 px
labels. The scroll limit and the painter read the same layout values.

Document Group&Frame lists the frames in document order, then the
groups. The toolbar keeps this list for each document and revision, so
a panel scroll does not read the block tree again.

The panel painting moves from render.rs to a new panels.rs file.
2026-12-05 10:09:05 +09:00
DarkSky 9ee3726c03 fix(desktop,editor): align document headers and canvas tools
Place document actions next to the title. Anchor the More menu to its button.
Close canvas tool panels and commit inline edits when the Link picker opens.
Return keyboard input to the canvas when another tool closes the Link picker.
Show four mind map style previews in both toolbars.
2026-12-05 09:41:42 +09:00
DarkSky 7b7d002327 feat(editor): add media card actions and table cell controls 2026-12-05 09:15:06 +09:00
DarkSky 169df763f2 feat(editor): copy Edgeless selections as images
Render the selected scene to PNG for the native clipboard. Split external multi-select text on commas and keep structured table labels intact.
2026-12-05 09:12:12 +09:00
DarkSky 3fe764490f fix(playground): accept IME input in the Edgeless link picker
Use a UTF-16 buffer for the link picker query. Update the results as
the input method changes the query. Let Escape cancel composition
and let Enter commit the query before it inserts a card.

Close the Shape and Mindmap menus when the link picker opens.
2026-12-05 08:19:01 +09:00
DarkSky 0769d52542 fix(desktop): match the app and editor version rows on the Web 2026-12-05 08:11:02 +09:00
DarkSky 2c6d0aee5f feat(desktop): add explicit quick search tag filter mode
Remove implicit `#` prefix tag routing in default quick search. Queries such as `#123` and `#` now match titles, content, collections, tags, and commands literally.

Add `QuickCommandId::FilterDocsByTag` ("Filter docs by tag") to enter a dedicated tag filter submode. Show a `Tag` pill badge and "Filter docs by tag..." placeholder in the search bar. Filter results to matching tags and tagged documents. Return to main search on empty `Backspace`, `Escape`, or pill click.
2026-12-05 08:09:14 +09:00
DarkSky b9122a6822 fix(editor): fade eraser targets in paint order
Use world bounds to skip stroke segments and outlines beyond the pointer step.
Paint eraser targets at 0.3 opacity in scene order.
Check four more snapshot prefixes in Wasm data.
2026-12-05 07:49:55 +09:00
DarkSky 1ecc81d534 fix(desktop): reject zero-size AVIF child boxes 2026-12-05 07:45:23 +09:00
DarkSky c828d67d4e fix(editor,playground): outline frame swatches and carry table copy cells in text/html
- Unify Edgeless color dot rendering via paint_color_dot (dark-mode 1px border ring, transparent diagonal slash, and default transparent Frame without prop:background).
- Encode Database table copies in real clipboard text/html (data-affine-database-table) via shared write_text_and_html and Web native paste event without side-table state, preserving comma-containing option labels across tabs while splitting external plain-text copies.
2026-12-05 07:23:50 +09:00
DarkSky 2a18b2377e feat(editor,desktop): resolve cross-doc surface refs and hydrate synced docs
- Preview cross-document SurfaceRef frames, groups (including pure-note and nested groups), and mindmaps, and route Open / CenterPeek to the owner document.
- Hydrate cold-opened and remotely added nested EmbedSyncedDoc targets via per-revision edge caching in DesktopDirectory without steady-state rescans.
- Preserve object and string Y.Text embeds with formatting marks lossless across Linked Doc migration.
2026-12-05 07:19:26 +09:00
DarkSky e5623f6196 refactor(desktop): split inspector modules and clamp narrow property menus
Move ReorderList and frame order helpers into right_sidebar/reorder.rs.
Move FrameTitleInput into right_sidebar/frame_title_input.rs while keeping existing module exports.
Clamp custom property menu and scroll widths to the smaller of 220 px and the viewport width.
This change stops overflow in viewports narrower than 220 px and keeps wider layouts identical.
Add a table-driven test in properties_and_settings_style.rs for 1280 px, 220 px, and 200 px viewports.
2026-12-05 07:14:44 +09:00
DarkSky 350fec7b01 feat(desktop): add interactive workspace settings, properties tab, backup export, and template badge 2026-12-05 07:04:56 +09:00
DarkSky 39248d82a6 fix(desktop): export AVIF images with item data 2026-12-05 07:01:36 +09:00
DarkSky a71e273e4e ci(np): reuse desktop dependencies when building macos bs-harness
Pass `-p affine-desktop` and `--features playground/harness` to build `bs-harness` in the `macos-headless` job. This command reuses the crates from the earlier desktop test step. It stops Cargo from rebuilding shared dependencies with different features.

Also compare `artifacts/macos-run1.json` and `artifacts/macos-run2.json` with `cmp`. This check confirms that both renders write identical snapshot JSON bytes.
2026-12-05 06:53:12 +09:00
DarkSky f24d4291e7 feat(desktop): match the web explorer grid columns and trash select mode
The docs explorer grid shows the number of columns that the web masonry
calculates from the width of the pane. A card has the width of its
column and a height of 1.26 times that width. The last card of a row
keeps its column width.

Grid cards are 24 px apart. List rows are 12 px apart, and a group
header has 12 px above and below it. The side padding follows the width
of the pane, as on the web.

The explorer row cache no longer depends on the grid mode or the width.
A resize that changes the number of columns only splits the rows again.

In a window that is less than 280 px high, the explorer controls wrap
and become smaller, and the side padding is 12 px. Each control keeps
its full width, so you can click it.

The trash keeps its row keys until the document views change. The
"Select all" button shows only in the select mode, as on the web.
Escape or "Done" ends the select mode.

The trash has no "Empty Trash" button, as on the web. To delete all
trashed documents, use "Select all" and "Delete permanently".

After "Clear" empties the selection, the trash stays in the select
mode. Then the select bar disables "Restore" and "Delete permanently",
and a click on a document title selects the document.

The trash opens the read-only preview only outside the select mode.
2026-12-05 06:47:21 +09:00
DarkSky 7ebdec91c7 fix(desktop): preserve database backlink order and limits
Keep discovery order when database names compare equal. Count rows that
link to their own document before the search removes them.
2026-12-05 06:30:02 +09:00
DarkSky b4548df803 fix(mobile): use grapheme boundaries in field hit tests 2026-12-05 05:52:18 +09:00
DarkSky 720873989d fix(desktop,playground): constrain select pickers and table axis menus
Constrain database backlink select pickers inside viewport and
page-information bounds, place table column axis menus below the axis
pill or flip above without covering it in Page and Edgeless modes, and
add regression tests for tag pickers and separated database footer
controls.
2026-12-05 05:41:16 +09:00
DarkSky 9a628d707f feat(editor): add canvas eraser, mind map and link tools, and key shortcuts
Add the Eraser (E), Mind map, and Link (@) tools to the Edgeless creation toolbar. The toolbar
shows 13 tools in one row when they fit. Otherwise it uses the fewest rows (two or three) that
keep each button at full size. Below that width, it uses three rows of smaller buttons.

- Eraser: a drag erases the unlocked items that the pointer path crosses, in one undo step.
  Escape cancels the drag. Targets fade while the drag continues, and items above a target
  stay opaque.
- Mind map: select one of four styles, then click the canvas to put a root and three children
  there in one undo step.
- Link: select a document to insert a 364 x 390 vertical linked-doc card at the viewport center.
  The picker shows above the canvas controls. In a short canvas, its list scrolls, and the
  arrow keys keep the selected row in view.
- K and - turn the note slicer on or off for one selected unlocked note.
- Arrow keys move the selection 1 px, and Shift with an arrow key moves it 10 px, in one undo
  step. In a mind map, arrow keys select the parent, child, or sibling node, and the camera
  pans to show a node outside the view. A printable key on one selected mind map node, with or
  without Shift, starts to edit its label with that character.
- [ and ] send the selection backward or bring it forward by one layer, also on a mind map
  node. Other states pass the key through.
2026-12-05 05:33:33 +09:00
DarkSky a72da88ae3 fix(desktop): align quick search modal and sidebar footer layout
Quick Search now paints the modal scrim on its backdrop and uses the
popover shadow token without the large blur halo. Its result list adds
8px right padding to clear the scrollbar from row highlights and
timestamps.

The Import action moves out of the sidebar new document menu into the
Others section right below Trash. The scrollable sidebar tree adds 8px
bottom padding and separates from the fixed Settings footer with a 1px
top border and 4px vertical padding.
2026-12-05 05:26:16 +09:00
DarkSky 358a6ecf23 fix(editor): align headers, references, and web appearance 2026-12-05 04:59:02 +09:00
DarkSky 9492fb6880 fix(desktop): match property menu icons and refresh cached rows
Read property tables without waiting for the writer.
Retry the property read on the next frame when the writer holds the lock.
Reuse draft filter results and calculate empty preview offsets without a height array.
2026-12-05 04:50:25 +09:00
DarkSky f150cb5604 fix(mobile,hosts): fix keyboard insets, native selection UI, and lifecycle retries
The shell padded the bottom edge by the keyboard height, and the embedded
page editor lifted its keyboard toolbar by the same height again. In Page
mode the editor now owns the bottom edge. The shell gives the editor its
resolved keyboard height, so the toolbar sits directly on the keyboard.

- Hide the TabBar while the software keyboard is up, as 0.27.5 AppTabs
  does. The accessibility tree follows the same rule.
- Move the focus from the editor to the shell when an overlay sheet opens
  over a page, so the keyboard goes down. The drawer keeps its own focus.
- Add NativeSelectionUi to MobileShellView. The iOS shell lets
  UITextInteraction draw the handles, caret, and selection. The Android
  shell draws the handles natively and keeps the GPU caret.
- Scroll a long Search query or drawer filter only as far as necessary to
  keep the caret or the end of the composition in view. The renderer, the
  scroll, and the IME rects and touch offsets read one shaped layout of
  the line, and place it in the field with one transform. A line that fits
  sits at the start edge of the locale, and its glyphs always run left to
  right in text order, also in RTL locales.
- Retry the Android bootstrap from onResume and onNewIntent while the
  allowlist is empty or the shell has not mounted the workspace that
  bootstrap opened. Stop after three automatic retries.
- Send accessibility events only while an accessibility service runs.
  The system clears the focus after the last service stops, and the
  event send threw at that time.
2026-12-05 04:10:13 +09:00
DarkSky 053180699a fix(editor): restore page block shortcuts, horizontal format bar, and narrow More creation items
Restore page drag-handle clicks to select whole blocks with the standard
horizontal FormatToolbar, remove the custom vertical block menu and deprecated
Toggle List creation entry, dedent blocks on Mod+Backspace instead of deleting
them, add Mod+Shift+L/E/R text alignment and Mod+Alt/Shift+Up/Down block move
shortcuts using the document-order start block across forward and reverse
selections, and include Create Table and Create Linked Doc in the narrow
FormatToolbar More menu.
2026-12-05 04:01:00 +09:00
DarkSky 61644812f5 fix(desktop): preserve markdown block-prefix escapes, trailing breaks, and validate AVIF boxes
Escape literal dollar signs and break tags in Markdown text, encode trailing
block line breaks as explicit break tags for lossless roundtrips alongside
inline and block equations, and validate full ISO BMFF ftyp, meta, and mdat
boxes before embedding AVIF images in visual exports.
2026-12-05 03:53:42 +09:00
DarkSky 2e383e1127 ci(np): trim headless harness build and align desktop export and search
Build only bs-harness and touch_dispatch in the headless Linux render step.
Expand the WebAssembly Data snapshot prefix check from 226 to 248 prefixes.
Extract ExportIcon, ExportToHtmlIcon, ExportToPngIcon, ExportToMarkdownIcon, ImportIcon, and PrinterIcon from @blocksuite/icons.
Use the official export icons in the header export menu and hide Export to PDF by default.
Remove document count labels and modifier split routing from Quick Search tag and collection rows.
2026-12-05 03:23:04 +09:00
DarkSky 214e1b53b3 perf(desktop): cache database backlink rows and align the rows with Web
Keep the sorted database backlink rows of a document between frames.
Build them again only when the link graph, the document metadata, a linked source document, or the template flags change.
Read the cells of a row only when the row is open, once for each revision of its document.
Keep the local time zone of the date cells between frames.

Read the template flags with a lock attempt that does not wait.
When another thread holds the session directory, keep the previous rows of the same document.
Read the flags again on the next frame.
Read only the isTemplate field of each parent document.

Sort database and column names with a key that follows localeCompare for Latin text.
Make the parent document link a tab stop that Enter and Space open.
Give the name column of each cell the Web size: 160 px wide, 30 px high, with 4 px padding.
Show the collapse icon at 20 px with the Web primary and secondary icon colors.
2026-12-05 03:13:42 +09:00
DarkSky df91604a2e feat(editor,desktop): edit table text and reorder inspector items
Format text selections in table cells. Keep selections inside paired characters.
Reorder frames and headings in the inspector. Edit frame titles in place.
2026-12-05 03:07:12 +09:00
DarkSky 96709cab51 feat(desktop): add sidebar doc drops and linked doc rows
A doc row that you drag from any sidebar section onto an organize folder
adds a link to that doc in the folder. If the folder already has a link
to that doc, the drop moves the link. A drop on an organize row still
moves that row.

A doc row that you drop on a tag row adds the tag to the doc. The tag
change is idempotent and stays after the workspace opens again.

Escape, or a release outside the sidebar, cancels the drag and writes
nothing.

Doc rows that link to other docs now expand to show the linked docs.
Rows start collapsed. The expansion state uses the full row path, and a
doc that is already an ancestor in the path does not show again. "Add
linked doc" expands the parent row.

The "show linked docs in sidebar" setting is on by default and Web
Desktop keeps it in localStorage. When the setting is off, doc rows
show no arrow and no linked docs.
2026-12-05 02:36:07 +09:00
DarkSky cacab32acd fix(database): preserve clipboard cells and select labels
Write empty text to the Web clipboard. Quote empty cells in single-column TSV rows.

Match pasted select options by their labels. Add missing options and write cells in one undo step.
2026-12-05 02:19:08 +09:00
DarkSky 9afd009dea feat(desktop): add official property and visibility menu icons
Extract FileIcon, HistoryIcon, and ViewIcon from @blocksuite/icons into packages/ui/tokens.

Show the matching Web icon on each built-in property row in the inspector and page information dialog.
Align built-in and custom row icons with the 160px name column, 6px gap, and 16px secondary icon style.

Use ViewIcon and InvisibleIcon in the visibility menu, and show DoneIcon next to the active option.
Add parity assertions for built-in row icons and visibility menu icons.
2026-12-05 02:00:33 +09:00
DarkSky 7605b96e7b feat(hosts): mount MobileShellView in iOS and Android native runtimes
The iOS and Android hosts now start on the mobile product shell (Home,
Explorer, Journals, Search, Settings, and the Page route) instead of one
bare page editor.

- Add a runtime root that is a bare PlaygroundView or a MobileShellView.
  Editor calls go to the root editor, or to the shell's embedded page
  editor while the Page route shows with no sheet or drawer above it.
  Otherwise the focused shell input handler (Search or the drawer
  filter) takes UITextInput and InputConnection text.
- Send every shell touch to Rust outside the page editor, and ask for
  the software keyboard when a touch focuses a shell text field.
- Let the page editor close its overlay on back first, then run
  MobileBackCoordinator. A tab other than Home steps back to Home
  before the app exits.
- Mount the local workspace that bootstrap opened through
  SqliteWorkspaceStore and MobileWorkspaceBridge on every bootstrap
  path. The mount reads only the root document and db tables, and each
  page loads when the shell opens it. A failed load retries the next
  time the shell shows the page.
- Commit shell edits every second on the scheduler clock, and again
  when the app goes to the background. A commit without pending
  changes does no SQLite access.
- Drop text and composition edits while a sheet covers the shell,
  except in the drawer once its filter holds focus.
- Follow the system dark mode while the app runs, and publish the
  shell accessibility tree as Android virtual views with stable IDs
  and accessibility focus.
- Read the allowlist again on a retried Android bootstrap while no
  shell workspace is mounted.
- Keep the bare editor C ABI and JNI entry points for editor tests.
- Add Rust, Swift, and Kotlin tests for routes, IME, Search, sheets,
  back, lazy page loads, autosave, and a SQLite reopen.
2026-12-05 01:38:56 +09:00