Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

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

Aperta Adatta ai principianti
#3,284 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
2/5
Tempo stimato
1-3 ore
Idoneità per principianti
76/100
Tipo di issue
Funzionalità
Chiarezza
Specificata chiaramente
Stato di attività
Tranquilla
Stack tecnologico
typescript
Ambito
frontend

Direzione di ricerca

Inizia da frontend/app/view/processviewer/processviewer.tsx, in particolare dal tipo SortCol e dall’inizializzazione predefinita dell’atomo alle righe 32 e 113-114. Segui il modo in cui i metadati del blocco vengono letti per il widget processviewer, quindi verifica che le due chiavi dei metadati richieste impostino l’ordinamento iniziale, mentre il comportamento manuale di riordinamento tramite clic rimanga invariato.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

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.

Lingua principale
Go
Stelle
22.3k
Fork
1.1k
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Guida per i contributori

Apri la guida per i contributori

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di wavetermdev/waveterm

Tutte le issue di wavetermdev/waveterm

Issue simili

Altre issue su Go

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.