Repository navigation
fix(fields): lookup picker is wide enough to read an option and stays inside the viewport - #34658
Merged
objectstack-fleet[bot] merged 3 commits intoNov 17, 2026
Merged
Conversation
… width A lookup in a narrow line-item grid cell opened a popover exactly as wide as the cell, so option names were cut to a few letters. The popover keeps the trigger width as its width, gains a 16rem floor, and is capped (floor included) by the width Radix reports as available, so it never leaves the viewport on a narrow screen. Claude-Session: https://claude.ai/code/session_01WGufziunkXbDT7wUWqfmWz Co-authored-by: Claude <noreply@anthropic.com>
…geset Measured in Chromium against the catalog the report came from: at 16rem the longest product name still lost 6px; at 18rem every name reads whole, and the room cap still holds the panel inside a 320px and a 260px viewport. Claude-Session: https://claude.ai/code/session_01WGufziunkXbDT7wUWqfmWz Co-authored-by: Claude <noreply@anthropic.com>
…okup-popover-width
This was referenced Nov 17, 2026
Contributor
Author
|
repo:objectstack#3 · os-support-ai · session_01WGufzhshTXCAmv9KJXRZkB 席位核对 · L1 (seat 3, L1-a) · 2026-11-17T05:28ZL1: ACCEPT Must-fixNone. Should-fixNone. Readings that hold
Notes
|
Contributor
Author
|
repo:objectstack#3 · os-support-ai · session_01WGufziunkXbDT7wUWqfmWz Landing · area o3-C · head 333b337
State: ready + auto-merge now. |
objectstack-fleet
Bot
deleted the
claude/issue-34601-lookup-popover-width
branch
November 17, 2026 05:53
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Requested by Yibo Wang · project thread
Part of #34601 (item 1 lands here; item 2 is traced below and ends as an open question for the seat, so merging this must not close the card)
Clause-②: no
Metadata-protocol: none
维护者速读
ui/packages/fields/src/widgets/LookupField.tsx里PopoverContent的 className(宽度三件套);其次是测试文件末尾新增的 describe。What changes
LookupField's quick-pick popover (data-testid="lookup-popover") keepsw-[var(--radix-popover-trigger-width)]and gains two classes:min-w-[min(18rem,var(--radix-popover-content-available-width,100vw))]: a floor, so a narrow trigger (a compact line-item grid cell, or an inline cell editor) no longer gives a narrow list. The floor is itself capped by the available width withmin(), because amin-widthlarger than themax-widthwins over it.max-w-(--radix-popover-content-available-width): never wider than the room Radix reports, so a narrow screen keeps the panel inside the viewport.GridField's lookup cell andFieldEditWidget(COMPACT_EDIT_TYPES, used by inline cell editing in object grids).FieldTypePickeralready uses.align="start"and Radix's default collision handling are unchanged. Measured: a widened panel opened from a right-edge cell shifts left and stays on screen.Tests
LookupField.previewBadges-13123.test.tsx, beside the existing popover-bounds describe (objectstack#34362). It pins the three width classes for a compact trigger and for a full-size one. jsdom has no layout, so the pixels were read in Chromium (Verification below). The harness'sopenPickergains an optional{ compact }argument.scripts/ablation-replace.mjs --delete, source is imported relatively so no dist leg): deleting the two new classes from the committedLookupField.tsxturned both new tests red (popover lacks min-w-[min(18rem,...)], 2 failed / 17 passed). The file was restored to the HEAD blob0d4e6d38cb3b, andgit diff HEADwas empty afterwards. The first attempt used--replacement '', which the tool refused before running anything; it was a no-op, and the--deletererun is the reading.Acceptance notes
truncate), and a truncated option carries notitle. With the reported catalog every name fits. Whether long names should wrap or show a tooltip is a separate design choice and is not changed here.GridField) nothing produces a lookup column under 168px except an author-pinnedwidth. The likely source of the reported 65px column is a different surface, outside this PR's surface and not measured live.Item 2 trace: where a lookup column under 168px comes from
GridField:widthStylegives an unpinned lookup columnwidth=minWidth= 168 (MIN_WIDTH_BY_TYPE.lookup). Measured in Chromium on the real component: the column is 168px at a 375px viewport and 281px at 1280px (the table stretches). A column goes under 168 only when it pinswidth: pinned 65, it measured 68px at 375px.width:hydrateColumns(plugin-form),deriveMasterDetailand specderiveInlineGridColumnswrite none, so a narrow grid column is always author metadata.18e18329(read-only clone):quote_line_itemdeclares noinlineEditand no grid columnwidth. Thecrm_quoterelationship curatesrelatedListColumnswithcrm_productand no width. SoGridFieldatorigin/maindoes not produce a 65px Product column from hotcrm's metadata.FieldEditWidget, used by inline cell editing in object grids. There,data-tableauto-sizes a column with nowidthfrom what it drew (autoWidthKey), so an empty Product column takes its header's width. That fits the reported ~65px, but it was NOT MEASURED in a running hotcrm instance. The popover change here covers that path as well.GridFieldshould floor an author-pinnedwidthat the type minimum, which changes whatwidthmeans to an author; (b) whether thedata-tableauto-width needs a floor for lookup columns. That is@object-ui/components, outside this PR's surface.Verification
Chromium readings (real GridField + LookupField, console Vite dev server, temporary harness removed after the run)
Options: hotcrm's 13 catalog product names. "before" = the same page with the new min/max overridden away (trigger width only).
Local gates on head 333b337 (after merging origin/main 518baca)
pnpm --dir ui exec vitest run --maxWorkers=2 packages/fields/src/widgets/LookupField packages/fields/src/widgets/GridField: exit 0, Test Files 44 passed (44), Tests 347 passed (347).pnpm --filter @object-ui/fields run type-check: exit 0 (the new test file is intsconfig.test.json's program,--listFilesOnlycount 1).pnpm --filter '@object-ui/fields^...' build: exit 0.node scripts/pm/dispatch-gates.mjs --commands: 38 commands, every one exit 0, includingpnpm --dir ui exec vitest run scripts/(5077 passed, 2 skipped) andpnpm check:nul-bytes. Also run:pnpm check:changeset-fixed(roster under.changeset), exit 0.dispatch-gates --ran: "38 derived, 38 run, 0 NOT-MEASURED, 0 UNRUN" (a derived zero: all 38 carry an exit code).node scripts/check-platform-checklist.mjs --changed-from origin/main: exit 0, 0 anchored files.pnpm --dir ui run check:new-line-citations: exit 0, 0 new citations.node scripts/pm/overlap-check.mjs --branch=claude/issue-34601-lookup-popover-width: exit 0, merges cleanly.signed: repo:objectstack#3 · os-support-ai · session_01WGufziunkXbDT7wUWqfmWz
Generated by Claude Code