Skip to content

Implement ADR 0008 typed API ergonomics and safety hardening - #400

Merged
tiensonqin merged 2 commits into
mainfrom
logseq/adr-0008-implementation-3f2a
Nov 20, 2026
Merged

tiensonqin merged 2 commits into
mainfrom
logseq/adr-0008-implementation-3f2a

Conversation

@tiensonqin

@tiensonqin tiensonqin commented Nov 20, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

Implements all four phases of ADR 0008 on top of the merged ADR text.

Phase 1 — Safety, PPX façade parity, reactive diffs

  • Capability-indexed Slot_style (make / typography / text_flow / collision) with compile-time admission; removed the style exemption from component_schema_test.mjs.
  • PPX resolves Lui.Elements, Lui.Ui, Lui.Raw, and all Slot_style builders through façade aliases.
  • Diff-aware popover / dropdown_menu / split target and sizing updates; text applies slot style before truncate recipes.
  • Protocol clamps non-finite/negative numeric props; JSON enum decoders return None with diagnostics.

Phase 2 — keyed_range

  • Unchanged-order fast path, direct positional inserts, Fenwick-tree weighted LIS minimal moves, and scoped rollback (no parent-wide subtree checkpoint).

Phase 3 — Polymorphic 'kind el

  • Unified slot phantoms; uniform if_ / keyed / scoped / dyn inside restricted parents.
  • dropdown_menu migrates to ?target:dropdown_target; menu / submenu / popover gain capability-checked ?style.

Phase 4 — Clean Lui.Ui

  • New src/lui_ui_composites.mli with no include Lui_ui.
  • form_section / data_list take list_section_item_el list via form_row / data_row.
  • Symmetric form_sheet ~confirm_disabled / ~confirm_disabled_signal.
  • Platform-adaptive Tokens.space_value_for.

Migration notes are in docs/api-migrations.md; ADR status is implemented.

Follow-up

  • Nested JSON submenu / toolbar_menu builders now forward Slot_style.surface_caps (Devin review).

Verification

  • opam exec -- dune build @all
  • opam exec -- dune build @web
  • make test-ocaml / dune runtest test/ (297/297)
  • node --test --test-concurrency=1 tooling/test/{component_schema,ppx-hygiene,menu-item-style,surface-toolbar-style}.test.mjs (25/25)
  • npm --prefix platform/web run check (173/173)
Open in Web Open in Cursor 

Devin Review

Ship all four ADR phases: capability-indexed Slot_style with compile-time
admission, polymorphic 'kind el with uniform reactive/if_/keyed combinators,
diff-aware popover/dropdown/split updates, keyed_range performance and scoped
rollback, protocol numeric clamping, clean Lui.Ui Tier-1 .mli with dynamic-safe
form_section/data_list, and platform-adaptive Tokens spacing.

Co-authored-by: Tienson Qin <tiensonqin@gmail.com>
devin-ai-integration[bot]

This comment was marked as resolved.

Pass Slot_style.surface_caps through build_dropdown_menu_submenu and
build_toolbar_menu so collision-padding and other surface props reach the
inner dropdown_menu, matching top-level menu/submenu JSON dispatch.

Co-authored-by: Tienson Qin <tiensonqin@gmail.com>

@devin-ai-integration devin-ai-integration Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Devin Review found 0 new potential issues.

Devin Review

@tiensonqin
tiensonqin merged commit 87fcf6a into main Nov 20, 2026
10 checks 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.

2 participants