fix: wire navOverlay.handleClick into list view row click handlers#882
fix: wire navOverlay.handleClick into list view row click handlers#882
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
…detail navigation Fix list view row clicks not navigating to record detail page: 1. PluginObjectView onRowClick now uses navOverlay.handleClick instead of onEdit 2. renderListView onRowClick now uses navOverlay.handleClick instead of editHandler 3. useNavigationOverlay now has onNavigate callback for page mode URL updates 4. Added navOverlay to renderListView useCallback dependency array Co-authored-by: hotlong <50353452+hotlong@users.noreply.github.com>
Co-authored-by: hotlong <50353452+hotlong@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
Fixes ListView row-click navigation in the Console ObjectView by routing clicks through useNavigationOverlay (so drawer/modal/page modes work consistently) and documents the bugfix in the roadmap.
Changes:
- Added an
onNavigatecallback touseNavigationOverlayinitialization inObjectView. - Updated
PluginObjectViewandrenderListViewrow-click fallbacks to callnavOverlay.handleClickinstead ofonEdit/editHandler. - Updated
renderListView’suseCallbackdependency array and added a roadmap entry describing the fix.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| apps/console/src/components/ObjectView.tsx | Wires row clicks to navOverlay.handleClick and adds onNavigate callback for navigation modes. |
| ROADMAP.md | Adds a February 2026 bugfix entry describing the row-click navigation issue and fix. |
| const navOverlay = useNavigationOverlay({ | ||
| navigation: detailNavigation, | ||
| objectName: objectDef.name, | ||
| onNavigate: (recordId: string | number, _action?: string) => { | ||
| const newParams = new URLSearchParams(searchParams); | ||
| newParams.set('recordId', String(recordId)); | ||
| setSearchParams(newParams); | ||
| }, |
There was a problem hiding this comment.
In mode: 'page', useNavigationOverlay delegates navigation via onNavigate, but this implementation only sets a recordId search param. In this component, that query param is only used to control the overlay open state, and NavigationOverlay renders nothing for mode === 'page', so page-mode row clicks will still not show the record detail page. Consider using navigate to the existing :objectName/record/:recordId route (and optionally preserve current search params) instead of setting the recordId query param.
| })} | ||
| dataSource={ds} | ||
| /> | ||
| ); | ||
| }, [activeView, objectDef, objectName, refreshKey]); | ||
| }, [activeView, objectDef, objectName, refreshKey, navOverlay]); |
There was a problem hiding this comment.
renderListView now depends on the entire navOverlay object. useNavigationOverlay returns a memoized object that changes whenever isOpen/selectedRecord changes, so this will recreate renderListView on every overlay open/close (and potentially trigger unnecessary re-renders/refetches downstream). Prefer depending on a stable function like navOverlay.handleClick (or memoizing a handleRowClick callback) rather than the full overlay state object.
|
|
||
| ### List View Row Click Not Navigating to Record Detail (February 2026) | ||
|
|
||
| **Root Cause:** `onRowClick` in both `PluginObjectView` (line 772) and `renderListView` (line 599) of `ObjectView.tsx` fell back to `onEdit` / `editHandler`, which only opens an edit form. The `navOverlay.handleClick` from `useNavigationOverlay` — which handles drawer/modal/page navigation modes — was never connected to these click handlers. Additionally, the `useNavigationOverlay` hook was missing the `onNavigate` callback needed for `mode: 'page'` to update the URL. |
There was a problem hiding this comment.
This roadmap entry hard-codes ObjectView.tsx line numbers ("line 772" / "line 599"), but the current code no longer matches those locations. Line-number references tend to become stale quickly; consider removing them or updating them to something more stable (e.g., function/prop names, or a permalink to the commit).
| **Root Cause:** `onRowClick` in both `PluginObjectView` (line 772) and `renderListView` (line 599) of `ObjectView.tsx` fell back to `onEdit` / `editHandler`, which only opens an edit form. The `navOverlay.handleClick` from `useNavigationOverlay` — which handles drawer/modal/page navigation modes — was never connected to these click handlers. Additionally, the `useNavigationOverlay` hook was missing the `onNavigate` callback needed for `mode: 'page'` to update the URL. | |
| **Root Cause:** `onRowClick` in both the `PluginObjectView` component and the `renderListView` helper of `ObjectView.tsx` fell back to `onEdit` / `editHandler`, which only opens an edit form. The `navOverlay.handleClick` from `useNavigationOverlay` — which handles drawer/modal/page navigation modes — was never connected to these click handlers. Additionally, the `useNavigationOverlay` hook was missing the `onNavigate` callback needed for `mode: 'page'` to update the URL. |
Row clicks in list views fell back to
onEdit(edit form) instead of routing throughnavOverlay.handleClick, which handles drawer/modal/page navigation modes. TheuseNavigationOverlayhook was also missing itsonNavigatecallback, somode: 'page'was a no-op.Changes
PluginObjectView.onRowClick— fallback changed fromonEdit→navOverlay.handleClickrenderListViewonRowClick — fallback changed fromeditHandler→navOverlay.handleClickuseNavigationOverlayinit — addedonNavigatethat setsrecordIdsearch param for page-mode navigationnavOverlaytorenderListViewuseCallback depsconst navOverlay = useNavigationOverlay({ navigation: detailNavigation, objectName: objectDef.name, + onNavigate: (recordId: string | number, _action?: string) => { + const newParams = new URLSearchParams(searchParams); + newParams.set('recordId', String(recordId)); + setSearchParams(newParams); + }, });🔒 GitHub Advanced Security automatically protects Copilot coding agent pull requests. You can protect all pull requests by enabling Advanced Security for your repositories. Learn more about Advanced Security.