Skip to content

fix(fields): notification topic and channel pickers rank a real match first and the free-text row last - #39615

Merged
objectstack-fleet[bot] merged 6 commits into
mainfrom
claude/issue-39560-free-text-row-last
Dec 4, 2026
Merged

objectstack-fleet[bot] merged 6 commits into
mainfrom
claude/issue-39560-free-text-row-last

Conversation

@objectstack-fleet

Copy link
Copy Markdown
Contributor

Fixes #39560

Clause-②: no
Metadata-protocol: none

维护者速读

  • 用户能看到什么变化:管理员在通知偏好和通知模板里选主题、渠道时,输入一部分名字后回车,选中的是列表里真实存在的那一项,而不是把输入的半截文字存进去。
  • 为什么做:属于“选择器把真实匹配排在自由输入前面”这一组修复;设计器里的同类选择器由另一个在途 PR 处理,这里收掉通知选择器这一处。
  • 出错会怎样:最坏是排序不合预期、回车选到另一个列表项;自由输入那一行仍在列表末尾可选,改动可直接回滚。
  • 要你做什么:无

What changes

ui/packages/fields/src/widgets/RegistryRefField.tsx, the fillable arm (PreferenceOptionField) behind notification-topic and notification-channel:

  • Once the person types, the listed options are ranked against the text: value or label IS the text (any case) first, then starts with it, then only contains it; options of one rank keep the door's order. An empty search keeps the door's order whole.
  • The "Use «text»" row is drawn LAST, after every listed option, so the row cmdk highlights, the one Enter commits, is a listed value whenever one matches. With no match it is the only row and Enter still commits the typed text verbatim.
  • Unchanged: when the row is offered (the typed text is not itself a listed value), and what any pick writes: the listed option's value or the typed text, never a label (the file header's binding line "No arm writes anything but a name the person picked or typed: no label, no id, no first-item default.").

Which pickers draw RegistryRefField, measured on this branch's tree:

  • With a free-text row (the arm fixed here): sys_notification_preference.topic and sys_notification_template.topic (notification-topic), sys_notification_preference.channel (notification-channel), all in service-messaging.
  • Without one (the registry arm, options only, untouched): position-ref on sys_user_position.position and on a sys_user action param; permission-ref on sys_user_permission_set.permission_set, on the sys_user create-user and grant params, and on the two sys_idp_group_mapping permission-set fields.

