Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

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

Đang mở Phù hợp với người mới
#3,284 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Chưa có ai nhận issue này.

Đánh giá

Độ khó
2/5
Thời gian dự kiến
1-3 giờ
Mức phù hợp với người mới
76/100
Loại issue
Tính năng
Độ rõ ràng
Đặc tả rõ ràng
Mức độ hoạt động
Ít trao đổi
Công nghệ
typescript
Lĩnh vực
frontend

Hướng nghiên cứu

Bắt đầu trong frontend/app/view/processviewer/processviewer.tsx, đặc biệt là kiểu SortCol và việc khởi tạo atom mặc định ở các dòng 32 và 113-114. Theo dõi cách meta của block được đọc cho widget processviewer, sau đó xác minh rằng hai khóa meta được yêu cầu thiết lập thứ tự sắp xếp ban đầu, trong khi hành vi sắp xếp lại thủ công bằng cách nhấp vẫn không thay đổi.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

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.

Ngôn ngữ chính
Go
Star
22.3k
Fork
1.1k
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của wavetermdev/waveterm

Tất cả issue của wavetermdev/waveterm

Issue tương tự

Thêm issue về Go

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.