Skip to content

Commit bd9d25e

Browse files
shanselmanCopilot
andcommitted
fix: keyhints clipping, truncated name detail loading, bump 0.2.1
- Increase status bar keyhints length from 50 to 56 to prevent text clipping (PR #21 by @andrexx) - Only check package ID (not name) for truncation, so packages with truncated names but valid IDs can still load details (PR #22 by @athamala) - Extended truncated ID test to cover truncated-name-only case Closes #21, closes #22 Co-authored-by: Copilot <[email protected]>
1 parent 30f12c3 commit bd9d25e

File tree

4 files changed

+9
-4
lines changed

4 files changed

+9
-4
lines changed

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "winget-tui"
3-
version = "0.2.0"
3+
version = "0.2.1"
44
edition = "2021"
55
description = "A terminal user interface for Windows Package Manager (winget)"
66
license = "MIT"

src/cli_backend.rs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -687,9 +687,10 @@ Name Id Vers
687687
---------------------------------------------------------------------------------------
688688
Bluesky MSIX\\bsky.app-C52C8C38_1.0.0.0_neutr\u{2026} 1.0.0.0
689689
Slack SlackTechnologies.Slack 4.48.92.0
690+
Microsoft Windows Desktop Runtime 10.\u{2026} Microsoft.DotNet.DesktopRuntime.10 10.0.4
690691
";
691692
let packages = backend.parse_packages_from_table(output);
692-
assert_eq!(packages.len(), 2);
693+
assert_eq!(packages.len(), 3);
693694
assert!(
694695
packages[0].is_truncated(),
695696
"truncated MSIX ID should be detected"
@@ -698,6 +699,10 @@ Slack SlackTechnologies.Slack 4.48
698699
!packages[1].is_truncated(),
699700
"normal ID should not be truncated"
700701
);
702+
assert!(
703+
!packages[2].is_truncated(),
704+
"normal ID with truncated name should not be truncated"
705+
);
701706
}
702707

703708
#[test]

src/models.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ impl Package {
5656
/// Returns true if the package ID was truncated by winget (ends with '…').
5757
/// Truncated IDs cannot be used with `winget show --exact`.
5858
pub fn is_truncated(&self) -> bool {
59-
self.id.ends_with('…') || self.name.ends_with('…')
59+
self.id.ends_with('…')
6060
}
6161
}
6262

src/ui.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -508,7 +508,7 @@ fn draw_status_bar(f: &mut Frame, app: &App, area: Rect) {
508508
.constraints([
509509
Constraint::Length(14), // filter badge
510510
Constraint::Min(1), // status message
511-
Constraint::Length(50), // keyhints
511+
Constraint::Length(56), // keyhints
512512
])
513513
.split(area);
514514

0 commit comments

Comments
 (0)