@@ -128,10 +128,6 @@ function escapeHtml(text: string): string {
128128 return text . replace ( / [ & < > " ' ] / g, c => map [ c ] ) ;
129129}
130130
131- function formatDataViewPanelTitle ( baseTitle : string , totalRows : number ) : string {
132- return `${ baseTitle } (rows: ${ totalRows . toLocaleString ( ) } )` ;
133- }
134-
135131function attachDynamicDataViewBridge ( panel : vscode . WebviewPanel , viewId : string , baseTitle : string ) : void {
136132 const postResponse = ( requestId : number , ok : boolean , result ?: unknown , error ?: string ) => {
137133 void panel . webview . postMessage ( {
@@ -158,9 +154,7 @@ function attachDynamicDataViewBridge(panel: vscode.WebviewPanel, viewId: string,
158154 if ( ! result || typeof result . totalRows !== 'number' ) {
159155 throw new Error ( 'Invalid dataview_init response: missing or invalid totalRows' ) ;
160156 }
161- if ( Number . isFinite ( result . totalRows ) ) {
162- panel . title = formatDataViewPanelTitle ( baseTitle , result . totalRows ) ;
163- }
157+ panel . title = baseTitle ;
164158 postResponse ( msg . requestId , true , result ) ;
165159 return ;
166160 }
@@ -179,9 +173,7 @@ function attachDynamicDataViewBridge(panel: vscode.WebviewPanel, viewId: string,
179173 if ( ! result || typeof result . totalRows !== 'number' ) {
180174 throw new Error ( 'Invalid dataview_page response: missing or invalid totalRows' ) ;
181175 }
182- if ( Number . isFinite ( result . totalRows ) ) {
183- panel . title = formatDataViewPanelTitle ( baseTitle , result . totalRows ) ;
184- }
176+ panel . title = baseTitle ;
185177 postResponse ( msg . requestId , true , result ) ;
186178 return ;
187179 }
@@ -637,25 +629,22 @@ export function openExternalBrowser(): void {
637629 }
638630}
639631
640- export async function showDataView ( source : string , type : string , title : string , file : string , viewer : string , viewId ?: string , totalRows ?: number ) : Promise < void > {
632+ export async function showDataView ( source : string , type : string , title : string , file : string , viewer : string , viewId ?: string ) : Promise < void > {
641633 console . info ( `[showDataView] source: ${ source } , type: ${ type } , title: ${ title } , file: ${ file } , viewer: ${ viewer } , viewId: ${ String ( viewId ?? '' ) } ` ) ;
642- const panelTitle = totalRows !== undefined && Number . isFinite ( totalRows )
643- ? formatDataViewPanelTitle ( title , totalRows )
644- : title ;
645634
646635 if ( source === 'table' ) {
647636 if ( viewId ) {
648637 const existing = dynamicDataViewPanels . get ( viewId ) ;
649638 if ( existing ) {
650- existing . title = panelTitle ;
639+ existing . title = title ;
651640 existing . reveal ( ViewColumn [ viewer as keyof typeof ViewColumn ] , true ) ;
652641 const content = await getTableHtml ( existing . webview , undefined , title ) ;
653642 existing . webview . html = `${ content } \n<!-- dataview-reload:${ ++ dynamicDataViewReloadRevision } -->` ;
654643 return ;
655644 }
656645 }
657646
658- const panel = window . createWebviewPanel ( 'dataview' , panelTitle ,
647+ const panel = window . createWebviewPanel ( 'dataview' , title ,
659648 {
660649 preserveFocus : true ,
661650 viewColumn : ViewColumn [ viewer as keyof typeof ViewColumn ] ,
@@ -1574,7 +1563,6 @@ async function handleNotification(message: Record<string, unknown>, socket: IpcS
15741563 String ( params . file ?? '' ) ,
15751564 viewer ,
15761565 params . view_id ? String ( params . view_id ) : undefined ,
1577- typeof params . total_rows === 'number' ? params . total_rows : undefined ,
15781566 ) ;
15791567 }
15801568 }
0 commit comments