Skip to content

fix: wire navOverlay.handleClick into list view row click handlers#882

Merged
hotlong merged 3 commits intomainfrom
copilot/fix-row-click-navigation
Feb 27, 2026
Merged

fix: wire navOverlay.handleClick into list view row click handlers#882
hotlong merged 3 commits intomainfrom
copilot/fix-row-click-navigation

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Feb 27, 2026

Row clicks in list views fell back to onEdit (edit form) instead of routing through navOverlay.handleClick, which handles drawer/modal/page navigation modes. The useNavigationOverlay hook was also missing its onNavigate callback, so mode: 'page' was a no-op.

Changes

  • PluginObjectView.onRowClick — fallback changed from onEditnavOverlay.handleClick
  • renderListView onRowClick — fallback changed from editHandlernavOverlay.handleClick
  • useNavigationOverlay init — added onNavigate that sets recordId search param for page-mode navigation
  • Dependency array — added navOverlay to renderListView useCallback deps
- onRowClick={onRowClick || ((record: any) => onEdit?.(record))}
+ onRowClick={onRowClick || ((record: any) => {
+     navOverlay.handleClick(record);
+ })}
  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);
+     },
  });

🔒 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.

@vercel
Copy link
Copy Markdown

vercel Bot commented Feb 27, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
objectui Ready Ready Preview, Comment Feb 27, 2026 4:23am
objectui-demo Ready Ready Preview, Comment Feb 27, 2026 4:23am
objectui-storybook Canceled Canceled Feb 27, 2026 4:23am

Request Review

…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>
Copilot AI changed the title [WIP] Fix navigation on row click in list view fix: wire navOverlay.handleClick into list view row click handlers Feb 27, 2026
@hotlong hotlong marked this pull request as ready for review February 27, 2026 04:19
Copilot AI review requested due to automatic review settings February 27, 2026 04:19
@hotlong hotlong merged commit f8f6f9d into main Feb 27, 2026
5 of 6 checks passed
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 onNavigate callback to useNavigationOverlay initialization in ObjectView.
  • Updated PluginObjectView and renderListView row-click fallbacks to call navOverlay.handleClick instead of onEdit / editHandler.
  • Updated renderListView’s useCallback dependency 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.

Comment on lines 425 to +432
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);
},
Copy link

Copilot AI Feb 27, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copilot uses AI. Check for mistakes.
Comment on lines +606 to +610
})}
dataSource={ds}
/>
);
}, [activeView, objectDef, objectName, refreshKey]);
}, [activeView, objectDef, objectName, refreshKey, navOverlay]);
Copy link

Copilot AI Feb 27, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copilot uses AI. Check for mistakes.
Comment thread ROADMAP.md

### 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.
Copy link

Copilot AI Feb 27, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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).

Suggested change
**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.

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants