fix: AI review loading UX and Gate preview snapshot time filter SQL

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
dekun
2026-06-05 13:51:16 +08:00
parent 86a6081090
commit 4ac4c062e0
8 changed files with 264 additions and 36 deletions
+7 -2
View File
@@ -92,9 +92,14 @@ def sql_list_time_field(*columns):
"""
SQLite 列表时间窗比较表达式。
journal_entries 的 open/close 可能含 'T',直接与 bounds(空格格式)比会误判为超出上界。
单列时不用 COALESCESQLite 要求 COALESCE 至少 2 个参数)。
"""
cols = ", ".join(columns)
return f"REPLACE(COALESCE({cols}), 'T', ' ')"
cols = [c for c in columns if c]
if not cols:
raise ValueError("sql_list_time_field requires at least one column")
if len(cols) == 1:
return f"REPLACE({cols[0]}, 'T', ' ')"
return f"REPLACE(COALESCE({', '.join(cols)}), 'T', ' ')"
SESSION_KEY_LIST_WIN = "list_win_filter"