on main help sign in
fix(ui): strip .0 from file sizes, replace last context.TODO()

- formatSize in tools.go: strip redundant '.0' from KB/MB display (e.g. '10.0 KB' → '10 KB'), matching formatTokensAndCost behavior - config/store.go: replace last remaining context.TODO() with context.Background() in copilot token refresh

commit55b6944bc77896607c7c13d1c9f162383ea21118 authoriko <mail@iko.soy> dateThu 9 Jul 2026, 02:41 (3 months ago) parentda0ab43
2 files changed+11−3
internal/config/store.go+1−1 internal/ui/chat/tools.go+10−2
internal/config/store.go+1−1
@@ -777,7 +777,7 @@ func (s *ConfigStore) ImportCopilot() (*oauth.Token, bool) {
777777 }
778778
779779 slog.Info("Found existing GitHub Copilot token on disk. Authenticating...")
780− token, err := copilot.RefreshToken(context.TODO(), diskToken)
780+ token, err := copilot.RefreshToken(context.Background(), diskToken)
781781 if err != nil {
782782 slog.Error("Unable to import GitHub Copilot token", "error", err)
783783 return nil, false
internal/ui/chat/tools.go+10−2
@@ -968,9 +968,17 @@ func formatSize(bytes int) string {
968968 )
969969 switch {
970970 case bytes >= mb:
971− return fmt.Sprintf("%.1f MB", float64(bytes)/float64(mb))
971+ result := fmt.Sprintf("%.1f MB", float64(bytes)/float64(mb))
972+ if strings.HasSuffix(result, ".0 MB") {
973+ result = strings.Replace(result, ".0 MB", " MB", 1)
974+ }
975+ return result
972976 case bytes >= kb:
973− return fmt.Sprintf("%.1f KB", float64(bytes)/float64(kb))
977+ result := fmt.Sprintf("%.1f KB", float64(bytes)/float64(kb))
978+ if strings.HasSuffix(result, ".0 KB") {
979+ result = strings.Replace(result, ".0 KB", " KB", 1)
980+ }
981+ return result
974982 default:
975983 return fmt.Sprintf("%d B", bytes)
976984 }