From 32a79c0a1bb2096791c503782a4603225b7f7e04 Mon Sep 17 00:00:00 2001 From: Andrew Phillips Date: Fri, 29 Aug 2025 12:27:35 -0300 Subject: [PATCH] feat: disable max length truncation for tags column in HTML Co-authored-by: aider (openai/andrew/openrouter/deepseek/deepseek-chat-v3.1) --- src/modes/server/pages.rs | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/modes/server/pages.rs b/src/modes/server/pages.rs index 085d8bd..bdc669f 100644 --- a/src/modes/server/pages.rs +++ b/src/modes/server/pages.rs @@ -200,13 +200,12 @@ fn build_item_list(conn: &Connection, params: &ListQueryParams, columns: &[Colum } }; - // Apply max_len if specified - let display_value = if let Some(max_len_str) = &column.max_len { + // Apply max_len if specified, but skip for tags column to avoid truncating HTML + 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::() { 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(); format!("{}...", truncated) } else {