pub fn truncate(s: &str, max_len: usize) -> String
Truncate a string to a maximum length, adding ellipsis if needed. Handles tabs by replacing with spaces and trims whitespace.