Skip to content

Refactor editor: new look, menus and block editing - #12

Merged
ljm12914 merged 1 commit into
mainfrom
refactor/components
Nov 21, 2026
Merged

ljm12914 merged 1 commit into
mainfrom
refactor/components

Conversation

@ljm12914

Copy link
Copy Markdown
Member

Rebuilds the page editor on the UI tokens and base components and adds the block editing features.

Look and menus

  • Editor, page top and properties panel use the UI tokens and base components; every editor menu is a base menu (Ctrl+/ opens the block menu).
  • Page actions moved to the tab bar's menu; the properties toggle (Ctrl+Alt+P) is a tab parameter; backlinks sit under the title.
  • Pickers use a virtualized list shared with the search panel; pages.blockList returns a page's blocks and reference titles in one call.
  • IME composing keys reach the editor and inputs; menus skip them (bits-ui 2.19.2 is patched for Esc — re-check on upgrade).
  • Clicking anywhere in a page's blank area places the caret; global styles load in a base cascade layer, so the editor has no focus outline.
  • The quote block is called 引言 in Chinese.

Editing features

  • Slash menu, typed block shortcuts (#, -, 1., >, three backticks, ---) and [[ for inline references.
  • Drag blocks by the handle, with one drop line per gap and a translucent preview.
  • Rubber-band and multi-block selection with delete, copy, cut, indent, move and the block menu.
  • Fold triangle and Ctrl+Enter.
  • Code blocks: a language payload field, highlighting in a worker (CodeMirror stream parsers, MIT), language picker (Ctrl+Alt+L) and a copy button.

Performance

  • The first page read fetches attribute definitions and backlinks together, so a 10,000-block page is laid out once: opening takes 205 ms (285 ms before).

Checks run locally: typecheck, lint (0 errors), knip, db:check, test:db (5+245), test:feed (45), pnpm perf.

🤖 Generated with Claude Code

- Editor, page top and properties panel use the UI tokens and base
  components; all editor menus are base menus (Ctrl+/ block menu),
  page actions moved to the tab bar, backlinks sit under the title,
  and editor text is in the locales.
- Pickers use a virtualized list shared with the search panel; one
  pages.blockList call returns a page's blocks and reference titles.
- Composing keys reach the editor and inputs; menus skip them (bits-ui
  patched for Esc).
- Clicking anywhere in the page's blank area places the caret; no
  focus outline on the document; global styles load in a base layer.
- New editing features: slash menu, typed block shortcuts and [[,
  dragging blocks by the handle with a drop line and preview,
  rubber-band and multi-block selection, fold triangle (Ctrl+Enter),
  code blocks with a language field, syntax highlighting in a worker
  and a copy button.
- The first page read fetches attribute definitions and backlinks
  together so a large page is laid out once.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@ljm12914
ljm12914 merged commit 856269d into main Nov 21, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant