Commit Graph
30 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 75e8e4bdd2 fix(desktop,editor): polish shortcuts and controls 2026-12-05 10:42:23 +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 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 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 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 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 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 aed2556c4b perf(desktop): read sparse custom property rows
Scan each row for fields with a current property definition.
Keep a weak reference to the directory so it drops with the session.
2026-12-05 00:37:35 +09:00
DarkSky 741ba29652 perf(desktop): cache inspector property rows and backlinks by revision
The inspector read every custom property row and scanned every document
for backlinks on each frame. Keep both reads in the panel state until a
revision that they use changes:

- Rows: the workspace, the connected session, the metadata revision, and
  the revisions of the definition and value tables. A table write without
  a metadata change, such as a remote update, also rebuilds the rows.

- Backlinks: the workspace, the metadata revision, and the link index
  updates. The panel keeps the ordered document ids and reads only the
  documents of the visible rows.

Give built-in and custom property rows the Web name column: 160 px wide,
4 px gap and cell padding, and a value that wraps below a long name. Use
the Number and DateTime icons for the number and date property types.
2026-12-04 23:40:23 +09:00
DarkSky 84fa64fd2d feat(collection): match custom property filters
Saved collections and the rule preview now match workspace custom
properties of the text, number, checkbox, and date types. The rules are the
same as the property filters of the web client.

- An unknown or deleted property, a type without filters, or a method that
  does not apply to the type is an error, as in the web client.

- Compare numbers as JavaScript Number does. A document without a value is
  NaN, so no number comparison matches it.

- All filter scopes share one source of custom properties. A filter reads
  the property type and the value from it when it matches a document.

- The document views, the sidebar rows, the saved collections, and the
  preview read the property tables again when their revisions change. A
  change that no store command made also shows at once. Only a filter by a
  custom property causes a read of the property tables.

- Add YjsTableDoc::for_each_row. It reads only the fields that the caller
  asks for, so other fields of a row cause no copies.
2026-12-04 23:17:18 +09:00
DarkSky 969f0c690e fix(desktop): share the delete confirmation modal
Use one modal for the header, explorer, and Trash. Use the web panel
and button colors. Show a one-pixel focus ring around each control.
Keep the footer visible when the text scrolls.
2026-12-04 20:06:25 +09:00
DarkSky 1b4ccaee59 perf(desktop): keep frame thumbnail layouts and paint canvas blocks
The frame panel keeps one canvas state for each document. An edit lays
out only the blocks that it changes. The panel starts a new canvas when
the document, theme, scale factor, layout direction, fonts, store
metadata or editor media revisions change.

The store metadata revision is the revision that the document directory
reads. A text edit in the pane editor does not change it, so the panel
keeps the canvas for that edit.

Thumbnails get page titles, decoded images, PDF previews and the
document directory from the pane editor through a read-only preview
entry. The preview does not use the editor selection, preedit, camera
or local folds.

Frame thumbnails paint image, bookmark, attachment and embed blocks
with the same painter as the canvas.

The Presentation button uses the white token as its background. The
inspector tabs use the web order: Properties, Journal, Outline, Frame.
2026-12-04 18:27:27 +09:00
DarkSky fd4e513b7f fix(desktop): match the web header delete confirmation 2026-12-04 16:42:43 +09:00
DarkSky dd0c99b94b perf(desktop): share explorer row keys by view revision
Cache the document order and row keys for each explorer view revision.
Keep the Trash row key vector when the scroll view takes ownership.
Take the new shared row keys when their contents match the current layout.
2026-12-04 12:34:18 +09:00
DarkSky 5847596825 fix(desktop): align explorer trash confirmation with confirm modal
The explorer Delete doc? confirmation uses the confirm modal layout
of the Trash confirmation. The card is 440 px wide. The body scrolls
in short windows. The actions align right and show a focus ring.

The confirmation opens with the focus on Delete.
In a read-only workspace, it opens with the focus on Cancel.
Tab and Shift+Tab move between the two buttons.
Enter and Space press the focused button once.
Escape cancels and gives the focus back to the opener.
2026-12-04 11:51:30 +09:00
DarkSky 581bc4c4c3 fix(desktop): match the web share button and the storage and about settings pages
The top bar share button now uses the geometry of the web primary button:
an 8px radius, 12px medium text and a 16px icon. Icon buttons keep their
4px radius.

The storage page no longer shows a document count. It shows one storage
panel for the active workspace. The panel states what saves the changes of
that workspace:

- A read-only SQLite backup saves nothing.
- A connected session saves the changes on this device and syncs them
  with its server.
- A local session writer, such as the IndexedDB store of Web Desktop, saves
  the changes on this device only.
