@@ -153,7 +153,11 @@ export class ProcessViewerViewModel implements ViewModel {
153153 const containerHeight = globalStore . get ( this . containerHeightAtom ) ;
154154 const conn = globalStore . get ( this . connection ) ;
155155 const textSearch = globalStore . get ( this . textSearchAtom ) ;
156+ const connStatus = globalStore . get ( this . connStatus ) ;
156157
158+ if ( ! connStatus ?. connected ) {
159+ return ;
160+ }
157161 const start = Math . max ( 0 , Math . floor ( scrollTop / RowHeight ) - OverscanRows ) ;
158162 const visibleRows = containerHeight > 0 ? Math . ceil ( containerHeight / RowHeight ) : 50 ;
159163 const limit = visibleRows + OverscanRows * 2 ;
@@ -190,6 +194,10 @@ export class ProcessViewerViewModel implements ViewModel {
190194
191195 async doKeepAlive ( ) {
192196 if ( this . disposed ) return ;
197+ const connStatus = globalStore . get ( this . connStatus ) ;
198+ if ( ! connStatus ?. connected ) {
199+ return ;
200+ }
193201 const conn = globalStore . get ( this . connection ) ;
194202 const route = makeConnRoute ( conn ) ;
195203 try {
@@ -871,6 +879,7 @@ export const ProcessViewerView: React.FC<ViewComponentProps<ProcessViewerViewMod
871879 const [ selectedPid , setSelectedPid ] = jotai . useAtom ( model . selectedPidAtom ) ;
872880 const dataStart = jotai . useAtomValue ( model . dataStartAtom ) ;
873881 const connection = jotai . useAtomValue ( model . connection ) ;
882+ const connStatus = jotai . useAtomValue ( model . connStatus ) ;
874883 const bodyScrollRef = React . useRef < HTMLDivElement > ( null ) ;
875884 const containerRef = React . useRef < HTMLDivElement > ( null ) ;
876885 const [ wide , setWide ] = React . useState ( false ) ;
@@ -976,33 +985,36 @@ export const ProcessViewerView: React.FC<ViewComponentProps<ProcessViewerViewMod
976985
977986 { /* outer h-scroll wrapper */ }
978987 < div className = "flex-1 overflow-x-auto overflow-y-hidden" >
979- { /* inner column — expands to header's natural width, rows match */ }
980- < div className = "flex flex-col h-full min-w-full w-max" >
981- < TableHeader model = { model } sortBy = { sortBy } sortDesc = { sortDesc } platform = { platform } />
982-
983- { /* virtualized rows — same width as header, scrolls vertically */ }
984- < div
985- ref = { bodyScrollRef }
986- className = "flex-1 overflow-y-auto overflow-x-hidden w-full wide-scrollbar"
987- onScroll = { handleScroll }
988- >
989- < div style = { { height : totalHeight , position : "relative" } } >
990- < div style = { { position : "absolute" , top : paddingTop , left : 0 , right : 0 } } >
991- { processes . map ( ( proc ) => (
992- < ProcessRow
993- key = { proc . pid }
994- proc = { proc }
995- hasCpu = { hasCpu }
996- platform = { platform }
997- selected = { selectedPid === proc . pid }
998- onSelect = { handleSelectPid }
999- onContextMenu = { handleContextMenu }
1000- />
1001- ) ) }
988+ { ! connStatus ?. connected ? (
989+ < div className = "flex items-center justify-center h-full text-secondary text-sm" >
990+ Waiting for connection…
991+ </ div >
992+ ) : (
993+ < div className = "flex flex-col h-full min-w-full w-max" >
994+ < TableHeader model = { model } sortBy = { sortBy } sortDesc = { sortDesc } platform = { platform } />
995+ < div
996+ ref = { bodyScrollRef }
997+ className = "flex-1 overflow-y-auto overflow-x-hidden w-full wide-scrollbar"
998+ onScroll = { handleScroll }
999+ >
1000+ < div style = { { height : totalHeight , position : "relative" } } >
1001+ < div style = { { position : "absolute" , top : paddingTop , left : 0 , right : 0 } } >
1002+ { processes . map ( ( proc ) => (
1003+ < ProcessRow
1004+ key = { proc . pid }
1005+ proc = { proc }
1006+ hasCpu = { hasCpu }
1007+ platform = { platform }
1008+ selected = { selectedPid === proc . pid }
1009+ onSelect = { handleSelectPid }
1010+ onContextMenu = { handleContextMenu }
1011+ />
1012+ ) ) }
1013+ </ div >
10021014 </ div >
10031015 </ div >
10041016 </ div >
1005- </ div >
1017+ ) }
10061018 </ div >
10071019 < ActionStatusBar model = { model } />
10081020 </ div >
0 commit comments