@@ -425,10 +425,19 @@ export function ObjectView({ dataSource, objects, onEdit, onRowClick }: any) {
425425 const navOverlay = useNavigationOverlay ( {
426426 navigation : detailNavigation ,
427427 objectName : objectDef . name ,
428- onNavigate : ( recordId : string | number , _action ?: string ) => {
429- const newParams = new URLSearchParams ( searchParams ) ;
430- newParams . set ( 'recordId' , String ( recordId ) ) ;
431- setSearchParams ( newParams ) ;
428+ onNavigate : ( recordId : string | number , action ?: string ) => {
429+ if ( action === 'new_window' ) {
430+ // Open record detail in a new browser tab with Console-correct URL
431+ const basePath = window . location . pathname . replace ( / \/ v i e w \/ .* $ / , '' ) ;
432+ window . open ( `${ basePath } /record/${ String ( recordId ) } ` , '_blank' ) ;
433+ return ;
434+ }
435+ // page / view mode — navigate to record detail page
436+ if ( viewId ) {
437+ navigate ( `../../record/${ String ( recordId ) } ` , { relative : 'path' } ) ;
438+ } else {
439+ navigate ( `record/${ String ( recordId ) } ` ) ;
440+ }
432441 } ,
433442 } ) ;
434443 const handleDrawerClose = ( ) => {
@@ -633,9 +642,15 @@ export function ObjectView({ dataSource, objects, onEdit, onRowClick }: any) {
633642 onNavigate : ( recordId : string | number , mode : 'view' | 'edit' ) => {
634643 if ( mode === 'edit' ) {
635644 onEdit ?.( { _id : recordId , id : recordId } ) ;
645+ } else if ( mode === 'view' ) {
646+ if ( viewId ) {
647+ navigate ( `../../record/${ String ( recordId ) } ` , { relative : 'path' } ) ;
648+ } else {
649+ navigate ( `record/${ String ( recordId ) } ` ) ;
650+ }
636651 }
637652 } ,
638- } ) , [ objectDef . name , onEdit , activeView ?. showSearch , activeView ?. showFilters , activeView ?. showSort ] ) ;
653+ } ) , [ objectDef . name , onEdit , activeView ?. showSearch , activeView ?. showFilters , activeView ?. showSort , navigate , viewId ] ) ;
639654
640655 return (
641656 < div className = "h-full flex flex-col bg-background min-w-0 overflow-hidden" >
@@ -767,6 +782,48 @@ export function ObjectView({ dataSource, objects, onEdit, onRowClick }: any) {
767782
768783 { /* 2. Content — Plugin ObjectView with ViewSwitcher + Filter + Sort */ }
769784 < div className = "flex-1 overflow-hidden relative flex flex-row" >
785+ { navOverlay . mode === 'split' && navOverlay . isOpen ? (
786+ < NavigationOverlay
787+ { ...navOverlay }
788+ setIsOpen = { ( open : boolean ) => { if ( ! open ) handleDrawerClose ( ) ; } }
789+ title = { objectDef . label }
790+ mainContent = {
791+ < div className = "flex-1 min-w-0 relative h-full flex flex-col" >
792+ < div className = "flex-1 relative overflow-auto p-3 sm:p-4" >
793+ < PluginObjectView
794+ schema = { objectViewSchema }
795+ dataSource = { dataSource }
796+ views = { mergedViews }
797+ activeViewId = { activeViewId }
798+ onViewChange = { handleViewChange }
799+ onEdit = { ( record : any ) => onEdit ?.( record ) }
800+ onRowClick = { onRowClick || ( ( record : any ) => {
801+ navOverlay . handleClick ( record ) ;
802+ } ) }
803+ renderListView = { renderListView }
804+ />
805+ </ div >
806+ { typeof recordCount === 'number' && (
807+ < div data-testid = "record-count-footer" className = "border-t px-3 sm:px-4 py-1.5 text-xs text-muted-foreground bg-muted/5 shrink-0" >
808+ { t ( 'console.objectView.recordCount' , { count : recordCount } ) }
809+ </ div >
810+ ) }
811+ </ div >
812+ }
813+ >
814+ { ( record : Record < string , unknown > ) => {
815+ const recordId = ( record . _id || record . id ) as string ;
816+ return (
817+ < DrawerDetailContent
818+ objectDef = { objectDef }
819+ recordId = { recordId }
820+ dataSource = { dataSource }
821+ onEdit = { onEdit }
822+ />
823+ ) ;
824+ } }
825+ </ NavigationOverlay >
826+ ) : (
770827 < div className = "flex-1 min-w-0 relative h-full flex flex-col" >
771828 < div className = "flex-1 relative overflow-auto p-3 sm:p-4" >
772829 < PluginObjectView
@@ -789,6 +846,7 @@ export function ObjectView({ dataSource, objects, onEdit, onRowClick }: any) {
789846 </ div >
790847 ) }
791848 </ div >
849+ ) }
792850 { /* Metadata panel only shows for admin users */ }
793851 < MetadataPanel
794852 open = { showDebug && isAdmin }
@@ -819,6 +877,7 @@ export function ObjectView({ dataSource, objects, onEdit, onRowClick }: any) {
819877 </ div >
820878
821879 { /* Record Detail Overlay — navigation mode driven by objectDef.navigation */ }
880+ { navOverlay . mode !== 'split' && (
822881 < NavigationOverlay
823882 { ...navOverlay }
824883 setIsOpen = { ( open : boolean ) => { if ( ! open ) handleDrawerClose ( ) ; } }
@@ -837,6 +896,7 @@ export function ObjectView({ dataSource, objects, onEdit, onRowClick }: any) {
837896 ) ;
838897 } }
839898 </ NavigationOverlay >
899+ ) }
840900 </ div >
841901 ) ;
842902}
0 commit comments