Conversation
* refactor: 更清晰的重置方式 * docs: update * test: 使用 it.each 简化 * fix: review feedback
* feat: 修改字体 * fix: suit-glyph 添加字体样式
* fix: 优先用确定来源暗牌做身份交换并修正牌顶候选 * fix: 修正重叠暗牌覆盖与标记来源匹配 * fix: 修正覆盖候选合并与组合标签迁移
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (7)
🚧 Files skipped from review as they are similar to previous changes (5)
📝 WalkthroughWalkthrough本次变更将项目许可证切换为 GPL-3.0-or-later,扩展开发与测试文档,重构记牌器生命周期钩子与暗牌推断逻辑,调整技能处理、花色渲染及界面样式,并补充相关回归测试。 Changes项目治理与开发文档
记牌器与界面行为
Estimated code review effort: 5 (Critical) | ~120 minutes Possibly related PRs
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Code Review
This pull request transitions the project's license to GPL-3.0-or-later, updates extensive documentation to align with the codebase structure, and refactors GameState to separate pure game state logic from browser-specific side effects. It also enhances card tracking and constraint resolution to handle ambiguous hidden hand card coverage and prevent premature convergence of random transfers, while modularizing skill handlers into separate files. Feedback on these changes highlights a critical missing import of createSubZoneCandidateKey in src/tracker/roomConstraints.ts that will cause a runtime error, and suggests completely removing commented-out code blocks in src/draw.js to maintain code cleanliness.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
There was a problem hiding this comment.
Actionable comments posted: 4
🧹 Nitpick comments (1)
src/handler/skills/JiZhan.js (1)
23-26: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value替换 HTML 字符串中的制表符以确保可靠的间距渲染。
在 HTML 的默认渲染模式下,连续的空白字符和制表符(
\t)会被折叠为一个普通空格。如果.textRes没有设置white-space: pre或pre-wrap等样式,使用\t可能会导致预期的间距丢失。建议使用 HTML 实体 来维持跨浏览器的正确渲染。💡 建议的修改
- updateResult( - `<span class="textRes">【吉占】猜${g > l ? '大' : '小'}</span><br><span class="textRes">跟${cardNum}比,${g}张大\t\t${l}张小\t\t${e}平</span>` - ) + updateResult( + `<span class="textRes">【吉占】猜${g > l ? '大' : '小'}</span><br><span class="textRes">跟${cardNum}比,${g}张大 ${l}张小 ${e}平</span>` + )🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@src/handler/skills/JiZhan.js` around lines 23 - 26, Update the HTML string passed to updateResult in the surrounding JiZhan handler to replace the tab characters between the “大”, “小”, and “平” counts with entities, preserving the intended spacing without relying on .textRes whitespace styling.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@docs/agents/environment.md`:
- Line 26: 修复损坏的 testing.md 链接:在 docs/agents/environment.md 第26行和
docs/agents/card_tracker.md 第192行,将链接文本统一改为
[testing.md](testing.md),移除制表符并补上缺失的首字母 t。
In `@docs/agents/testing.md`:
- Around line 92-93: 统一 docs/agents/testing.md 中 tracker 变更的最低验证要求:对
src/tracker/ 或 tests/tracker/ 的修改保留必须运行 pnpm test:tracker,但仅在涉及 TS
类型契约、tsconfig、ESLint TypeScript 覆盖或 tracker 类型迁移时要求 pnpm
typecheck:tracker;需要确认全仓入口时再运行 pnpm typecheck,并确保与 AGENTS.md 和
docs/agents/commands.md 的条件一致。
In `@src/tracker/gameState.ts`:
- Around line 195-200: 更新 GameState 的 init() 初始化流程,在重置会话和房间状态时调用
clearDomContainers(),确保新牌局清空上一局遗留的 DomContainerItem。补充针对 init()
的回归断言,验证别名容器也会被清理,避免后续 clear() 处理过期元素。
In `@src/tracker/roomMovement/sources.ts`:
- Around line 84-98: 调整当前玩家来源候选筛选逻辑:不要仅因 card.subZone 或 card.spellID 为 null
而排除候选;只要完整位置投影匹配,或存在匹配的 PlayerLocationCandidate,都应保留为来源候选。标记区域的技能兼容性检查应读取候选自身的
spellID;将精确投影匹配仅用于排序,不用于过滤,避免生成 id=0 回退实体。
---
Nitpick comments:
In `@src/handler/skills/JiZhan.js`:
- Around line 23-26: Update the HTML string passed to updateResult in the
surrounding JiZhan handler to replace the tab characters between the “大”, “小”,
and “平” counts with entities, preserving the intended spacing without
relying on .textRes whitespace styling.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro Plus
Run ID: 45c23256-a58f-4f55-98f4-3771ceeb4def
📒 Files selected for processing (42)
.gitignoreAGENTS.mdCONTRIBUTING.mdLICENSENOTICEREADME.mddocs/agents/card_tracker.mddocs/agents/commands.mddocs/agents/conventions.mddocs/agents/environment.mddocs/agents/lifecycle.mddocs/agents/overview.mddocs/agents/serena.mddocs/agents/testing.mdhtml/iframe.htmlpackage.jsonsrc/draw.jssrc/handler/StartGame.jssrc/handler/skills/JiZhan.jssrc/handler/skills/YanXi.jssrc/handler/spellEffects.jssrc/logic.jssrc/tracker/Game.tssrc/tracker/Room.tssrc/tracker/candidate/publicCandidate.tssrc/tracker/gameState.tssrc/tracker/roomConstraints.tssrc/tracker/roomMovement.tssrc/tracker/roomMovement/sources.tssrc/utils/index.jstests/tracker/ambiguousKnownIndexIncremental.test.tstests/tracker/gameFlowState.test.tstests/tracker/handCountObservation.test.tstests/tracker/hiddenMarkCandidates.test.tstests/tracker/pileDisplayOrder.test.tstests/tracker/publicCandidates.test.tstests/tracker/room.import.test.tstests/tracker/spellEffects.test.tstests/tracker/suitGlyph.test.tstests/tracker/trackerController.test.tstests/tracker/viewDirtyRender.test.tsvite.config.js
Summary by CodeRabbit