fn truncate_filename(name: &str, max_chars: usize) -> String
Truncate a filename to a maximum character limit, appending an ellipsis if needed.