fix: remove the 2-column left margin from the CPU Activity panel box (#281)
## Summary Removes the hardcoded 2-space left margin from the CPU Activity panel box in `src/ui/activity_panel.rs` so its border starts at column 0, matching the GPU box and every other content row in local view mode. ## What changed Deleted the five `print_colored_text(stdout, " ", ...)` panel-margin prints: the top border, the bottom border, and the content-row border-open sites in `draw_individual_cores`, `draw_cluster_line`, and `draw_socket_group_bars`; the inter-core spacing print between core-bar groups on the same line was left untouched since it is unrelated to the margin. Adjusted the width math that had accounted for the margin: border `inner_width` now subtracts 2 (corners only) instead of 4, and each `content_width` now subtracts 4 (border chars + inner padding) instead of 6, so the CPU graph and core bars gain 2 columns; the leading-offset constant in the three content-row padding (`used`) computations was updated from 4 to 2 chars to match. Removed the now-unused `left_margin` parameter from `multirow_graph_lines` entirely (both call sites pass no margin) and updated its doc comment; updated the GPU call site in `src/ui/gpu_sparkline_panel.rs` (`draw_gpu_util_graph`) accordingly, with unchanged behavior since it already passed an empty string, and refreshed its now-stale "no left margin unlike CPU panel" comment. `panel_height` and `gpu_content_rows` were left untouched, since heights do not depend on the margin. Added a regression test (`test_cpu_panel_lines_start_at_column_zero_and_fit_panel_width`) asserting every CPU-panel line, in both fallback and multirow modes across all three collapse strategies, starts with a box-drawing border character after ANSI escapes are stripped and is exactly `panel_width` columns wide. ## Test plan - [x] `cargo test --lib ui::activity_panel` - [x] `cargo test --lib ui::gpu_sparkline_panel` - [x] `cargo test --lib ui::layout` - [x] `cargo check --lib --tests` - [x] `cargo clippy --lib --tests -- -D warnings` - [x] `cargo fmt` ## Note While building the regression test, three separate pre-existing width bugs unrelated to this margin fix surfaced: `draw_individual_cores`'s trailing-partial-line padding undercounts by one spacing unit, `draw_bar` overflows its requested width whenever that width is below 17 columns, and `draw_panel_top_border` does not truncate an oversized title. These were out of scope here; the regression test's fixtures and widths were chosen to avoid exercising those paths. Worth filing as follow-up issues. Closes #280
J
Jeongkyu Shin committed
be01be5c841361660c18ef9a6439985f1659e22d
Parent: cb7e8aa
Committed by GitHub <noreply@github.com>
on 7/20/2026, 4:19:13 AM