Files
AFFiNE/packages/ui/kit/AGENTS.md
T
DarkSky 8e0b345036 feat(editor): extract ui-tokens, ui-kit, and blocksuite-editor crates
Add the zero-dependency ui-tokens crate to export generated theme tokens,
icon definitions, and bundled font bytes without cross-tree include_bytes!
paths.

Add the domain-neutral ui-kit crate with logical geometry helpers, SafeArea,
VirtualList, SwipeDialog, and SwipeMenu state machines backed by scheduler
time and four-rate replay invariance tests.

Extract blocksuite-editor from playground with the WorkspaceDocDirectory
host port, exact substring UTF-16 highlight matching, and LTR/RTL logical
start/end block flow layout. Slim playground to the demo and harness host.
Update workspace manifests, static invariant guards, CI workflows, and
AGENTS.md files.
2026-11-27 06:55:47 +09:00

904 B

Working in packages/ui/kit/ (for agents)

packages/ui/kit/ holds the domain-neutral cross-platform component library (ui-kit) inside the client workspace at packages/frontend/Cargo.toml.

Invariants

  • Depend only on ui and ui-tokens (ALLOWED_DEPS["packages/ui/kit"] = {"packages/ui/tokens", "packages/ui/ui"}).
  • Keep packages/ui/kit/ free of editor or product domain names.
  • Keep #![forbid(unsafe_code)] in src/lib.rs and keep each .rs file at or below 800 non-test lines.
  • Use logical geometry (LogicalEdges, LogicalStyled, Edges::from_logical, inline_start, and inline_end) instead of physical left/right layout helpers (.left(, .right(, .pl(, .pr(, .ml(, .mr(, .border_l(, .border_r().
  • Drive every transition from closed-form scheduler time (ui::Motion and ui::MotionCurve). Never read wall clocks or run frame-by-frame recurrence loops.