diff --git a/Snipaste_2026-06-11_00-26-46.png b/Snipaste_2026-06-11_00-26-46.png deleted file mode 100644 index 58063d6..0000000 Binary files a/Snipaste_2026-06-11_00-26-46.png and /dev/null differ diff --git a/docs/superpowers/plans/2026-06-11-square-tab-scroll-behavior.md b/docs/superpowers/plans/2026-06-11-square-tab-scroll-behavior.md new file mode 100644 index 0000000..0c2ada8 --- /dev/null +++ b/docs/superpowers/plans/2026-06-11-square-tab-scroll-behavior.md @@ -0,0 +1,350 @@ +# Square Tab 滚动行为差异化实现计划 + +> **For agentic workers:** REQUIRED SUB-SKILL: Use superpowers:subagent-driven-development (recommended) or superpowers:executing-plans to implement this plan task-by-task. Steps use checkbox (`- [ ]`) syntax for tracking. + +**Goal:** 在 `square.vue` 页面中,让 星河 / 星榜 / 广场 三个 tab 拥有差异化的滚动行为:星河完全禁用滚动,星榜只允许 HotCategoryBlock 内部 grid 区域滚动,广场保持当前整体滚动。 + +**Architecture:** 复用现有外层 ``,仅通过动态绑定 `:scroll-y="activeContentTab === 'guangchang'"` 控制外层是否可滚;给 `HotCategoryBlock` 内部加一个独立的 `` 包裹 grid 区域;切 tab 时重置外层 scrollTop。 + +**Tech Stack:** Vue 3 (Composition API)、uni-app、SCSS。 + +**Spec:** `docs/superpowers/specs/2026-06-11-square-tab-scroll-behavior-design.md` + +--- + +## 涉及文件 + +| 文件 | 改动 | +| --- | --- | +| `frontend/pages/square/square.vue` | scroll-view 加 `:scroll-y` 动态绑定、加 watch 重置 scrollTop、`.hot-category-wrapper` 加固定高度 | +| `frontend/pages/square/components/HotCategoryBlock.vue` | grid 区域包到内部 scroll-view、加 `.content-scroll` 样式、改 `.hot-category-block` 为 flex 布局 | + +**明确不动:** +- `frontend/pages/square/components/StarGalaxy/*` (任何文件) +- `frontend/pages/square/components/CreationGrid.vue` +- `frontend/pages/square/components/BannerCarousel.vue` +- `frontend/pages/square/components/ContentTabs.vue` + +--- + +## 实施说明 + +此计划涉及纯 UI 滚动行为调整,无独立可单元测试的纯函数,故采用**手动验证 + 浏览器/H5 调试**作为验证手段,不用 vitest/jest 单测框架。Vue 文件改动后通过 `npm run dev:h5`(或项目实际启动命令)启动后,使用浏览器 DevTools 模拟手机视口验证。 + +--- + +### Task 1: 改造 HotCategoryBlock 加内部 scroll + +**Files:** +- Modify: `frontend/pages/square/components/HotCategoryBlock.vue:1-118`(template 部分) +- Modify: `frontend/pages/square/components/HotCategoryBlock.vue`(style 部分) + +#### 1.1 修改 template,把 grid 区域包到内部 scroll-view + +**当前结构**(HotCategoryBlock.vue 大致如下,行号是参考): + +```vue + + + ... + + + + ... + + + + + ... + + +``` + +**改造为:** + +```vue + + + ... + + + + + + ... + + + + + ... + + + +``` + +**具体编辑步骤:** + +1. Read the file to find the exact lines +2. 在 `` (closing of `.ranking-tabs` div 之后,`` 之前) 插入 `` +3. 在 `` 闭合 `` 之后,`` (closing of `.hot-category-block`) 之前,插入 `` + +#### 1.2 修改 style,加 flex 布局和 `.content-scroll` + +在 ` - + +