feat(plugins): read-only form fields and table row interactions (#2013)

API 1.3 through the released `other` extension cases, no WIT change: form fields `label` (plain value) and `readonly-text` (selectable, optionally multi-line, drawn as read-only), and table view-events `table-select` / `table-activate` (click, Space; double-click, Enter) with absolute row indices. Table rows also get the view's `viewItem.context` commands, keyed by row. SDK: `FieldValue::label`, `FieldValue::readonly_text`, `ViewEvent::table_select` / `table_activate`. Closes #1953.

Co-authored-by: arnaud-ritti <[email protected]>
Цей коміт міститься в:
Arnaud Ritti authored and GitHub committed 2026-11-07 23:36:59 +08:00
1 джерело 1891119f9d
коміт dc69c36604
39 files changed
+502 -41

No files matched your search

+20
Переглянути файл
@@ -639,6 +639,26 @@ For a table the user can sort by clicking a header, build it with
column headers clickable and asks for a column and direction with
`ViewEvent::sort()` — sort your rows and render again; the sort you report
shows as an arrow in the header.
API 1.3 adds read-only form values without changing the released field record:
`FieldValue::label(text)` uses `other { kind: "label", data }`, where `data`
is a JSON string. `FieldValue::readonly_text(text, multiline)` uses kind
`readonly-text` with JSON `{ "text": "…", "multiline": false }` (the flag
defaults to false). Labels render as plain selectable values; read-only text
keeps the single-line or multiline text control and never sends field events.
Table row clicks and Space send `other` kind `table-select`; double-click
and Enter send `table-activate`, both with JSON `{ "row": 0 }`.
`ViewEvent::table_select()` and `table_activate()` decode the absolute,
zero-based index, including `first_row` for paged tables. These work for both
plain tables and the same `other` table shape used by sortable tables above;
no new table shape is needed. Editable cells still double-click to edit;
activate their row with Enter on the focused row or double-click its row number.
`viewItem.context` menus also work on table rows: the command argument and
`viewItem` context key are the decimal row index, e.g. `"0"`. Editable tables
keep their insert/delete entries alongside contributed commands. After sorting
or changing data, plugins resolve row indices against their current row order.
Declare `engines.openidea = "^1.3"` when relying on these additions.
Bodies, field types and view events added by later APIs travel as `Other {
kind, data }`: an IDE that doesn't know a body says it needs updating, and
leaves out a field type it doesn't know.
+1 -1
Переглянути файл
@@ -1 +1 @@
d46e07036f0f59c18ca54affbca6446c320476998f3e92199cd93ed43dd725d9
abd041ece9d10d591c377e1a432dc83d0bf4240f502bb62f8c1d1876585f2d9c
+1 -1
Переглянути файл
@@ -1 +1 @@
c28b0da5a21fc0fc5dd543d01eaeeed4f7bbd89a5d28b95ce911a1c092209adc
7e6d23a7ac4da5429c453ec33dae8ce4e19ca87114a741b289cd4041b05fb59f
Бінарний файл не відображається.
+1 -1
Переглянути файл
@@ -1 +1 @@
f4258172c7a8278d00f5da9d76420380200d8b0d8bc387ceafab30703cbdac4a
d63205db552dfd0d48c6834e662e7423481bc0d54b4a66755bae20ba085d5c99
+1 -1
Переглянути файл
@@ -1 +1 @@
648b030335ecfdf82651561fc5e71edc9f9d4319ae4bfb56d1e6d7e1f029d781
2ef0482dce9edcf0bb0e8e13e5df7fd1fe735832d8091dbe4603f49bb01dd22a
+1 -1
Переглянути файл
@@ -1 +1 @@
f7bbe6097f18377a79f39ba2369140e24eff65501e78be94e3420c6667362743
4a1788b4a53f87cfe921f70102d76d6bc31668fbc3f993d81d60f8d2c92143bb
+1 -1
Переглянути файл
@@ -1 +1 @@
936d6e2c74f87cc1d95c52ea674716d934df917c12fb8431989f8dc64989b174
d2992f8f58b131ba05e70262d4c825f61449c3b45f6c9543eb90f27bf8ef8748
+1 -1
Переглянути файл
@@ -1 +1 @@
182af35d880a9adfa2566a42b62db6cf69f7d2a5157e0428228b649864e9417c
582fb1f8b6c24e54c70b1f6028cd4cdfed067482f4a4635d6e7720608bca3584
+1 -1
Переглянути файл
@@ -1 +1 @@
f750b060f9a4217da81395aaa9875811d61d087e8d7fef1a0d7b46e3d08cd4a8
3cfbfad0d9554cc7dad2e3255054e9a06f60f6e0745a99a608ef29143c93f42b
Бінарний файл не відображається.
+1 -1
Переглянути файл
@@ -1 +1 @@
4edc8aad4feb31205d567e303a18f9d0d4969bc65dc8f3699b46cd05b93d8868
2238f16cbfca44f1ab02768e733e37fa713c0ee817ef32e94d3c27d8c07bb09c
+1 -1
Переглянути файл
@@ -1 +1 @@
e1e58cd1ee112923dfc1debe86f8feb18c1a4e9f58490b5e371ee0272cad6ced
dff3656603212315d37e27a498e7090d494e0a52df20c4bd9541fb0c933aeb47
+1 -1
Переглянути файл
@@ -1 +1 @@
318e264055acfd1d10491dfea784fdb2a034d3b4da8f7583e81720e21ea1947c
8bb9095d0dae184aabbc8f2abfe9a3bf6c44ff97e73b7eda6f39d3504d040340