- Without a session writer, the changes stay in memory.

For a connected session, the panel does not say that a sync completed and
does not name the server.

The workspace kind and sync flag of the showcase data do not change the
panel, because they do not tell what saves the workspace.

The about page shows the app version and the editor version in separate
rows, as the web page does. The desktop build version stays as a
diagnostic row.
2026-12-04 11:06:27 +09:00
DarkSky 49f4e53cac feat(desktop): add sidebar section menus, empty states, and new-tab routing
Align AppSidebar section headers, row menus, and Web new-tab navigation
with AFFiNE 0.27.5:

- Add Favorites, Organize, Tags, Collections, and Others empty-state
  prompts and inline creation actions, plus right-click and three-dot
  menus across non-active document, tag, collection, and folder rows.
- Open document, tag, and collection "Open in new tab" actions as real
  browser tabs on Web Desktop (/desktop/?workspace=...&doc|tag|collection=...)
  and persist tag/collection view routes across reloads via SavedView
  and start.js URL sync.
2026-12-04 10:26:10 +09:00
DarkSky c0de995075 fix(desktop): restore keyboard control in the Trash confirmation
Keep keyboard focus in the confirmation and return it to the trigger on cancel.
Keep the buttons visible as the message scrolls in short windows.
Use the Web tooltip colors and dimensions for Trash and Center Peek.
2026-12-04 09:27:11 +09:00
DarkSky 9a23ae7513 fix(desktop): Keep the sidebar resize line visible during drag 2026-12-04 06:09:28 +09:00
DarkSky 9864df9d5f fix(desktop): Match Web resize handles
Show the same line and shadow on split dividers during hover and drag.
Use the sidebar accent token for the fixed and floating resize handles.
2026-12-04 05:13:44 +09:00
DarkSky 46c44feba2 fix(desktop): Match Web settings navigation and font slider 2026-12-04 04:32:24 +09:00
DarkSky 8da16f102f perf(desktop): read explorer tag names in place and align topbar chrome
Explorer row keys now read tag names from the shared document views
without a copy. Each frame of the docs explorer built a new string for
each tag of each document. With 1,024 documents and 4 tags each, one
frame now makes 4,182 fewer allocations (11,524 to 7,342).

Topbar and explorer icon buttons use the 4px radius and the hover
overlay of the web IconButton. The explorer row menu uses the vertical
"more" icon. The active app tab has a 1px innerBlackBorder ring outside
its bounds. A three-pane divider draws a 3px line in the primary button
color with a 15% soft glow (0 12px 21px 4px) on hover and while it
resizes.

Topbar, tab, menu and divider controls take numeric element IDs, and
their snapshot IDs build only in harness builds. An app tab keeps its
element ID by tab ID, so its state follows the tab when tabs before it
close.
2026-12-04 03:33:15 +09:00
DarkSky c24c39301f feat(desktop): apply editor fonts and stage presentations
Apply the editor font settings to split panes and Center Peek.
Save the font settings on Web Desktop and load the serif font assets.

Give full screen presentations the desktop viewport.
Restore the workbench when the presentation or its document changes.

Show tag names in the workbench. Skip writes for an in-place folder drop.
2026-12-03 23:42:07 +09:00
DarkSky 0e9f8933ab fix(desktop): match Web radio groups and hover colors
The Page width property used the Settings segmented control. Its dark
selected fill and track had almost the same color. Settings also changed
the shared palette with fixed colors.

Changes:
- Render the Page width property as the Web PropertyRadioGroup: a 194 px
  track, 20 px options, regular text, and 4 px gap.

- Paint the Settings choices and the property group with the switch
  theme tokens. A selected option uses the active color and shadow.

- An unselected option that you can change uses the switch hover color.
  A read-only option does not change on hover.

- Keep a 24 px hit target for each option. The option pill stays in the
  track padding.

- Remove the fixed Settings palette colors. Settings secondary text uses
  the secondary text token.

- Use the layer hover overlay on the Settings close button and on the
  inspector link rows.
2026-12-03 20:23:52 +09:00
DarkSky faa28f603b fix(desktop): match explorer card and sidebar hover styles 2026-12-03 18:51:22 +09:00
DarkSky 07108eab54 fix(desktop): use shared icons and hover colors
Use BlockSuite icons in the desktop shell. Apply the menu hover color to menu items and toolbar buttons. Apply the list hover color to document rows.
2026-12-03 16:50:17 +09:00
DarkSky 16c509a356 test(desktop): verify document persistence after reload
Wait for title focus before the browser enters text. Read the stored
document mode, title, and paragraph from the V1 updates. Check the
browser click positions against the desktop layout.
2026-12-03 09:45:02 +09:00