pub fn truncate_path(path: &str, max_width: usize) -> StringExpand description
Smart path truncation that preserves the filename.
Guarantee: Output length will NEVER exceed max_width characters.
§Examples
use batuta_common::display::truncate_path;
assert_eq!(truncate_path("/home/user/documents/file.txt", 20), "/home/user…/file.txt");
assert_eq!(truncate_path("/a/b/c.txt", 20), "/a/b/c.txt");