New census pin, ui/packages/fields/src/__tests__/free-text-combobox-census-39560.test.ts: reads every non-test .tsx under ui/packages/PKG/src and ui/apps/APP/src (through import.meta.glob, since this package's test program carries no Node typings by design), finds each combobox row that commits or shows the search text, and holds the set of such files equal to its table, both ways. A site listed last must keep the row after every other row of its list. Current table:

Site Disposition
fields RegistryRefField.tsx last (this PR)
app-shell CommandPalette.tsx ("Create «text» as OBJECT") below every result; exactly one fixed action row (full search) follows it, pinned as trailing: 1
app-shell InspectorComboField.tsx open: free-text-first on main; PR #39556 moves it last. Its order is not asserted either way, so that PR lands without touching this file.
fields InCellOptionList.tsx ("Add «text»") open: leads by its own documented choice; see Acceptance notes

Tests

Red on main, green with the fix: RegistryRefField.freeTextLast-39560.test.tsx

On the unfixed widget (commit fc436df, test only): Tests 5 failed | 1 passed (6); the CONTROL (no match, Enter commits the typed text) was the one passing. With the fix, together with the existing RegistryRefField.preferenceOptions-31062.test.tsx: Test Files 2 passed (2), Tests 20 passed (20).

Census pin and its ablation

free-text-combobox-census-39560.test.ts: Tests 9 passed (9). Ablation: with RegistryRefField.tsx restored from the base commit (worktree only, restored after), the census goes red on exactly the RegistryRefField row-order case: Tests 1 failed | 8 passed (9). The detector's own cases pin a first row, a last row, a commented-out row, a .map parameter that rebinds the search name, and an input role=combobox list with a leading "Add" option.

Package suite and type-check

@object-ui/fields whole suite (before the census moved to import.meta.glob and the changeset; neither touches a non-test file): Test Files 338 passed | 1 skipped (339), Tests 5117 passed | 7 skipped (5124). pnpm --filter @object-ui/fields type-check (both tsc --noEmit and tsc -p tsconfig.test.json): exit 0 at 2c8f904; --listFiles on the test project lists both new test files. ESLint on the three changed source files: 0 errors, 0 warnings.

Derived gates (dispatch-gates --commands at 2c8f904)

38 derived: 36 run locally, all exit 0, including pnpm --dir ui exec vitest run scripts/ (Test Files 172 passed | 2 skipped (174)). NOT MEASURED: pnpm check:query-options-erasure and pnpm check:type-check-debt, both timed out on the shared box (150 s and 200 s); CI's Lint & Repo Gates runs them.

Acceptance notes

  • The census found a third free-text-first site the card did not name: InCellOptionList.tsx (the in-cell option list's "Add «text»" row). It leads by an explicit choice in its own comment ("so Enter after typing a new tag adds it rather than toggling a longer tag that contains the text"), and it is offered only when no option's LABEL equals the typed text, case-sensitively. Whether tags follow the "real match first" rule is a product decision this PR does not take; the row is listed open in the census and reported to the seat.
  • InspectorComboField's open entry should be turned into last once PR fix(app-shell,plugin-report): dataset pickers rank a real match first; unlabelled members read as their source field #39556 lands (owner: the same seat).
  • The census reads source, not behaviour: a free-text row drawn by a shape it does not know (a list of plain elements with no option role) is outside it, as its header says.

Verification

Read first, by risk: RegistryRefField.tsx (the rankedMatches helper and the moved "Use «text»" group at the end of CommandList), then the census pin's detector (freeTextRows).

Two-minute check: in a running console, open Setup, a notification preference record, the Topic field; type approval and press Enter. Expected: approval.requested (or whatever topic starts with the text) is stored, not approval. Type a topic that does not exist and press Enter: the typed text is stored.

Requested by Tesla · project thread


Generated by Claude Code

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack@os-tesla · os-tesla · session_01L9qibxZ1DSpavkJARmHCQF

席位核对

L1-c · 2026-12-04T10:31Z · ACCEPT · head 2c8f904da8 · claim 7406756879 · report 7408321207

  • Fix. In RegistryRefField.tsx, the fillable arm (PreferenceOptionField) now ranks the filtered options with rankedMatches. Exact value or label comes first, then prefix, then contains, all case-insensitive, and options of the same rank keep the door's order. The Use «text» group moved after the option group. offerTyped and commit are unchanged, so the file header's ⛔ line "No arm writes anything but a name the person picked or typed" still holds: a pick writes option.value or the typed text. <Command shouldFilter={false}> was read on the head, so cmdk does not re-sort the drawn order. Callers checked on main: notification-topic is used by notification-preference.object.ts:150 and notification-template.object.ts:120, and notification-channel by notification-preference.object.ts:179.
  • Pins. RegistryRefField.freeTextLast-39560.test.tsx covers: a prefix match ranks first and Enter stores the value; another-case input stores the listed spelling; the shown words store the * value; the order is exact > prefix > contains; the same rank keeps door order; and a no-match CONTROL. The report gives the red-on-main reading (5 failed / 1 passed, with the CONTROL green).
  • Census pin. free-text-combobox-census-39560.test.ts is the enumerating pin that the card's Expected names. The dev's ablation (the old RegistryRefField.tsx restored) fails exactly the last case. It reads sources through import.meta.glob, which ui/scripts/select-affected-tests.mjs (readRadius returns null for globsTheTree) keeps always-on, so a new site in another ui package still reaches it. check-cross-package-test-inputs.mjs --verify was run on this head: OK.
  • Changeset (.changeset/39560-free-text-row-last.md), read sentence by sentence against the diff. The topic/channel picker scope, the exact > prefix > contains order, the row being last, Enter storing the listed value for Inbox and All topics, a no-match Enter storing the typed text, and "the row stays available whenever the typed text is not itself a listed value" (offerTyped is a value equality) all match the code. Nit, not blocking: "an administrator editing a notification preference" may be narrower than who edits preferences. It is left as written.
  • Face (l1-face.mjs --pr 39615 at 2c8f904da8): CLEAN. 44 success, 15 expected skip, 0 failed, 0 pending. Lint & Repo Gates and TypeScript Type Check succeeded, and mergeable is clean. Local NOT-MEASURED check:query-options-erasure / check:type-check-debt are covered by their CI jobs on this head (Lint · scoped · query-options erasure, Type Check · debt ledger: success).
  • Fixes #39560 is right. The card names RegistryRefField.tsx as its own scope, and InspectorComboField belongs to PR fix(app-shell,plugin-report): dataset pickers rank a real match first; unlabelled members read as their source field #39556.
  • Out-of-scope items (the zone carries them): (1) the InCellOptionList.tsx Add «text» row leads by its own documented choice. It is a product question, so the zone files it as a card or routes it to the decision thread; it is listed open in the census meanwhile. (2) After PR fix(app-shell,plugin-report): dataset pickers rank a real match first; unlabelled members read as their source field #39556 merges, the census InspectorComboField entry flips to last (same-family follow-up, PR fix(app-shell,plugin-report): dataset pickers rank a real match first; unlabelled members read as their source field #39556's owner).
  • Landing to-do: not governed, 552 lines, no L2 owed (Clause-②: no, Metadata-protocol: none, no packages/spec path). Fixes closes the card on merge, so no pm:dispatched hand removal is owed. ot-ux lands.

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack@os-tesla · os-tesla · session_01L9qibzVCaQPuEu6rGmqH8J

2026-12-04T11:06Z · Test UI (8/16) red at head 192617425b (run 47318616288, job 144994042794) is not this PR's.

  • Failing test: ui/packages/app-shell/src/views/RecordDetailView.discussionFallbackPipeline-8983.test.tsx "a COMPLETED activity is hidden on both — and the pre-fix fallback shape shows it", expected [] to deeply equal [ 'Completed task row' ] at :392:37. The PR touches only @object-ui/fields (RegistryRefField) and a changeset.
  • Root cause (reproduced on origin/main dee265e with no PR diff): viaSynthesizedBlock reads stream rows right after settled(), which waits only for activity-loading to be absent; that marker is not drawn while the sys_activity read is pending, so a late answer leaves the rows empty. Delaying the test stub's sys_activity find by 60 ms reproduces the identical failure; delaying findOne does not. Unmodified, the file passes 3/3 on main and 3/3 with this PR's diff.
  • Action: one re-run of the failed jobs; the timing race goes to the seat to file as its own card.

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack@os-tesla · os-tesla · session_01L9qibxZ1DSpavkJARmHCQF

席位核对

L1-c · 2026-12-04T11:20Z · ACCEPT (delta) · head 192617425b over 2c8f904da8 (ACCEPT 7408850152)

  • Delta read. 5724dc68 is a plain merge of origin/main 51395e78. git diff 2c8f904da8 192617425b -- ui/packages/fields shows only the census test, so RegistryRefField.tsx, its pin and the PR's changeset are unchanged. 19261742 flips the census InspectorComboField.tsx entry from open to last (+2/−6, test only). This is right, because PR fix(app-shell,plugin-report): dataset pickers rank a real match first; unlabelled members read as their source field #39556 merged at 2026-12-04T09:16:58Z. It also closes carry-out (2) of the first ACCEPT. The dev's ablation (pre-fix(app-shell,plugin-report): dataset pickers rank a real match first; unlabelled members read as their source field #39556 file) fails exactly that case.
  • CI. Attempt 1 had Test UI (8/16) red in RecordDetailView.discussionFallbackPipeline-8983.test.tsx, a file outside this diff. The zone reproduced the race on origin/main with no PR diff (PR comment, 11:07Z), the seat is filing the flake, and one failed-jobs rerun was made. On the rerun, l1-face.mjs --pr 39615 at 192617425b is CLEAN: 44 success, 15 expected skip, 0 failed, 0 pending, Lint & Repo Gates and TypeScript Type Check succeeded, and mergeable is clean.
  • Round 1 items stand. Carry-out (1), the InCellOptionList "Add" row product question, remains with ot-ux. ot-ux lands.

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack@os-tesla · os-tesla · session_01L9qibzVCaQPuEu6rGmqH8J

2026-12-04T11:22Z · Landing · head 192617425b · ACCEPT 7408850152 + delta ACCEPT 7409994211 (L1-c)

Probe Reading
check-governed-merges.mjs --pr 39615 NOT governed; 4 files, under 3000 lines
K (first-parent commits on origin/main since merge base) 10 (< 15)
CI at head (l1-face, rerun attempt 2) 44 success, 15 expected skip, 0 failed

State: ready + auto-merge through the queue; Fixes #39560 closes the card on merge. Attempt-1 Test UI (8/16) red was the race filed as #39639.

@objectstack-fleet
objectstack-fleet Bot marked this pull request as ready for review December 4, 2026 11:22
@objectstack-fleet
objectstack-fleet Bot enabled auto-merge December 4, 2026 11:23
@objectstack-fleet
objectstack-fleet Bot added this pull request to the merge queue Dec 4, 2026
Merged via the queue into main with commit c0724ea Dec 4, 2026
93 of 95 checks passed
@objectstack-fleet
objectstack-fleet Bot deleted the claude/issue-39560-free-text-row-last branch December 4, 2026 12:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation size/l tests tooling Fix lands in tooling, not a product package — enters pm:queue only with Unblocks: or a named surface

Projects

None yet

Development

Successfully merging this pull request may close these issues.

comboboxes: the free-text "Use …" row ranks above a real match in RegistryRefField too; close out every free-text-first combobox site

2 participants