refactor: standardize TUI sub-item indentation across all GPU renderers#184
Merged
Conversation
Define two shared constants in src/ui/renderers/utils.rs:
- SUB_ITEM_INDENT (" ", 6 spaces) for per-instance rows nested under
a GPU line (thermal/P-state, hardware-details, vGPU, MIG)
- SECTION_HEADER_INDENT (" ", 2 spaces) for section-header lines
Replace all literal indent strings at the affected sites:
- gpu_renderer: render_thermal_pstate_row and render_hardware_details_row
now use SUB_ITEM_INDENT (was 5 spaces, unified to 6)
- vgpu_renderer: header line uses SECTION_HEADER_INDENT, instance rows
use SUB_ITEM_INDENT (was " [" literal, now split into const + "[")
- mig_renderer: same pattern as vgpu_renderer
Closes #180
Member
Author
Implementation Review SummaryIntent
Findings Addressed
Remaining Items (LOW — reported, not auto-fixed)
Both items are pure documentation nits; no behavioral impact. Per configured severity threshold, auto-fix was not applied. Verification
Additional confirmations
|
Update two comments that referenced the pre-unification 5-char indent to name the shared SUB_ITEM_INDENT constant introduced in this PR.
Member
Author
PR Finalization CompleteSummary
Status transitions
All checks passing. Ready for merge. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #180
Summary
pub(crate)constants insrc/ui/renderers/utils.rs:SUB_ITEM_INDENT = " "(6 spaces) — applied to per-instance rows nested under a GPU lineSECTION_HEADER_INDENT = " "(2 spaces) — applied to section-header lines that introduce a nested blockgpu_renderer.rs:render_thermal_pstate_rowandrender_hardware_details_rownow useSUB_ITEM_INDENT(was 5 spaces, unified to 6)vgpu_renderer.rs: header line usesSECTION_HEADER_INDENT, per-instance rows useSUB_ITEM_INDENTmig_renderer.rs: same pattern as vgpu_rendererIndent value rationale
Six spaces were chosen for
SUB_ITEM_INDENTbecause two of the three affected renderers (vGPU and MIG) already used that width. The GPU renderer's secondary rows were using 5 spaces; they are unified up to 6 for visual consistency. The 2-spaceSECTION_HEADER_INDENTmatches what both vGPU and MIG renderers already used for their section-header lines — no change in appearance for those, just a named constant replacing the literal.Indent literals that did NOT map to these two categories
The following 5-space literals in
gpu_renderer.rswere intentionally left as literals — they are gauge-bar left-padding (a layout concern, not a sub-item nesting indent) and are shared with the CPU, memory, storage, and chassis renderers which are out of scope for this issue:" "before the Util/Mem gauge barscpu_renderer.rs,memory_renderer.rs,storage_renderer.rs,chassis_renderer.rs: all use 5-space left padding for gauge rows — these belong to a separate, future refactor of the gauge-padding constantThe 2-space literals in
gpu_renderer.rs(lines 452, 465, 487) are gauge separators between bars, not section-header indents — left unchanged.Test plan
cargo buildpassescargo clippy -- -D warningspasses with no warningscargo testpasses (499 unit + 547 integration tests, 0 failures)