Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

Allow configuring default sort column for the processviewer widget via meta key

Open Beginner friendly
#3,284 0 comments 0 reactions 0 assignees View on GitHub

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 the SortCol values ("pid" | "command" | "user" | "cpu" | "mem" | "status" | "threads"), default "cpu"
  • processviewer:sortdesc — bool, default true

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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from wavetermdev/waveterm

All issues in wavetermdev/waveterm

Similar issues

More Go issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.