diff --git a/.workbuddy/memory/2026-09-17.md b/.workbuddy/memory/2026-09-17.md index b4259b5..6a27f76 100644 --- a/.workbuddy/memory/2026-09-17.md +++ b/.workbuddy/memory/2026-09-17.md @@ -103,3 +103,18 @@ ### 待办(未做) - **运行期烟测**:起 pgvector Docker 实连,验证 GORM 把 `vector(64)` 列读进 `sql.NullString`(pgx text 格式扫描)无报错。尚未跑。 - 汉明阈值 10 可按真实样本微调。 + +## 修复 `cmd/dbtool dump` 的 42601 + Scan 报错 ✅(22:25–22:50) +`go run main.go dump` 导出 `brand` 表时连报两错,已逐个修掉: + +### 错 1:SQLSTATE 42601 `at or near ")")` +- 根因:`colQuery` 里 `c.column_name = $1` 这行第 5 列 `(c.column_default LIKE 'nextval(%'))` 多了一个右括号(应为 `nextval(%'`);多余的 `)` 让整段变 `... = $1))` 语法错。 +- 修复:改为 `(c.column_default LIKE 'nextval(%')`(单右括号,与 pkQuery 风格一致;该 `)` 是外层比较表达式收尾)。 +- 验证手段:另写 `_diag2` 临时诊断确认 `nextval(%')`(单)可查、`nextval(%'))`(双)必 42601,定位到就是这行。 + +### 错 2:`Scan error on column index 4 ... couldn't convert into type bool` +- 根因:同上第 5 列当 `column_default` 为 NULL 时 `NULL LIKE 'nextval(%'` 返回 NULL,`rows.Scan(&isIdent bool)` 无法接收 NULL → 报错(`brand` 表无 serial 列,default 全 NULL 触发)。 +- 修复:改为 `COALESCE(c.column_default LIKE 'nextval(%', false)`,把 NULL 收为 false。 + +### 验证 +`go run main.go dump` → `✓ 已导出 15 张表 -> db_dump.json`,无报错。已删除 `_diag2` 临时诊断目录。 diff --git a/src/components/CollectionListView.astro b/src/components/CollectionListView.astro new file mode 100644 index 0000000..0e4cbb6 --- /dev/null +++ b/src/components/CollectionListView.astro @@ -0,0 +1,151 @@ +--- +/** + * 列表页共享外壳:走秀 / 街拍(以及未来同构模块)的「眉头 + 筛选 pills + 左侧栏 + 右卡片网格 + 分页」标记。 + * + * 设计动机:RunwayLooks.astro 与 StreetSnaps.astro 的这段模板逐块同构,差异只有 CSS 类名 + * 前缀(shows* / snaps*)与几个开关量。本组件收口「不变的标记」,把「变的差异」通过 + * props / 具名插槽注入: + * - prefix 类名前缀,look-grid.css 里两套前缀成对定义、样式同源 + * - alpineName Alpine 组件注册名(须与页面 diff --git a/src/components/GalleryDetailLightbox.astro b/src/components/GalleryDetailLightbox.astro index 4519531..7f2b897 100644 --- a/src/components/GalleryDetailLightbox.astro +++ b/src/components/GalleryDetailLightbox.astro @@ -3,7 +3,14 @@ // 走秀(RunwayLookCard)与街拍(StreetSnapCard)共用;交互在 lib/galleryDetail.ts。 import { getI18n } from "@/lib/i18n" +interface Props { + /** 左栏副图缩略条比例,与主图一致(后端素材统一 2:3,默认值即可) */ + aspect?: "2/3" | "3/4" +} +const { aspect = "2/3" } = Astro.props const { t } = getI18n(Astro) +// 两个字面量都出现在本文件源码里,保证 Tailwind v4 JIT 能扫描到 +const thumbAspect = aspect === "3/4" ? "aspect-[3/4]" : "aspect-[2/3]" ---
@@ -54,7 +61,7 @@ const { t } = getI18n(Astro)