Row click replaces ViewEdit icons
The list-view Actions column (👁 view / ✏️ edit icon links) goes away: clicking anywhere in a row opens the read-only View form, and the View form gains an Edit button — hidden, not disabled, when the record's own update flag is false (house visibility rule; rollups and read-only viewers get no button). Editing becomes view → Edit, the accepted Gmail trade. Row click, not first-cell click (first cells can be images / NULL / interactive — no reliable target or link styling there). Interactive descendants disarm at one guard in the row handler (closest('a, button, input, select, textarea, label, [data-no-row-click]'); lightbox thumbnails carry the marker). Affordance is hover: row tint + pointer cursor. Text-selection drag does not open (getSelection guard). Delete ✕ column unchanged in behavior, re-gated per row.
Amended 2026-10-24: the item grows a backend arm — per-record update / delete flags in the /api/list records and the /api/item record, computed from the row's own resource (batched, one join per page). This closes the wire gap the row-only be-update / be-action gates (DONE "Type-level check on row writes") opened: a creator with create but no type-level update can edit rows their exclusive role sits on, but the type-level update flag hid the Edit control from them — and the blog surface's creator-edit recipe makes that user central. The ✕ cell gates on the row's delete flag (same rule, be-delete was always row-only); Add keeps the envelope create (no row exists yet). A reserved-field-name compile guard keeps author fields named update / :delete off the wire keys.
Notes: view-link-notes.org
Plan: row-click-replaces-viewedit-icons-plan.org
Implemented per the plan end to end:
- Backend (
lisp/backend.lisp):permitted-row-ids(the batched set question behinduser-allowed-resource's per-id ask —a:list-user-resourcesfiltered to the type'sresource_nameprefix, theuser-read-type-idsprecedent, consumed past the library's pagination: pages repeat (role × resource) rows, so the stop condition is distinct ids reachinga:user-resource-count's count with the same filters, empty page as the belt. The plan'sresource_id INfilter idea is not implementable — the library's filter grammar has noinoperator, only thelikefamily — so the prefix filter is the page-batched form);row-capabilities(two alists,:update/:delete, every record id a key; base types degenerate throughuser-allowed-resource's one live arm; model-capability truthiness non-nil = granted, nil forces:falsewith no query — the rollup answer);record-capability(:false-on-miss);decorate-records-with-caps(plainappend, neveradd-to-plist—:falsewould read as unspecified and the key would silently never land). Emission:list-result's:recordswrapped indecorate-records-with-caps(both base and measure branches route through it — measure records carry:falseflags with no query);be-recdecorates its return's:recordwhilerecstays clean (be-update's resource-rename path feeds that plist tovalid-data, which rejects unknown keys; live-probed: alice'sbe-updateon her note still succeeds with the flags ridingbe-reconly). - Compiler (
lisp/model.lisp):valid-field-names— author field keys:update/:deleteare compile errors naming the wire collision; called fromcompile-base-type-defon the raw author:fields(beforeadd-default-fields, so a guard placed there could not tell an author key from an injected one) and fromvalid-rollup-fieldsbeside the existing:idrejection. - Frontend (
web/src/App.tsx,index.css):INTERACTIVE_SELECTORat module scope;handleRowClick(selection guard first, thenclosest) andhandleRowKeyDown(Enter only, Space keeps scrolling; same disarm guard — keydown bubbles like click) besidecloseForm; the<tr>gainsclassName'row-click'= /tabIndex/role"button"= /aria-labeland both handlers under onehasViewFormconditional per attribute; the Actions<th>+<td>block deleted (icons, comment block, both gates);ThumbnailGrid's thumbnail div carriesdata-no-row-click=;RecordCapsinterface + the View form's Edit button in the top cluster (editRecord?.update ==true=, hidden not disabled;marginLeftternary collapsed to a constant);anyDeletablehoisted beside the table (records.some(r => r.delete ==true)=) gating the ✕<th>and every<td>(cell always renders on a mixed page — column-count invariant; the ✕ checkbox inside gates on the row's owndelete); settings auto-open readsrecords[0]?.update; "Delete Selected" stays on the envelope flag on purpose. Envelope-flag census after the change:create→ Add only,delete→ Delete Selected only,update→ no readers.tr.row-clickable/:hoverrules inindex.css(--hover-bgis theme-aware). Build clean (354.08 kB). - Tests:
tests/row-write-tests.lispextended (33 checks total, +17: per-row list flags via a role-readable note bob can read,be-recflags +recclean +be-updateround-trip, model-gate probe, reserved-name compile errors); two pre-existing shape assertions updated for the new trailing keys (tests/view-form-tests.lispu:plist-keyslists gain:update :delete;tests/measure-rollup-tests.lispmrb-rows-are-field-key-plistslikewise). - Docs:
docs/rest.md(/api/listper-record-flags paragraph incl. the/api/columnsingle-field-projection note;/api/itemsentence),docs/model-reference.md(type-key table row +:view-formspecifics rewrite),docs/demos.md(chores walkthrough step 1). - Full suite via
scripts/data-ui tests: 2222 checks, 43 groups, all passed. Live probes: alice (creator, no type update) reads:true/:trueon her note; bob reads:false/:falseon the same row; base-type degeneration matches the envelope (admin:usersrowstrue; guest settings =nil → false); envelope flags unchanged for both users.
- Slot
- 3300
- Status
- 60 Done
- Tags
- mvp, backend, frontend, polish
- Contributors
- Donnie, Rose, Grok
- Plans
- Row click replaces View/Edit icons — implementation plan (2), Row click replaces View/Edit icons — implementation plan (3), Row click replaces View/Edit icons — implementation plan