Skip to content

fix: 大盘复盘结果区滚动锁定问题 (#1266) - #1270

Merged
ZhuLinsen merged 2 commits into
mainfrom
autocode/issue-1266-bug
May 12, 2026
Merged

fix: 大盘复盘结果区滚动锁定问题 (#1266)#1270
ZhuLinsen merged 2 commits into
mainfrom
autocode/issue-1266-bug

Conversation

@ZhuLinsen

@ZhuLinsen ZhuLinsen commented May 12, 2026

Copy link
Copy Markdown
Owner

PR Type

  • fix
  • feat
  • refactor
  • docs
  • chore
  • test

Background And Problem

Scope Of Change

  • apps/dsa-web/src/pages/HomePage.tsx
  • apps/dsa-web/src/pages/__tests__/HomePage.test.tsx
  • docs/CHANGELOG.md

Documentation And Changelog

  • 已同步更新文档/变更记录:docs/CHANGELOG.md
  • 当前补丁尚未包含 README.md 或专题文档;如用户可见行为发生变化,请补充文档落点。

Issue Link

Closes #1266

Verification Commands And Results

./scripts/ci_gate.sh flake8
./scripts/ci_gate.sh offline-tests

关键输出/结论 / Key output & conclusion:

  • lint:PASS, test:PASS

Compatibility And Risk

  • Medium:涉及 apps/dsa-web/src/pages/HomePage.tsx, apps/dsa-web/src/pages/__tests__/HomePage.test.tsx, docs/CHANGELOG.md,建议按文件范围复核。
  • 前提假设:
    • 优先按维护者方向排查 apps/dsa-web 的大盘复盘结果页滚动容器、固定高度、overflow 和 body scroll lock 状态。
    • 如果问题只由 Web 页面布局导致,Desktop 端可通过复用 Web 构建产物自然修复;仅在 Electron 外壳存在固定 viewport 或高度同步问题时才修改 apps/dsa-desktop。
    • 最小修复路径应优先调整结果页布局、滚动容器样式或渲染完成后的滚动状态清理,不引入新的路由、状态管理或桌面端启动链路改造。
    • 该问题属于用户可见行为修复,应同步在 docs/CHANGELOG.md 的 Unreleased 段补充扁平格式修复记录。

Rollback Plan

  • git revert <merge-commit> 回滚本 PR 提交,重点确认 apps/dsa-web/src/pages/HomePage.tsx, apps/dsa-web/src/pages/__tests__/HomePage.test.tsx, docs/CHANGELOG.md 恢复正常。

Acceptance Criteria

  • 大盘复盘完成并从 loading 切换到结果后,页面主体和底部内容可以正常滚动查看。
  • Markdown、图表或图片异步渲染完成后不会导致外层页面滚动区域被截断或锁住。
  • 底部操作区或固定容器不会遮挡结果内容,也不会阻止页面继续滚动。
  • Web 构建和 lint 通过;如改动 Desktop 外壳,Desktop 构建也应通过或明确说明平台限制。

Checklist

  • 本 PR 有明确动机和业务价值 / This PR has a clear motivation and value
  • 已提供可复现的验证命令与结果 / Reproducible verification commands and results are included
  • 已评估兼容性与风险 / Compatibility and risk have been assessed
  • 已提供回滚方案 / A rollback plan is provided
  • 文档与 docs/CHANGELOG.md 同步仍需确认;如涉及用户可见变更,请在合并前补充原因与文档落点 / Documentation and docs/CHANGELOG.md sync still needs confirmation before merge when user-visible behavior changes

Copilot AI review requested due to automatic review settings May 12, 2026 09:43
@github-actions github-actions Bot added documentation Improvements or additions to documentation size/M testing labels May 12, 2026
@github-actions

github-actions Bot commented May 12, 2026

Copy link
Copy Markdown

🤖 自动审查报告

项目 结果
📊 变更文件 3 个
➕ 新增行数 158 行
➖ 删除行数 46 行
🔍 静态检查 ✅ 通过
🧠 AI 审查 ✅ 已完成

📁 修改的文件

  • 📝 apps/dsa-web/src/pages/HomePage.tsx (+73/-45)
  • 📝 apps/dsa-web/src/pages/__tests__/HomePage.test.tsx (+84/-0)
  • 📝 docs/CHANGELOG.md (+1/-1)

🧠 AI 代码审查意见

结论

Ready to Merge

结构化结果

1. 必要性

  • 通过
  • 理由: PR 明确指出了“修复大盘复盘结果页在 loading 到结果切换后页面底部无法继续上滑的滚动容器锁定问题”,这是一个影响用户体验的 Bug,具有明确的业务价值。

2. 关联性

3. 类型

  • 建议类型: fix
  • 理由: PR 类型为 fix,标题和描述均表明这是一项修复工作,类型匹配。

4. 描述完整性

  • 完整
  • 理由:
    • 背景与问题:已清晰阐述。
    • 变更范围:已详细列出受影响的文件。
    • 验证命令与结果:已提供 ./scripts/ci_gate.sh flake8./scripts/ci_gate.sh offline-tests 的命令,并说明 lint:PASS, test:PASS,且 CI 检查状态也显示静态检查通过。本 PR 无 Python 后端改动,故不需要额外检查 ci_gate.sh 对 Python 的执行情况。
    • 兼容性与风险:已评估为 Medium 并提供了前提假设。
    • 回滚方案:已提供。
    • 验收标准:已详细列出。
    • 文档与 CHANGELOG.md 同步:PR 描述中指出了 docs/CHANGELOG.md 已更新,且 diff 中证实了这一点。

5. 风险级别

  • 关键风险: 主要风险在于前端页面布局和滚动行为的改变可能引入新的滚动问题或兼容性问题。但本次改动逻辑清晰,通过将结果内容移入主滚动容器并提供滚动到顶部的机制,解决了原问题,并有新增测试覆盖。代码调整较为局部,风险在可控范围内。

必改项

无。

建议项

无。本次 PR 在代码质量、测试覆盖、文档同步和 PR 描述完整性方面都做得很好,没有发现需要改进的建议。


💡 提示: 请确保代码已通过本地测试,并遵循项目代码规范。

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

该 PR 修复 Web 首页“大盘复盘”从 loading 切换到长结果后,页面底部区域无法继续上滑的滚动容器锁定问题:将大盘复盘提示/错误/报告从外层静态区域迁入主内容滚动区,避免出现不可滚动的“被截断”区域。

Changes:

  • 将大盘复盘 notice/error/report 渲染移动到主 dashboard 的可滚动 <section> 内,并移除报告 <pre> 的内部纵向滚动限制(避免嵌套纵向滚动导致锁滚)。
  • 为主滚动区与报告块补充 data-testid,新增/更新单测断言,确保报告位于主滚动容器内且不再使用 max-h-64/overflow-y-auto
  • 更新 docs/CHANGELOG.md 增加对应修复记录。

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

File Description
apps/dsa-web/src/pages/HomePage.tsx 将大盘复盘结果放入主内容滚动区,移除报告内部纵向滚动,修复长内容滚动锁定/截断
apps/dsa-web/src/pages/tests/HomePage.test.tsx 增加断言覆盖:报告渲染在主滚动区内且不再是内部滚动容器
docs/CHANGELOG.md 记录该用户可见修复项

Comment thread docs/CHANGELOG.md Outdated
Comment on lines 28 to 31
- [修复] Web 首页大盘复盘结果改由主内容滚动区承载,避免 loading 切换到长结果后下方报告区域被截断或无法继续滚动。

- [新功能] Web 系统设置页开放 `.env` 配置备份导入/导出,复用键级覆盖、配置版本冲突保护和重载链路;Web 端在 `ADMIN_AUTH_ENABLED=false` 时该入口为禁用状态。
- [chore] 精简仓库根目录:将文档图片资源迁入 `docs/assets/`,将东方财富请求补丁迁入 `src/patches/`,并下移 CI 专用依赖文件与技能适配服务。

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 3a15ecdb90

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +524 to +539
{marketReviewReport ? (
<div className="mb-3 rounded-xl border border-subtle bg-surface/70 px-3 py-3 text-xs text-secondary-text shadow-sm">
<div className="mb-2 flex items-center justify-between gap-2">
<p className="font-semibold text-foreground">大盘复盘报告</p>
<button
type="button"
className="home-surface-button h-7 rounded-md px-3 py-1 text-xs text-foreground"
disabled={marketReviewReportCopied}
onClick={() => void handleCopyMarketReviewReport()}
>
{marketReviewReportCopied ? '已复制' : '复制'}
</button>
</div>
<pre
data-testid="market-review-report"
className="overflow-x-auto whitespace-pre-wrap break-words rounded-lg bg-background px-3 py-2 leading-relaxed"

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Keep market review feedback visible after toolbar clicks

When a user is scrolled down in the main dashboard (for example reading an existing stock report) and clicks the always-visible 大盘复盘 toolbar button, this block is inserted at the top of the same scroll container and no code resets scrollTop or scrolls the result into view. The browser will preserve the current scroll position, so the completion notice/report can appear above the viewport and the click appears to do nothing; before this change the market review feedback was outside the dashboard scroller and stayed visible below the header.

Useful? React with 👍 / 👎.

@ZhuLinsen ZhuLinsen left a comment

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

评审结论

  • 必要性:通过。该 PR 针对 #1266 中大盘复盘结果从 loading 切换后底部无法继续滚动的问题,改动方向与问题现象匹配。
  • 是否有对应 issue:有,Closes #1266
  • PR 类型:fix。修复 Web 首页大盘复盘结果页滚动容器锁定问题,并补充对应单测与 changelog。
  • description 完整性:完整。已说明背景、范围、验证、风险与回滚方案;但 changelog 条目位置仍需按仓库内注释和协作规范确认。
  • 是否可直接合入:不可。当前 CI 通过,且 mergeable_state=blocked 本身不构成阻断;主要阻断点是本次布局调整可能让大盘复盘反馈在已有滚动位置下不可见,属于当前 diff 新引入的用户可见行为风险。

主要问题

  1. [Correctness blocker] apps/dsa-web/src/pages/HomePage.tsx:本 PR 将大盘复盘 notice/error/report 从外层区域移动到 home-dashboard-scroll 滚动容器顶部,但未看到触发大盘复盘或结果完成后重置/定位该滚动容器的逻辑。若用户已在主内容区向下滚动后点击固定工具栏里的“大盘复盘”,新插入的 loading/成功/错误/报告内容会出现在滚动容器顶部、当前视口之外,用户可能看不到任务反馈或结果。建议在触发或结果落地时显式滚动到大盘复盘块,或将反馈区放在可见位置,并补充覆盖“已有滚动位置下触发大盘复盘”的回归测试。
  2. [Nice to have] docs/CHANGELOG.md[Unreleased] 段已保持扁平 bullet 格式,符合 AGENTS.md 的主要要求;但当前新增条目插入在列表中间,文件内注释要求新条目追加到本段末尾以降低并发 PR 冲突。建议移动到 ## [3.16.0] 前的 Unreleased 列表末尾。

🤖 此回复由 OpenReview Bot 自动生成,仅供参考。如有疑问请 @维护者。

@ZhuLinsen ZhuLinsen left a comment

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

评审结论

  • 必要性:通过。该 PR 针对 #1266 的大盘复盘结果区滚动锁定问题,改动方向与用户可见故障匹配。
  • 是否有对应 issue:有,Closes #1266
  • PR 类型:fix,修复 Web 首页大盘复盘 loading 切换到长结果后的滚动容器问题,并补充回归测试与 changelog。
  • description 完整性:完整。已说明背景、范围、验证、风险和回滚方案;README.md 未更新可接受,当前属于局部 Web 行为修复且已更新 docs/CHANGELOG.md
  • 是否可直接合入:可。当前 CI 为 success,mergeable_state=blocked 不单独构成阻断;未发现当前 diff 引入的行为或兼容性阻断问题。

🤖 此回复由 OpenReview Bot 自动生成,仅供参考。如有疑问请 @维护者。

@ZhuLinsen ZhuLinsen changed the title fix: 新版本大盘复盘后,下面的界面滑不上去了 (#1266) fix: 大盘复盘结果区滚动锁定问题 (#1266) May 12, 2026
@ZhuLinsen
ZhuLinsen merged commit 754bf48 into main May 12, 2026
10 checks passed
davidzhengdai pushed a commit to davidzhengdai/daily_stock_analysis that referenced this pull request May 12, 2026
* fix(issue-1266): [bug]-新版本大盘复盘后,下面的界面滑不上去了

* fix(review-feedback-1270): address latest review comments
Anyone878 pushed a commit to Anyone878/daily_stock_analysis that referenced this pull request May 17, 2026
* fix(issue-1266): [bug]-新版本大盘复盘后,下面的界面滑不上去了

* fix(review-feedback-1270): address latest review comments
EchoingFootsteps pushed a commit to EchoingFootsteps/daily_stock_analysis that referenced this pull request Jul 4, 2026
* fix(issue-1266): [bug]-新版本大盘复盘后,下面的界面滑不上去了

* fix(review-feedback-1270): address latest review comments
bmwu pushed a commit to bmwu/daily_stock_analysis that referenced this pull request Aug 24, 2026
* fix(issue-1266): [bug]-新版本大盘复盘后,下面的界面滑不上去了

* fix(review-feedback-1270): address latest review comments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation size/L size/M testing

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug] 新版本大盘复盘后,下面的界面滑不上去了

2 participants