Allow configuring default sort column for the processviewer widget via meta key
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 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.
- 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
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- 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.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của wavetermdev/waveterm
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 84/100
wavetermdev/waveterm#3481 · 1 bình luận ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
wavetermdev/waveterm#3435 ·
-
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 85/100
wavetermdev/waveterm#3432 ·
-
enhancement triage
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
wavetermdev/waveterm#3431 ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 86/100
wavetermdev/waveterm#3428 ·
Tất cả issue của wavetermdev/waveterm
Issue tương tự
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 65/100
-
bug group: validation priority: low
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
codecheckers/chekhov#51 ·
-
Creating worktree from an existing remote branch with a slash in it, has unexpected behaviour Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 70/100
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100