Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
…, sticky header, page jump, and enhanced styling Resolves major UI/UX gaps in the lookup field record picker dialog: - Skeleton loading screen replaces simple spinner during initial data load - Sticky table header keeps column labels visible during scroll - Loading overlay for subsequent fetches (page/sort/filter transitions) - Page jump input for direct page navigation - Enhanced search bar with subtle background container - Improved table styling: even/odd row striping, refined selection, rounded borders - Wider dialog (max-w-3xl) with responsive 3-column filter layout - 8 new unit tests covering all new features Co-authored-by: hotlong <50353452+hotlong@users.noreply.github.com>
…racted row class helper, fix spacing and changelog - Replace magic z-index values with named constants (Z_STICKY_HEADER, Z_LOADING_OVERLAY) - Extract nested ternary row background logic into getRowBgClass helper - Remove redundant pb-3 on DialogHeader (mb-3 on search bar is sufficient) - Remove Chinese characters from CHANGELOG entry Co-authored-by: hotlong <50353452+hotlong@users.noreply.github.com>
|
@copilot 评估是否已经完成了任务中要求的所有开发目前我在console 界面中看不到任何效果 |
…idelines, add RecordPickerDialog Storybook stories for visual verification
- Replace style={{ zIndex: Z_LOADING_OVERLAY }} with Tailwind z-10 class
- Replace style={{ zIndex: Z_STICKY_HEADER }} with Tailwind z-[5] class
- Remove unused Z_STICKY_HEADER / Z_LOADING_OVERLAY constants
- Add record-picker-dialog.stories.tsx with Default, MultiSelect, and WithFilters stories
Co-authored-by: hotlong <50353452+hotlong@users.noreply.github.com>
The code changes are complete in this PR branch — all the issue requirements have been implemented in
Why you don't see changes on demo.objectui.org: The demo site runs from the main branch. These changes are in this PR branch and will be visible after merging. To verify locally, I've added Storybook stories ( |
|
@copilot 宽屏幕上查看弹出窗口还是很窄,而且选中之后报错react React error #185; visit https://react.dev/errors/185 for the full message or use the non-minified dev environment for full errors and additional helpful warnings |
…eact #185 close-reset cycle by separating useEffect Co-authored-by: hotlong <50353452+hotlong@users.noreply.github.com>
Fixed both issues in ec9bcb4:
Screenshot on 1440px viewport: |
There was a problem hiding this comment.
Pull request overview
This PR upgrades RecordPickerDialog in @object-ui/fields to provide a more enterprise-grade UX (skeleton loading, sticky header, page jump, styling refinements), plus accompanying stories, tests, and changelog notes.
Changes:
- Updated
RecordPickerDialogUI/UX: skeleton initial load, sticky header, loading overlay for subsequent fetches, page-jump input, and refined styling/responsive sizing. - Added Storybook stories for visual verification and expanded unit test coverage for the new behaviors.
- Documented the enhancements in
CHANGELOG.md.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| packages/fields/src/widgets/RecordPickerDialog.tsx | Implements the UI/UX overhaul (skeleton/overlay, sticky header, page jump, styling, effect separation). |
| packages/fields/src/record-picker.test.tsx | Updates existing loading test and adds new tests for skeleton, sticky header, page jump, and overlay behavior. |
| packages/fields/src/record-picker-dialog.stories.tsx | Adds Storybook scenarios (Default, MultiSelect, WithFilters) with a mock DataSource. |
| CHANGELOG.md | Documents the RecordPickerDialog improvements and related additions. |
Comments suppressed due to low confidence (1)
packages/fields/src/widgets/RecordPickerDialog.tsx:517
handleSearchChangeresetscurrentPageto 1, but the separate fetchuseEffectdepends oncurrentPageand will immediately callfetchRecords(searchQuery, 1, ...)when the user starts searching from a page > 1. That defeats the intended debouncing and can trigger duplicate requests (immediate fetch from the effect + debounced fetch fromhandleSearchChange). Consider either (a) moving the debouncing into the effect via a debouncedsearchQueryvalue, or (b) setting a ref/flag inhandleSearchChangeso the nextcurrentPage-driven effect run is skipped and only the debounced fetch executes.
// Fetch when dialog is open and pagination / sort / filter deps change
useEffect(() => {
if (open) {
fetchRecords(searchQuery || undefined, currentPage, currentSort);
}
// `fetchRecords` and `searchQuery` are intentionally excluded:
// fetchRecords is stable (useCallback), searchQuery triggers its own
// debounced fetch in handleSearchChange.
// eslint-disable-next-line react-hooks/exhaustive-deps
}, [open, currentPage, currentSort, mergedFilter]);
// Initialize pending selection when dialog opens
useEffect(() => {
if (open && multiple) {
setPendingSelection(new Set(Array.isArray(value) ? value : []));
}
}, [open, multiple, value]);
// Debounced search
const handleSearchChange = useCallback(
(query: string) => {
setSearchQuery(query);
setCurrentPage(1);
if (debounceTimer.current) {
clearTimeout(debounceTimer.current);
}
debounceTimer.current = setTimeout(() => {
fetchRecords(query || undefined, 1, currentSort);
}, 300);
| data-testid="record-picker-loading-overlay" | ||
| > |
| <Loader2 className="size-6 animate-spin text-muted-foreground" /> | ||
| </div> | ||
| )} | ||
| <Table style={Object.keys(columnWidths).length > 0 ? { tableLayout: 'fixed' } : undefined}> |



The lookup field record picker dialog had significant usability and visual gaps compared to mainstream low-code platforms. This overhaul addresses the core UX pain points.
Skeleton loading
Sticky table header
<TableHeader>is nowsticky top-0so column labels stay visible during vertical scroll.Page jump
Table styling
bg-muted/20), refined selected-row highlight (bg-primary/5), uppercase column headers withtracking-wider, rounded table border, tighter cell padding.getRowBgClasshelper for readability.Search & filter area
rounded-md border bg-muted/30container with borderless input for cleaner visual separation from the filter bar.lg:grid-cols-3on wide viewports.Responsive dialog sizing
sm:max-w-3xl lg:max-w-5xl) to properly override the baseDialogContent'ssm:max-w-lg, scaling from 768px on medium screens to 1024px on large screens for better data density.z-index discipline
z-[5],z-10) per repo guidelines (no inline styles).Fix: React Error #185 (close-reset cycle)
useEffect(depends only onopen) from the fetch-trigger effect (depends onopen+ pagination/sort/filter deps). Previously, the combined effect caused cascading state updates when closing — resettingcurrentPage/sortFieldchanged the effect's own dependencies, re-triggering it in a loop that could hit React's maximum update depth.Storybook stories
record-picker-dialog.stories.tsxwith Default, MultiSelect, and WithFilters stories using a mock DataSource with simulated latency for visual verification.Tests
Visual verification (Storybook)
Original prompt
📱 Kick off Copilot coding agent tasks wherever you are with GitHub Mobile, available on iOS and Android.