fix: history stock name truncate [Issue: #815] - #894
Merged
ZhuLinsen merged 3 commits intoMar 27, 2026
Conversation
Display truncated stock names with a trailing dot (max 15 English / 8 Chinese / 10 mixed chars). Show full name on hover. Extract truncation logic to utils/stockName with full test coverage. (cherry picked from commit 76cf05db841dc8ee39436e0ba9cd86be2690252c)
The title attribute is no longer needed since truncateStockName already handles long stock names properly.
Unified duplicate item.stockName || item.stockCode expressions to use the pre-computed stockName variable. Also added CHANGELOG entry
🤖 自动审查报告
📁 修改的文件
🧠 AI 代码审查意见结论Ready to Merge 结构化审查结果必要性通过。 本 PR 明确指出修复了历史列表中过长股票名称与右侧状态标签文字重叠的 UI 问题(Issue: #815),影响用户识别,且提供了截图。该修复具有明确的业务价值和用户体验提升。 关联性通过。 PR 描述中明确提及 "Fixes #815",与问题描述中的 Issue 完全关联。 类型通过。 PR 类型标记为 描述完整性完整。
风险级别低。
必改项无。 建议项无。 详细审查意见:
综上所述,本次 PR 针对明确的 UI 问题提供了高质量的解决方案,代码实现健壮,测试覆盖完善,文档更新及时,且经过充分验证。因此,该 PR 已达到合入标准。
|
ZhuLinsen
reviewed
Mar 27, 2026
ZhuLinsen
left a comment
Owner
There was a problem hiding this comment.
评审结论
- 必要性:通过,针对 #815 的历史列表名称与状态标签重叠问题做了范围收敛的前端修复,符合仓库对 fix 类最小改动的要求。
- 是否有对应 issue:有(Fixes #815)
- PR 类型:fix,改动集中在
apps/dsa-web的历史列表展示逻辑、对应测试和docs/CHANGELOG.md。 - description 完整性:完整,已覆盖背景、范围、验证命令与结果、兼容性/风险、回滚方案,并说明了未更新
README.md的原因。 - 是否可直接合入:不可,
HistoryListItem中新增的 hover 交互当前并不会生效,和 PR 描述及 changelog 中声明的用户可见行为不一致,需要先修正。
主要问题
- [Correctness blocker]
apps/dsa-web/src/components/history/HistoryListItem.tsx中子元素使用了group-hover/item:*,但外层父节点仍是group,不是group/item。按 Tailwind 的命名 group 语义,这会导致“悬停显示完整股票名称”以及 badge 透明度调整都不会触发。当前实际落地的是静态截断,不是 PR 描述和docs/CHANGELOG.md中写明的 hover 展示完整名称。置信度:高。 - [Verification gap]
apps/dsa-web/src/components/history/__tests__/HistoryList.test.tsx新增用例只验证了隐藏的完整名称节点存在,没有覆盖 hover 态是否真的切换显示,因此上述交互失效不会被 CI 捕获。
🤖 此回复由 OpenReview Bot 自动生成,仅供参考。如有疑问请 @维护者。
Contributor
Author
ZhuLinsen
reviewed
Mar 27, 2026
ZhuLinsen
left a comment
Owner
There was a problem hiding this comment.
跟进结论
- 结论:接受 + 最新回复成立,上一轮把
HistoryListItem.tsx中的 hover 交互直接判定为失效过重,这个结论需要收回。 - 是否仍有阻断:无 + 当前代码、改动范围和已通过的 CI /
web-gate之下,没有看到围绕这次争议点仍会阻断合入的正确性问题。
说明
apps/dsa-web/src/components/history/HistoryListItem.tsx这次改动不只是静态截断,还包含 hover 下名称展示切换和 badge 透明度调整;结合当前讨论里的实际页面表现,之前“group-hover/item:*不会触发”的判断不成立。- 更准确的表述应收窄为:本 PR 的核心修复是用字符阈值避免默认态重叠,hover 是补充展示方式;
docs/CHANGELOG.md对“截断 + 悬停展示”的描述与当前实现没有明显失配。 apps/dsa-web/src/components/history/__tests__/HistoryList.test.tsx目前覆盖了“长名称被截断且完整名称节点存在”的静态断言,但没有直接验证 hover 态切换;这属于测试补强空间,不构成当前继续阻断的依据。
🤖 此回复由 OpenReview Bot 自动生成,仅供参考。如有疑问请 @维护者。
ZhuLinsen
reviewed
Mar 27, 2026
ZhuLinsen
left a comment
Owner
There was a problem hiding this comment.
跟进结论
- 结论:接受 + 最新回复成立,
HistoryListItem.tsx中承载交互的父级按钮本身就是group/item,上一轮把 hover 交互判成失效不成立,需要收回。 - 是否仍有阻断:无 + 当前代码里这条争议对应的实现链路是通的,CI 也已成功,现有
mergeable_state=blocked不能单独作为阻断依据。
说明
apps/dsa-web/src/components/history/HistoryListItem.tsx里,父级按钮 class 为group/item,名称切换使用group-hover/item:hidden与group-hover/item:inline,badge 透明度也挂在group-hover/item:opacity-80上;从当前代码看,“悬停展示完整名称并淡化右侧 badge”与实现是一致的。apps/dsa-web/src/components/history/__tests__/HistoryList.test.tsx已覆盖默认态:长名称会显示截断文本,完整名称节点保留在 DOM 且默认是hidden。这条测试没有直接验证 hover 视觉态,但这最多说明自动化覆盖粒度有限,不足以支持“功能仍未实现”的判断。docs/CHANGELOG.md对这次修复描述为“默认截断,悬停展示完整名称”,按当前组件实现看并没有与代码脱节;因此此前围绕“文档声称有 hover,但代码实际只有静态截断”的指控也应一并关闭。
🤖 此回复由 OpenReview Bot 自动生成,仅供参考。如有疑问请 @维护者。
Copilot AI
pushed a commit
to anmezing/daily_stock_analysis
that referenced
this pull request
Apr 10, 2026
* feat(web): truncate long stock names in history list Display truncated stock names with a trailing dot (max 15 English / 8 Chinese / 10 mixed chars). Show full name on hover. Extract truncation logic to utils/stockName with full test coverage. (cherry picked from commit 76cf05db841dc8ee39436e0ba9cd86be2690252c) * fix(web): remove redundant title attribute in HistoryListItem The title attribute is no longer needed since truncateStockName already handles long stock names properly. * refactor(web): consolidate stockName variable usage in HistoryListItem Unified duplicate item.stockName || item.stockCode expressions to use the pre-computed stockName variable. Also added CHANGELOG entry Co-authored-by: qingdaoqin <43225158+qingdaoqin@users.noreply.github.com>
yangshiyan
pushed a commit
to yangshiyan/daily_stock_analysis
that referenced
this pull request
Apr 20, 2026
* feat(web): truncate long stock names in history list Display truncated stock names with a trailing dot (max 15 English / 8 Chinese / 10 mixed chars). Show full name on hover. Extract truncation logic to utils/stockName with full test coverage. (cherry picked from commit 76cf05db841dc8ee39436e0ba9cd86be2690252c) * fix(web): remove redundant title attribute in HistoryListItem The title attribute is no longer needed since truncateStockName already handles long stock names properly. * refactor(web): consolidate stockName variable usage in HistoryListItem Unified duplicate item.stockName || item.stockCode expressions to use the pre-computed stockName variable. Also added CHANGELOG entry
EchoingFootsteps
pushed a commit
to EchoingFootsteps/daily_stock_analysis
that referenced
this pull request
Jul 4, 2026
* feat(web): truncate long stock names in history list Display truncated stock names with a trailing dot (max 15 English / 8 Chinese / 10 mixed chars). Show full name on hover. Extract truncation logic to utils/stockName with full test coverage. (cherry picked from commit 76cf05db841dc8ee39436e0ba9cd86be2690252c) * fix(web): remove redundant title attribute in HistoryListItem The title attribute is no longer needed since truncateStockName already handles long stock names properly. * refactor(web): consolidate stockName variable usage in HistoryListItem Unified duplicate item.stockName || item.stockCode expressions to use the pre-computed stockName variable. Also added CHANGELOG entry
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

PR Type
fix
feat
refactor
docs
chore
test
Background And Problem
本 PR 修复历史列表中过长股票名称与右侧状态标签文字重叠的 UI 问题。( Issue: #815 )
问题描述:当历史记录中的股票名称过长时,在 1920x1080 分辨率下,股票名称与右侧情绪标签(如"观望 35" / "减仓
35")发生文字重叠,影响用户识别。
触发场景:历史列表中包含长股票名称的记录(主要是美股)。
Scope Of Change
新增文件:
修改文件:
说明:未更新 README.md 属于小bug 修复,不影响其他功能;
Issue Link
Fixes #815
Verification Commands And Results
cd apps/dsa-web
npm run lint
npm run build
npm test
关键输出/结论:
检查项 结果
npm run lint │ 通过(无输出)
npm run build │ 通过(7.18s,3175 modules transformed)
npm test │ 317 passed, 2 skipped
Compatibility And Risk
Rollback Plan
EXTRACT_PROMPT Change (if applicable)
None
Checklist
docs/CHANGELOG.md;未更新README.md,已说明原因;