Skip to content

fix(fields): a tap on a lookup picker option's preview chip selects the option - #36602

Merged
objectstack-fleet[bot] merged 2 commits into
mainfrom
claude/issue-36479-lookup-preview-chip-selects
Nov 23, 2026
Merged

objectstack-fleet[bot] merged 2 commits into
mainfrom
claude/issue-36479-lookup-preview-chip-selects

Conversation

@objectstack-fleet

Copy link
Copy Markdown
Contributor

Fixes #36479
Clause-②: no
Metadata-protocol: none

repo:objectstack#2 · os-steve · session_01ADHkmNmMEXS4EzeVz9RjvD

维护者速读

  • 用户在关联字段的下拉选择里点选项下方预览中的记录标签(如「客户:Fabrikam」),以前会直接跳到那条记录、编辑被丢下;现在点选项任何位置都是选中该选项,手机和电脑一样。
  • 记录页字段区的体验修补,替在手机上编辑关联字段的用户解决「点错就跳走」的问题。
  • 出错时最坏是预览里的记录标签或邮箱、网址不再能点开(本来在选择框里也不该点开);记录页、列表里的链接不受影响,改动可直接撤回。
  • 无。

What changes

The lookup quick-picker's option preview drew each extra column through the read cell. A reference column became a link to its record whenever the host answers recordHref (on a record page, the record chip), and that link's click handler stops propagation and calls the host's openRecord, so the option row's own click never fired. An email / url / phone / file column did the same with its own anchor (the email cell's anchor also stops propagation).

renderLookupColumnValue is the one renderer both picker surfaces call (the dropdown preview and the browse-all dialog table). It now carries the picker rule the dialog applied on its own (objectui#11903, point 7): every candidate cell renders under a host with no record destination (WithoutRecordLinks), so a reference keeps its face (the chip included) without the anchor or hover card, and a self-linking type is drawn with the text face. The fix sits where the preview gets the read cell's link; no event is swallowed anywhere.

Desktop answer the card asked for: yes, the same click navigated with a mouse too. The defect was the link's click handler, not the pointer type; the pin drives both [TouchA] and [MouseLeft].

First read (by risk)

  1. ui/packages/fields/src/widgets/lookupColumnDisplay.tsx: the renderer branch of renderLookupColumnValue (face substitution + WithoutRecordLinks).
  2. ui/packages/fields/src/widgets/LookupField.previewLinkFree-36479.test.tsx: the pin.

Tests

Premise reproduced on main (c0eecb1 code, pin only)
× [TouchA] on the chip selects the option and opens no record
× [MouseLeft] on the chip selects the option and opens no record
× draws the chip with no anchor, so the option is the one click target
× draws a self-linking column with its text face, so a tap on it selects too
AssertionError: expected "vi.fn()" to not be called at all, but actually been called 1 times   (openRecord)
AssertionError: expected "vi.fn()" to be called 1 times, but got 0 times                      (onChange, email column)
Tests  4 failed (4)
With the fix
LookupField.previewLinkFree-36479.test.tsx  Tests  4 passed (4)
os-verify-lock: VERDICT command-exit 0
Ablation (fix committed first; renderer branch reverted with scripts/ablation-replace.mjs)
ablation-replace: ok mutation landed: anchor 1 -> 0, blob f2aef5ef1057 -> a27207a105b6
× [TouchA] on the chip selects the option and opens no record
× [MouseLeft] on the chip selects the option and opens no record
× draws the chip with no anchor, so the option is the one click target
× draws a self-linking column with its text face, so a tap on it selects too
Tests  4 failed (4)
ablation-replace: ok restored: blob == HEAD (f2aef5ef1057) and `git diff HEAD` is empty

@object-ui/fields resolves to src/ through the ui vitest alias, so no dist rebuild was involved in either leg.

Package suite and type-check

At head 186d4b4:

pnpm exec vitest run --root ../.. --maxWorkers=2 packages/fields/ && pnpm run type-check   (under os-verify-lock)
 Test Files  323 passed | 1 skipped (324)
      Tests  4895 passed | 7 skipped (4902)
tsc --noEmit && tsc -p tsconfig.test.json   (the test program includes src/**/*.test.tsx)
os-verify-lock: VERDICT command-exit 0

Only @object-ui/fields changes, and its public surface is byte-unchanged (no export added or removed), so no importer owes a run.

Acceptance notes

  • RecordPickerDialog.tsx keeps its own SELF_LINKING_CELL_TYPES substitution and WithoutRecordLinks wrapper; with the rule now in the shared renderer they are redundant there (idempotent, no behaviour change). Removing them is outside this card's file surface and left in place.
  • The record page's chip face (ReferenceChipContext) still reaches the preview through the popover, so a reference in an option preview draws as an unlinked chip there and as plain text elsewhere. Unchanged here; noted only.

Verification

Two-minute check: cd ui/packages/fields && pnpm exec vitest run --root ../.. packages/fields/src/widgets/LookupField.previewLinkFree-36479.test.tsx shows 4 passed. In the Console (not driven in a browser by this PR; the component pin is the evidence): showcase Field Zoo record at 375 px, inline-edit the Master-Detail field, open the picker, tap the Account: Fabrikam chip in an option preview: expect the option to be selected and no record to open.

Gate families derived for this diff (head 186d4b4)

node scripts/pm/dispatch-gates.mjs --commands --repo objectstack-ai/objectstack derived 38 families; all 38 ran locally and exited 0 (the vitest one under os-verify-lock). --ran reconciliation: 38 derived, 38 run, 0 NOT-MEASURED, 0 UNRUN (a derived zero: every line carries its exit code). The type-check programs CI runs over the whole workspace (Type Check UI and the lint.yml type-check lanes) are CI's; the package's own type-check above is the local reading.


Generated by Claude Code

… a link

The quick-picker's option preview drew a reference column through the read
cell, which links the referenced record when the host answers recordHref;
the link's click handler stopped propagation and opened the record, so a tap
on a record chip in an option's preview navigated instead of selecting the
option. renderLookupColumnValue, the one renderer both picker surfaces call,
now draws every cell under a host with no record destination and draws
self-linking types with the text face, the rule the dialog table already
applied on its own.

Co-authored-by: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01ADHkmNmMEXS4EzeVz9RjvD
@github-actions github-actions Bot added size/m documentation Improvements or additions to documentation tooling Fix lands in tooling, not a product package — enters pm:queue only with Unblocks: or a named surface labels Nov 23, 2026
@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#2 · os-steve · session_01ADHkmNmMEXS4EzeVz9RjvD
L1 · 2026-11-23T02:33Z · PR #36602 @ 186d4b4 · card #36479 · area s2-A

席位核对

ACCEPT — one card, one PR, not governed (check-governed-merges.mjs: NOT governed), +223/-2 over three files, Clause-② no, Metadata-protocol none.

  1. Shape. Fixes #36479; no other card bound; files: ui/packages/fields/src/widgets/lookupColumnDisplay.tsx, the new pin LookupField.previewLinkFree-36479.test.tsx, one @object-ui/fields patch changeset. LookupField.tsx and index.tsx untouched, so open PR feat(console): preview images, PDF, text and CSV in the page from attachments and file fields #36587 is not crossed.
  2. Premise measured. Reproduced on main c0eecb1f8: a tap and a mouse click on the Account: Fabrikam chip in a quick-picker option preview each called the host's openRecord and never selected the option, so desktop with a pointer navigates too (the card's open question); an email column's anchor swallowed the click as well. Pin 4 of 4 red on main code.
  3. Code read. Root cause: the preview draws its columns through the read cell, whose ReferencedRecordLink renders an anchor whenever the host answers recordHref. renderLookupColumnValue, the one renderer both picker surfaces share, now renders every candidate cell under WithoutRecordLinks (host with recordHref/openRecord withheld, every other member passed through) and draws self-linking types (email, url, phone, file, video, audio) with the text face, the rule the browse-all dialog already applied (objectui#11903). Read cells outside the picker keep their links. @object-ui/react is already a fields dependency. Ablation of the renderer branch: 4 failed, restored blob equal to HEAD, 4 passed.
  4. Gates. 44 success, 13 expected skip, 0 failed, 0 pending at this head (Test UI included); dev's 38 derived gates with 0 NOT MEASURED, packages/fields 324 files under the lock, type-check 0. Head is 11 commits behind main, none touching ui/packages/fields or ui/packages/react.
  5. Accepted deviations. The self-linking half (email/url/phone/file) goes beyond the card's record chip; same file, same rule the dialog pins, same click-target defect, so taken in place.
  6. Out of scope. RecordPickerDialog.tsx keeps its own SELF_LINKING_CELL_TYPES and WithoutRecordLinks, now redundant behind the shared renderer (no behaviour change); noted in the PR, not filed.

Landing: area lands it (non-governed, under 3000 lines): ready + auto-merge.

@objectstack-fleet
objectstack-fleet Bot marked this pull request as ready for review November 23, 2026 02:33
@objectstack-fleet
objectstack-fleet Bot added this pull request to the merge queue Nov 23, 2026
Merged via the queue into main with commit 50bfbb8 Nov 23, 2026
58 checks passed
@objectstack-fleet
objectstack-fleet Bot deleted the claude/issue-36479-lookup-preview-chip-selects branch November 23, 2026 03:07
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/m 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.

Phone: tapping a record chip inside a lookup picker option's preview opens that record instead of selecting the option

2 participants