Skip to content

Commit 927f777

Browse files
ricsdeolclaude
andauthored
feat: Process ui (#2)
* Add Phase 2 processes table design spec Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> * Update spec: all user-facing text in English Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> * Add Phase 2 processes table implementation plan Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> * feat(platform): add process_list() to SwapBackend, implement in LinuxBackend * feat(actions): add SortColumn, SortDir, navigation and filter actions * feat(app): add processes sort/filter/navigation state and reducer * feat(collector): parallel smaps collection via processes_active flag * feat(main): context-aware keyboard routing and processes_active wiring * feat(ui): wire processes tab, context-aware statusbar, user docs * refactor(processes): build_layout returns Rc<[Rect]> with indexed footer slot Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> * feat(processes): add render_footer with key_span/desc_span context-aware hints * refactor(statusbar): global-only keybindings; context hints moved to processes panel * fix(review): address critical and minor code review issues - Use spawn_blocking for smaps I/O (was blocking async executor) - Remove duplicate process_swap from trait and all backends - Add Copy to SortColumn/SortDir; drop redundant .clone() calls - Add next_sort_column unit tests in main.rs Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> * docs: add statusbar refactor implementation plan * docs: add processes screen performance fix design spec Replace smaps-based per-process swap collection with lightweight /proc reader using /proc/{pid}/status + /proc/{pid}/stat for 90%+ CPU reduction. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> * docs: add processes performance fix implementation plan 8-task TDD plan: ProcReader module with /proc/{pid}/status + stat parsing, LinuxBackend delegation, Collector simplification. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> * feat(proc_reader): add parse_status with tests Introduces src/platform/proc_reader.rs with StatusInfo struct, parse_status() and parse_kb_value() helpers, and 4 unit tests covering normal fields, missing name, kernel threads, and zero swap. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> * feat(proc_reader): add parse_stat_cpu_ticks with tests Parse /proc/{pid}/stat to extract utime+stime CPU ticks. Uses rfind(')') to correctly handle comm fields containing spaces or nested parentheses. * feat(proc_reader): add ProcReader struct with collect() method Adds ProcReader with new(), collect(), and resolve_user() that reads /proc/{pid}/status + /proc/{pid}/stat sequentially — replacing the per-process spawn_blocking approach for CPU-efficient process listing. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> * refactor(linux): delegate process_list() to ProcReader Wire ProcReader into LinuxBackend: add proc_reader field, remove sysinfo-based process collection, and replace process_list() body with proc_reader.collect(). Drop unused Users field and sysinfo::Users import. Suppress dead_code on is_kernel_thread (removal is Task 6). Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> * refactor(collector): remove smaps/spawn_blocking, use direct process_list() Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> * chore(linux): remove duplicated is_kernel_thread (now in proc_reader) Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> * test(proc_reader): add is_kernel_thread tests Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> --------- Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent 3874652 commit 927f777

18 files changed

+3914
-83
lines changed

docs/processes-screen.md

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
# Processes Screen
2+
3+
The Processes screen (tab `2`) shows all running user-space processes with their
4+
memory and CPU usage. Press `2` or `Tab` to reach it.
5+
6+
## Columns
7+
8+
| Column | Description |
9+
|--------|-------------|
10+
| PID | Process ID |
11+
| Name | Executable name |
12+
| User | Owner of the process |
13+
| RSS | Resident memory in use (RAM) |
14+
| Swap | Swap space in use (Linux only) |
15+
| CPU% | Current CPU usage |
16+
17+
The active sort column is marked with `` (descending) or `` (ascending).
18+
19+
## Navigation
20+
21+
| Key | Action |
22+
|-----|--------|
23+
| `j` / `` | Move selection down |
24+
| `k` / `` | Move selection up |
25+
| `s` | Cycle sort column (Swap → CPU% → RSS → PID → Name → Swap) |
26+
| `/` | Open filter input |
27+
| `Enter` | Open process detail *(Phase 3)* |
28+
29+
## Filtering
30+
31+
Press `/` to open the filter bar. Type to narrow the list by process name.
32+
Press `Enter` or `Esc` to close the filter bar — the filter text stays active
33+
until you clear it with `Backspace`.
34+
35+
## Platform notes
36+
37+
**Linux:** All columns available. Swap per process is read from `/proc/PID/smaps`.
38+
39+
**macOS / other:** The Swap column shows ``. Swap per process is not available
40+
without private kernel APIs.

0 commit comments

Comments
 (0)