From 0d15177735a86755ce282e14b243f5c756fb422b Mon Sep 17 00:00:00 2001 From: Tw93 Date: Tue, 6 Jan 2026 21:07:51 +0800 Subject: [PATCH] refactor: remove `trimName` and `renderGPUCard` functions --- cmd/analyze/format.go | 4 ---- cmd/status/view.go | 22 ---------------------- 2 files changed, 26 deletions(-) diff --git a/cmd/analyze/format.go b/cmd/analyze/format.go index 2350879..5ef48d6 100644 --- a/cmd/analyze/format.go +++ b/cmd/analyze/format.go @@ -179,10 +179,6 @@ func calculateNameWidth(termWidth int) int { return available } -func trimName(name string) string { - return trimNameWithWidth(name, 45) // Default width for backward compatibility -} - func trimNameWithWidth(name string, maxWidth int) string { const ( ellipsis = "..." diff --git a/cmd/status/view.go b/cmd/status/view.go index 82a4a49..bdacced 100644 --- a/cmd/status/view.go +++ b/cmd/status/view.go @@ -213,28 +213,6 @@ func renderCPUCard(cpu CPUStatus) cardData { return cardData{icon: iconCPU, title: "CPU", lines: lines} } -func renderGPUCard(gpus []GPUStatus) cardData { - var lines []string - if len(gpus) == 0 { - lines = append(lines, subtleStyle.Render("No GPU detected")) - } else { - for _, g := range gpus { - if g.Usage >= 0 { - lines = append(lines, fmt.Sprintf("Total %s %5.1f%%", progressBar(g.Usage), g.Usage)) - } - coreInfo := "" - if g.CoreCount > 0 { - coreInfo = fmt.Sprintf(" (%d cores)", g.CoreCount) - } - lines = append(lines, g.Name+coreInfo) - if g.Usage < 0 { - lines = append(lines, subtleStyle.Render("Run with sudo for usage metrics")) - } - } - } - return cardData{icon: iconGPU, title: "GPU", lines: lines} -} - func renderMemoryCard(mem MemoryStatus) cardData { // Check if swap is being used (or at least allocated). hasSwap := mem.SwapTotal > 0 || mem.SwapUsed > 0