Repository navigation
fix(metadata-protocol): title a record-share search hit by its recipient, not the raw recipient id - #36523
Conversation
…ent its kind names Claude-Session: https://claude.ai/code/session_01ADHkmRB34k9WUWeGpRnVNm Co-authored-by: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01ADHkmRB34k9WUWeGpRnVNm Co-authored-by: Claude <noreply@anthropic.com>
📓 Docs Drift CheckThis PR changes 1 package(s): 13 hand-written doc(s) NAME something this change touched and may need an implementation-accuracy re-verification:
⛔ 8 release-owned page(s) also name something this change touched. These are read-only:
What this run could not see
Coarse fallback — 10 page(s) merely mention a changed package (the pre-#9192 predicate, kept for the deliberately-wide backstop): Which tree this was computed onThis run read A worktree cut from an older # while this PR is open — GitHub drops the merge commit once it closes
git fetch origin 6e8e38a638b360c3b53307fe5f68e491f215b173 && git checkout 6e8e38a638b360c3b53307fe5f68e491f215b173
# afterwards, rebuild it from the two parents, which stay fetchable
git fetch origin 316f7571617e0f22b260c457ec87692f5fc1ff5e e8b22f7fdf0add5fc29513625eeed3a7f7138578 && git checkout -B drift-repro 316f7571617e0f22b260c457ec87692f5fc1ff5e && git merge --no-ff e8b22f7fdf0add5fc29513625eeed3a7f7138578
node scripts/docs-audit/affected-docs.mjs --json 316f7571617e0f22b260c457ec87692f5fc1ff5e
|
|
repo:objectstack#2 · os-steve · session_01ADHkmRB34k9WUWeGpRnVNm 席位核对ACCEPT — PR #36523 @ e8b22f7 · card #35307 · L1 first read by area s2-B (area order rule 9) · 2026-11-22T18:00Z
|
… rating (objectstack-ai#36043) (objectstack-ai#36392) <!-- claude-projects-attribution: {"github_login":"zhuangjianguo"} --> _Requested by **Steedos** · [project thread](https://claude.ai/code/project/chan_018ETKaNwMZCNRYD7D8Q9Ubb?thread=cmsg_018ETKaNwMZCNRYD7D8Q9UbbCxiFE11rsKwyNffJZKYqJs)_ Fixes objectstack-ai#36043 repo:objectstack#7 · zhuangjianguo · session_01QsR2jTbWpneBrqq7SJvrNt Clause-②: yes (widening) Metadata-protocol: semantic Skills-docs: none — no skill names the inline grid column `type` values or keys (`git grep` of `skills/` for `inlineColumns` and the column type list: one passing mention in `objectstack-data/rules/relationships.md`, which lists no types) ## 维护者速读 - 表单里的明细表(主从表单的行项目表格)中,人员格子可以直接搜索选人,多选格子可以选多个选项,标签格子可以加标签,勾选格子是复选框,评分格子是星星;以前这些都是普通文本框,人员要手填用户编号,多选只能填一个值。 - 属于列表页重做专题的单元格编辑那一组,替在主从表单里录入明细行的用户解决「人员、多选填不进去」的问题。 - 已有表单的明细表会直接变样:布尔字段从「是/否」下拉变成复选框,评分字段从数字框变成星星;作者在列上明确写了类型的不受影响;出错时最坏是这几类格子不好用,已存的数据不受影响,可直接撤回。 - 无 ## What changes The card's words map onto the enum by the spec's existing rule that every column type is spelled as its namesake field type (the `inline-grid-column-carriers` probe and the `field.json` liveness note rely on it): people = `user`, multi-select = `multiselect`, tags = `tags`, check = `boolean`, rating = `rating`. **Spec (`packages/spec/src/data/field.zod.ts`).** `InlineGridColumnSchema.type` gains `user`, `multiselect`, `tags`, `boolean` and `rating` (nine → fourteen). The column gains one optional key, `max`: the star count of a `rating` cell (default 5), because a column carries no field definition and a `max: 10` rating would otherwise draw five stars. `options` and `multiple` describe what the new cells read from them. `inline-grid-columns.ts` (`deriveInlineGridColumns`' cell-type mirror) maps the same way, and each new cell type keeps the fill priority its field types had before, so which derived columns are visible by default does not change (the existing budget pins stay green unchanged). Liveness ledger: the `type` note lists fourteen types, and a `max` child row. Regenerated: reference docs, `authorable-surface/data.json` (one new key), liveness state counts. **Derivation (`ui/packages/plugin-form/src/deriveMasterDetail.ts`).** `fieldTypeToColumnType` maps `user` → `user`, `multiselect` / `checkboxes` → `multiselect`, `tags` → `tags`, `boolean` / `toggle` → `boolean`, `rating` → `rating`. A derived or hydrated column carries `multiple` from a multi-person field, `max` from a rating field, and the child's options on `multiselect` columns. A `tags` column takes no options: its cell holds free-form tags and reads no option list. A `boolean` column keeps the two options it carried as a select (`'true'` / `'false'`, labelled with the session's words through `booleanLabel`): they are the words its read-only and list-mode cells read as, so `booleanLabel` stays live. A column that declares its `type` is left alone, as before. **Cells (`ui/packages/fields/src/widgets/grid-field/GridFieldWidget.tsx`, `gridCellPanels.tsx`).** The cells reuse the main list's in-cell faces rather than forking them: - `GridPanelCell` (new, beside S5's `GridSelectCell`) is a panel shell under the cell that hosts a widget's own `inCell` face over a draft: a click outside or Tab writes the draft, Esc writes nothing, and a face that ends on one pick calls `commit`. The cell keeps drawing its value while the panel is open. - `multiselect` hosts `MultiSelectField inCell`, `tags` hosts `TagsField inCell`, and `user` hosts `UserField inCell` (the main list's person picker: searchable list, recents, Clear; a single pick writes and closes). - `boolean` is the `Checkbox` primitive (click / Space), writing `true` / `false`. - `rating` draws `RatingField inCell` (a click on a star sets it); a digit key on the cell sets that many stars, 0 clears, a digit above `max` does nothing. - Read-only table and list mode: people by name (`UserField readonly`), a rating as its stars, a multi-select's option labels, a check cell as its option word (else the session's yes/no word). - A required cell holding an empty list (multi-select, tags, several people) reads invalid, as an empty scalar does. - A multi-select, tags or several-people cell that is emptied writes `null`, not `[]`: the save path counts only `null` / `''` as blank (`isBlankRow`), and a cleared multi-value field stores `null` elsewhere too. An emptied cell reads `—`. Item 2 of the card (interim read-only columns) is not built: the seat reads it as superseded once item 1 ships, and this PR ships item 1. **Visible change on existing master-detail forms** (named in the changeset): a derived `boolean` / `toggle` column is a checkbox instead of the yes/no select and writes booleans instead of the strings `'true'` / `'false'` (the server's write normalisation reads both the same); a derived `rating` column is stars instead of a number box; `user`, `multiselect`, `checkboxes` and `tags` columns are no longer plain text boxes. ## Tests - `ui/packages/fields/src/widgets/GridField.test.tsx`, new top-level `describe` "the cells that edit as in the main list": multi-select (labels, several picks staged then written on leaving, Esc writes nothing, empty list reads invalid when required), tags (a new tag added from the list, Tab writes and moves to the next cell), check (checkbox over `true` and `'false'`, click writes a boolean, read-only reads the option word), rating (five stars by default, a click sets, digit keys set and 0 clears, a digit above the stars sets nothing, `max: 10` draws ten), people (the person picker opens under the cell; its Clear writes and closes). An emptied multi-select and an emptied tags cell each write `null` (both pins go red with the fix taken out), and the emptied tags cell reads `—`. - `ui/packages/plugin-form/src/deriveMasterDetail.test.ts`: the five mappings with their neighbours as controls; a new `describe` pinning the extras on both the derive and the hydrate path (`multiple`, options on a multi-select and none on a tags column, the check column's two words, `max` from the field and none when the field declares none), and that an authored column, a `type: 'select'` over a boolean field included, keeps its type and extras. - `deriveMasterDetail.booleanOptions-12924.test.tsx`: the derived boolean column is now `type: 'boolean'` with the same two session-language options; the editable grid pins read checkbox states instead of picker text; the language-switch pin now re-labels the read-only table (the editable check cell shows no word). - `MasterDetailForm.lateCatalogue-12924.test.tsx`: the late-catalogue re-label is read where the grid still draws a boolean's word, a second detail in `inlineMode: 'form'`; the editable `Lines` detail keeps the unsaved edit and its checkboxes through the catalogue landing. - `deriveMasterDetail.inlineGridColumns-11345.test.ts`: the "output unchanged" corpus moves its one derived boolean column (`gift`) from `select` to `boolean`, marked where it sits; nothing else in the corpus moves. ## Deviations Four files outside the claim's surface, each a direct consequence of the widening. Seat 7 counts them inside the card. - `packages/metadata-core/src/object-schema-fls-references.ts`: `INLINE_COLUMN_POSITIONS` classifies the new `max` key as `keep` (a number, never a field name). `object-schema-fls-references.test.ts` refuses an unclassified `InlineGridColumnSchema` key, so it was red in Test Core 3/10 at `10767ef3`. - `ui/packages/types/src/__tests__/strict-face-read-keys-11070.test.ts`: the refused-column-type row used `boolean`, which is now a cell type, so it moves to `toggle`, which is still refused. It was red in Test UI 12/16 at `10767ef3`. - `ui/packages/types/src/form.ts`: a docblock no longer counts "nine" cell controls. - `content/docs/data-modeling/field-types.mdx`: the inline grid bullets list the fourteen cell types and the checkbox booleans, and add the people, multi-select, tags and rating cells. The changeset adds `'@objectstack/metadata-core': patch` and `'@object-ui/types': patch` for the first two packages. ## Acceptance notes - A click outside a multi-select / tags / people panel writes through the popover's own dismiss (`onOpenChange`). The jsdom pins leave the panel through Tab, because that harness's pointer events do not reach the dismiss. The click outside is measured live below. ## Live click-through Showcase app (`objectstack dev --seed-admin`, fresh database) plus the Console from source (Vite), Chromium through Playwright. To host the three cells, the run added, without committing, `inlineEdit: 'grid'` and `inlineColumns` (`name`, `f_multiselect`, `f_tags`, `f_users`) to `showcase_field_zoo.f_master_detail`, and a `fieldGroups` entry placing that child on `showcase_project`. The edits were reverted afterwards. Project "Website Relaunch", Edit, row 0 of the zoo grid. "Outside" is a click on the dialog's "Edit Project" heading. | Step | Multi-select | Tags | People (multiple) | | --- | --- | --- | --- | | Stored before | `["red","green"]` | `["alpha","beta"]` | `null` | | Pick | Blue | type `gamma`, Enter | Dev Admin | | Panels open after the click outside | 0 | 0 | 0 | | Cell after the click outside | Red, Green, Blue | alpha, beta, gamma | Dev Admin | | Stored after Update | `["red","green","blue"]` | `["alpha","beta","gamma"]` | `["<Dev Admin's user id>"]` | | Cell after a page reload and Edit again | Red, Green, Blue | alpha, beta, gamma | Dev Admin | | Emptied, click outside, Update: cell / stored | — / `null` | — / `null` | not run | The run found one defect, fixed in `2197dbdd`: an emptied tags cell drew nothing instead of `—`. The display helper now reads an empty list as empty for every type. It is pinned in `GridField.test.tsx`, and the final row above was read with the fix served. - `rating` cells keep `RatingField`'s one button per star, so Tab visits each star; the arrows and digit keys work from any of them. ## Verification Final head `6185caed`. It adds three commits to `f73a4351`: - `6e74cfe0`: the review rework. Metadata-protocol is `semantic`; a `tags` column takes no options; an emptied multi-value cell writes `null`; the stale "twenty keys" and liveness prose is fixed. - `2197dbdd`: the emptied tags cell reads `—`, found by the live run. - A merge of `origin/main` at `07b17542` (objectstack-ai#36523, objectstack-ai#36478, objectstack-ai#36522, objectstack-ai#36514, objectstack-ai#36508), and `6185caed`, which regenerates `content/docs/references/ui/component.mdx` from the merged tree. The merge had taken that page's `mobileMaxVisible` line from one side. Checks at the final head: - `dispatch-gates --ran` at `6185caed`: 120 derived families accounted for, 120 run, 0 NOT MEASURED, every one exit 0. That includes `check:generated` and `check:liveness` after a spec rebuild, and `pnpm --dir ui exec vitest run scripts/` run alone under the verify lock. - `ui/packages/fields/` + `ui/packages/plugin-form/` (whole packages) at `6185caed`: 567 files, 7,629 tests passed, 8 skipped. - The new pins were ablated: both "emptied, it writes null" pins and the tags `—` pin go red with their fix taken out. - `overlap-check` at `6185caed`, verdict read before the push. It merges cleanly with `origin/main` `a10987ae` and with 6 of 7 open PR heads. objectstack-ai#36543 conflicts only in `packages/spec/liveness/state-counts/field.md`, a generated count: whichever lands second regenerates it with `gen:liveness-counts`, not a hand merge. - Earlier heads: at `10767ef3`, `pnpm --filter @objectstack/spec test` (871 files, 27,909 tests) and `test:repo` (92 files, 1,562 tests) passed. CI was green at `f73a4351`. --- _Generated by [Claude Code](https://claude.ai/code/session_01QsR2jTbWpneBrqq7SJvrNt)_ 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_01QsR2jTbWpneBrqq7SJvrNt <!-- signed: repo:objectstack#7 · zhuangjianguo · session_01QsR2jTbWpneBrqq7SJvrNt --> --------- Co-authored-by: Claude <noreply@anthropic.com>
Requested by Steve · project thread
Fixes #35307
Clause-②: no
Metadata-protocol: none
维护者速读
What changes
sys_record_shareis titled byrecipient_id, a text column whose principal kindrecipient_typenames.searchAllfollowed only a reference-typed title pointer (referenceTargetOf), so every record-share hit in the palette read as a raw user id.searchAllnow recognises a title pointer that is a recipient id by the declaration the console's recipient face already reads: atextfield withwidget: 'recipient-picker'andrecipient_typein itsdependsOn(no object-name special case; another object carrying the declaration is titled the same way). The hit is titled by the directory record its row's kind names, mirroring the console'sRECIPIENT_RECORD_KINDStable:recipient_typeusersys_userby idname)unit_and_subordinates(andbusiness_unit)sys_business_unitby idnameteam(not offered onsys_record_share)sys_teamby idnamegrouppositionEach directory is read once per swept object (
id $in), through the existingreadReferenceTitles, so the read is the searcher's and every gate and disposition of the #34175 reference follow applies unchanged: exposure must serveget, disabled-package targets are not read,canReadObjectis asked first, a typedPERMISSION_DENIED/ row scope / field-level security leaves the bare id, an unprovisioned table titles nothing, and any other read failure propagates (the 2026-08-29 search ruling: a read that could not run is never answered as no match). The hit wire shape does not move;recordstill carries the stored id.Files:
packages/metadata-protocol/src/protocol-record-reads.ts, newpackages/metadata-protocol/src/protocol.search-title-recipient-35307.test.ts,.changeset/35307-search-recipient-title.md. No existing test was changed.Read first:
protocol-record-reads.tsrecipientKindFieldOf(the declaration gate) andreadRecipientTitles(grouping ids by directory), then therenderTitlecall in the sweep loop.Tests
New file
protocol.search-title-recipient-35307.test.ts(12 cases): user and business-unit recipients titled by name while group and position keep the stored value; one read per directory as the searcher (id+nameonly); wire shape unchanged; object-level refusal (never read), refusal thrown by the read, row scope and FLS each keep the bare id;recipient_typehidden from the searcher pays no read; unprovisioned table keeps the hit; a failing directory read fails the search with its owncode/status; another object with the declaration is titled the same; without the widget or withoutdependsOnnothing changes; a reference-typednameFieldstill follows its target.Acceptance notes
RECIPIENT_RECORD_KINDS(objectui@object-ui/fields); the server cannot import the UI package. Lifting it into a spec contract both sides read is a spec change outside this card.Verification
Two-minute check:
pnpm --filter @objectstack/metadata-protocol exec vitest run src/protocol.search-title-recipient-35307.test.ts, expected 12 passed.Readings at head e8b22f7 (merge base 316f757, origin/main unchanged at PR open):
Package typecheck and tests
pnpm --filter @objectstack/metadata-protocol typecheckexit 0;vitest run: 363 files passed, 9 skipped; 23336 tests passed, 45 skipped (lock VERDICT command-exit 0).search-title-lookup,search-title-namefield): 3 files, 32 tests passed.test:reponot run locally (declared to CITest Core).Ablation (one-shot, not kept)
The fix's call site (
renderTitle(row, referenceTitles ?? ...recipientTitles...)back torenderTitle(row, referenceTitles)) mutated on disk byscripts/ablation-replace.mjs(anchor 1 to 0, blob 34aaaee9 to 20eb4f9f); the new file went 5 failed / 7 passed (the pin, the business-unit and refusal legs, the unprovisioned-table leg, the other-object leg); restored blob equals HEAD andgit diff HEADempty. The suite imports./protocol.jsfrom source, so no dist rebuild applies.Derived gate families
node scripts/pm/dispatch-gates.mjs --commands --repo objectstack-ai/objectstack: 67 families, each run with stdin closed, exit captured before any pipe: 67 exit 0. Three first answered exit 3 (prerequisite): the teardown-shape self-test (shallow clone, unshallowed) andcheck:dual-build-cjs-loads/check:lean-entry-closure(dists absent, full build at concurrency 2); each re-run exit 0.--ran: 67 derived, 67 run, 0 NOT-MEASURED, 0 UNRUN.https://claude.ai/code/session_01ADHkmRB34k9WUWeGpRnVNm
🤖 Generated with Claude Code