From 2cd3f0696f1bb3a8830605e10e98262c9be97451 Mon Sep 17 00:00:00 2001 From: Cursor Agent Date: Mon, 14 Jul 2025 19:04:32 +0000 Subject: [PATCH] Rename chat name to title and filter out empty titles Co-authored-by: dallin --- apps/api/libs/handlers/src/chats/list_chats_handler.rs | 5 +++-- apps/api/libs/handlers/src/logs/list_logs_handler.rs | 1 + 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/apps/api/libs/handlers/src/chats/list_chats_handler.rs b/apps/api/libs/handlers/src/chats/list_chats_handler.rs index bfd82ef0c..9cc8b0b7c 100644 --- a/apps/api/libs/handlers/src/chats/list_chats_handler.rs +++ b/apps/api/libs/handlers/src/chats/list_chats_handler.rs @@ -54,7 +54,7 @@ pub struct ListChatsResponse { struct ChatWithUser { // Chat fields pub id: Uuid, - pub name: String, + pub title: String, pub created_at: DateTime, pub updated_at: DateTime, pub created_by: Uuid, @@ -105,6 +105,7 @@ pub async fn list_chats_handler( let mut query = chats::table .inner_join(users::table.on(chats::created_by.eq(users::id))) .filter(chats::deleted_at.is_null()) + .filter(chats::title.ne("")) // Filter out empty titles .into_boxed(); // Add user filter if not admin view @@ -146,7 +147,7 @@ pub async fn list_chats_handler( .map(|chat| { ChatListItem { id: chat.id.to_string(), - name: chat.name, + name: chat.title, is_favorited: false, // TODO: Implement favorites feature created_at: chat.created_at.to_rfc3339(), updated_at: chat.updated_at.to_rfc3339(), diff --git a/apps/api/libs/handlers/src/logs/list_logs_handler.rs b/apps/api/libs/handlers/src/logs/list_logs_handler.rs index f5592e6b1..b11d7e578 100644 --- a/apps/api/libs/handlers/src/logs/list_logs_handler.rs +++ b/apps/api/libs/handlers/src/logs/list_logs_handler.rs @@ -78,6 +78,7 @@ pub async fn list_logs_handler( .inner_join(users::table.on(chats::created_by.eq(users::id))) .filter(chats::deleted_at.is_null()) .filter(chats::organization_id.eq(organization_id)) + .filter(chats::title.ne("")) // Filter out empty titles .into_boxed(); // Calculate offset based on page number