Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
60 changes: 36 additions & 24 deletions frontend/app/view/processviewer/processviewer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,11 @@ export class ProcessViewerViewModel implements ViewModel {
const containerHeight = globalStore.get(this.containerHeightAtom);
const conn = globalStore.get(this.connection);
const textSearch = globalStore.get(this.textSearchAtom);
const connStatus = globalStore.get(this.connStatus);

if (!connStatus?.connected) {
return;
}
Comment thread
coderabbitai[bot] marked this conversation as resolved.
const start = Math.max(0, Math.floor(scrollTop / RowHeight) - OverscanRows);
const visibleRows = containerHeight > 0 ? Math.ceil(containerHeight / RowHeight) : 50;
const limit = visibleRows + OverscanRows * 2;
Expand Down Expand Up @@ -190,6 +194,10 @@ export class ProcessViewerViewModel implements ViewModel {

async doKeepAlive() {
if (this.disposed) return;
const connStatus = globalStore.get(this.connStatus);
if (!connStatus?.connected) {
return;
}
const conn = globalStore.get(this.connection);
const route = makeConnRoute(conn);
try {
Expand Down Expand Up @@ -871,6 +879,7 @@ export const ProcessViewerView: React.FC<ViewComponentProps<ProcessViewerViewMod
const [selectedPid, setSelectedPid] = jotai.useAtom(model.selectedPidAtom);
const dataStart = jotai.useAtomValue(model.dataStartAtom);
const connection = jotai.useAtomValue(model.connection);
const connStatus = jotai.useAtomValue(model.connStatus);
const bodyScrollRef = React.useRef<HTMLDivElement>(null);
const containerRef = React.useRef<HTMLDivElement>(null);
const [wide, setWide] = React.useState(false);
Expand Down Expand Up @@ -976,33 +985,36 @@ export const ProcessViewerView: React.FC<ViewComponentProps<ProcessViewerViewMod

{/* outer h-scroll wrapper */}
<div className="flex-1 overflow-x-auto overflow-y-hidden">
{/* inner column — expands to header's natural width, rows match */}
<div className="flex flex-col h-full min-w-full w-max">
<TableHeader model={model} sortBy={sortBy} sortDesc={sortDesc} platform={platform} />

{/* virtualized rows — same width as header, scrolls vertically */}
<div
ref={bodyScrollRef}
className="flex-1 overflow-y-auto overflow-x-hidden w-full wide-scrollbar"
onScroll={handleScroll}
>
<div style={{ height: totalHeight, position: "relative" }}>
<div style={{ position: "absolute", top: paddingTop, left: 0, right: 0 }}>
{processes.map((proc) => (
<ProcessRow
key={proc.pid}
proc={proc}
hasCpu={hasCpu}
platform={platform}
selected={selectedPid === proc.pid}
onSelect={handleSelectPid}
onContextMenu={handleContextMenu}
/>
))}
{!connStatus?.connected ? (
<div className="flex items-center justify-center h-full text-secondary text-sm">
Waiting for connection…
</div>
) : (
<div className="flex flex-col h-full min-w-full w-max">
<TableHeader model={model} sortBy={sortBy} sortDesc={sortDesc} platform={platform} />
<div
ref={bodyScrollRef}
className="flex-1 overflow-y-auto overflow-x-hidden w-full wide-scrollbar"
onScroll={handleScroll}
>
<div style={{ height: totalHeight, position: "relative" }}>
<div style={{ position: "absolute", top: paddingTop, left: 0, right: 0 }}>
{processes.map((proc) => (
<ProcessRow
key={proc.pid}
proc={proc}
hasCpu={hasCpu}
platform={platform}
selected={selectedPid === proc.pid}
onSelect={handleSelectPid}
onContextMenu={handleContextMenu}
/>
))}
</div>
</div>
</div>
</div>
</div>
)}
</div>
<ActionStatusBar model={model} />
</div>
Expand Down
1 change: 0 additions & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ require (
github.com/launchdarkly/eventsource v1.11.0
github.com/mattn/go-sqlite3 v1.14.40
github.com/mitchellh/mapstructure v1.5.0
github.com/sashabaranov/go-openai v1.41.2
github.com/sawka/txwrap v0.2.0
github.com/shirou/gopsutil/v4 v4.26.3
github.com/skeema/knownhosts v1.3.1
Expand Down
2 changes: 0 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -122,8 +122,6 @@ github.com/rivo/uniseg v0.4.7/go.mod h1:FN3SvrM+Zdj16jyLfmOkMNblXMcoc8DfTHruCPUc
github.com/rogpeppe/go-internal v1.14.1 h1:UQB4HGPB6osV0SQTLymcB4TgvyWu6ZyliaW0tI/otEQ=
github.com/rogpeppe/go-internal v1.14.1/go.mod h1:MaRKkUm5W0goXpeCfT7UZI6fk/L7L7so1lCWt35ZSgc=
github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM=
github.com/sashabaranov/go-openai v1.41.2 h1:vfPRBZNMpnqu8ELsclWcAvF19lDNgh1t6TVfFFOPiSM=
github.com/sashabaranov/go-openai v1.41.2/go.mod h1:lj5b/K+zjTSFxVLijLSTDZuP7adOgerWeFyZLUhAKRg=
github.com/sawka/txwrap v0.2.0 h1:V3LfvKVLULxcYSxdMguLwFyQFMEU9nFDJopg0ZkL+94=
github.com/sawka/txwrap v0.2.0/go.mod h1:wwQ2SQiN4U+6DU/iVPhbvr7OzXAtgZlQCIGuvOswEfA=
github.com/shirou/gopsutil/v4 v4.26.3 h1:2ESdQt90yU3oXF/CdOlRCJxrP+Am1aBYubTMTfxJ1qc=
Expand Down
Loading