feat: disable max length truncation for tags column in HTML

Co-authored-by: aider (openai/andrew/openrouter/deepseek/deepseek-chat-v3.1) <aider@aider.chat>
This commit is contained in:
Andrew Phillips
2025-08-29 12:27:35 -03:00
parent 2b0e958b1f
commit 32a79c0a1b

View File

@@ -200,13 +200,12 @@ fn build_item_list(conn: &Connection, params: &ListQueryParams, columns: &[Colum
} }
}; };
// Apply max_len if specified // Apply max_len if specified, but skip for tags column to avoid truncating HTML
let display_value = if let Some(max_len_str) = &column.max_len { let display_value = if column.name == "tags" {
value
} else if let Some(max_len_str) = &column.max_len {
if let Ok(max_len) = max_len_str.parse::<usize>() { if let Ok(max_len) = max_len_str.parse::<usize>() {
if value.chars().count() > max_len { if value.chars().count() > max_len {
// Note: This might truncate HTML, which isn't ideal
// For simplicity, we'll just truncate the text content
// A better approach would be to strip HTML tags first, but that's more complex
let truncated: String = value.chars().take(max_len).collect(); let truncated: String = value.chars().take(max_len).collect();
format!("{}...", truncated) format!("{}...", truncated)
} else { } else {