Allow configuring default sort column for the processviewer widget via meta key
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 76/100
- Issue type
- Feature
- Clarity
- Clearly specified
- Activity status
- Quiet
- Tech stack
- typescript
- Domain
- frontend
Research direction
Start in frontend/app/view/processviewer/processviewer.tsx, especially the SortCol type and the default atom initialization at lines 32 and 113-114. Trace how block meta is read for the processviewer widget, then verify that the two requested meta keys set the initial sort while manual click-to-resort behavior remains unchanged.
Written by the indexing model from the issue text.
Description
Summary
The processviewer widget's default sort is hardcoded to CPU descending. There's no way to configure a different default — every fresh processviewer block opens sorted by CPU, and the user has to manually click another column header (e.g. Memory) every time. The sort preference doesn't persist across block recreations either, since it's stored only in a runtime atom rather than block meta.
For users who primarily care about a non-CPU column (memory hogs being the obvious case), CPU is a poor default to be locked into.
Current behavior
In frontend/app/view/processviewer/processviewer.tsx:113-114:
this.sortByAtom = jotai.atom<SortCol>("cpu");
this.sortDescAtom = jotai.atom<boolean>(true);
Hardcoded. The SortCol type at line 32 already enumerates all valid columns:
type SortCol = "pid" | "command" | "user" | "cpu" | "mem" | "status" | "threads";
On Windows the visible columns are PID / Command / CPU% / Memory (status, user, threads are hidden via hideOnPlatform), so the meaningful defaults a Windows user would want are one of those four. Other platforms get all seven.
Request
Please add meta keys to control the initial sort, e.g.:
processviewer:sortby— one of theSortColvalues ("pid" | "command" | "user" | "cpu" | "mem" | "status" | "threads"), default"cpu"processviewer:sortdesc— bool, defaulttrue
So a user can put this in their widgets.json to override the default processviewer widget to sort by memory:
"defwidget@processviewer": {
"display:order": -1,
"icon": "list-tree",
"label": "processes",
"blockdef": {
"meta": {
"view": "processviewer",
"processviewer:sortby": "mem",
"processviewer:sortdesc": true
}
}
}
Manual click-to-resort behavior would still work as today; the meta keys only control the initial state of the atoms.
- Dominant language
- Go
- Stars
- 22.3k
- Forks
- 1.1k
- PR merge metrics
- No merged PRs in 30d
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from wavetermdev/waveterm
-
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
wavetermdev/waveterm#3481 · 1 comment ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
wavetermdev/waveterm#3435 ·
-
Difficulty 1/5 Under an hour Newbie friendliness 85/100
wavetermdev/waveterm#3432 ·
-
enhancement triage
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
wavetermdev/waveterm#3431 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 86/100
wavetermdev/waveterm#3428 ·
All issues in wavetermdev/waveterm
Similar issues
-
textual definition
Difficulty 1/5 Under an hour Newbie friendliness 90/100
geneontology/go-ontology#32653 ·
-
Difficulty 1/5 Under an hour Newbie friendliness 75/100
-
needs design
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
-
Priority/High ready-for-agent Severity/Major Type/Bug
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 70/100