Skip to content

fix(native): honor typed vlist props and read-only edits - #402

Merged
tiensonqin merged 1 commit into
mainfrom
logseq/native-readonly-vlist-props-7a1a
Nov 20, 2026
Merged

tiensonqin merged 1 commit into
mainfrom
logseq/native-readonly-vlist-props-7a1a

Conversation

@tiensonqin

@tiensonqin tiensonqin commented Nov 20, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

Closes the two critical native-backend protocol gaps found in review:

  1. Typed virtual-list props — Lui_layout now reads wire overscan / item-extent, with legacy data-overscan / data-item-extent as fallback (typed wins).
  2. read-only text controls — Lui_text_input.accepts_edits gates insert, delete, paste, cut-deletion, undo and IME composition/commit; focus, selection, copy and caret navigation remain available.

Also restores the native prop_coverage gate (including the newly admitted wire props), marks overscan / item-extent / read-only in store dirty masks, and fixes Lui_native_bridge.register to take a rank-2 { register_named } record so the shared library typechecks on OCaml 5.2.

Test plan

  • dune exec platform/native/lui_layout/test/lui_layout_test.exe (includes vlist typed props)
  • dune exec platform/native/lui_input/test/lui_input_test.exe (includes read-only)
  • dune exec platform/native/lui_paint/test/lui_paint_test.exe (coverage gate restored)
  • dune exec platform/native/lui_window/test/lui_window_test.exe (includes clipboard read-only)
  • CI on macOS/Linux native suites
Open in Web Open in Cursor 

Devin Review

Native layout now reads overscan/item-extent with legacy data-attrs
fallback, and text input rejects edits on read-only fields while
keeping focus, selection, copy and navigation. Restore prop coverage
inventory and fix Lui_native_bridge registrar polymorphism so the
shared library typechecks.

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 1 potential issue.

Devin Review

Comment on lines +334 to +340
let reject_edit =
match ev with
| `Editing _ | `Commit _ ->
st.node <> 0 && not (accepts_edits store st.node)
| `Focus _ | `Caret _ -> false
in
if reject_edit then (st, [])

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.

🔍 Read-only transitions retain active composition

When read-only activates during composition, feed_ime discards commits and cancellation reports without clearing marked text. Ui.handle suppresses keyboard handling while composition remains active. Existing tests cover initially read-only fields, leaving this reactive transition untested.

Devin Review


Was this helpful? React with 👍 or 👎 to provide feedback.

@tiensonqin
tiensonqin merged commit 0e948c5 into main Nov 20, 2026
9 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