[codex] fix dashboard job overflow and password input behavior - #11
Conversation
There was a problem hiding this comment.
CodaGraph Review 摘要
- PR: #11 [codex] fix dashboard job overflow and password input behavior
- 风险等级: high
- 运行模式: improve
- 置信度: high
- 覆盖情况: 3/3 文件
- 跳过文件: 0
- 报告 ID: 9244
- 已发布行级评论: 0
PR 修改了代码或配置,但没有看到对应的测试改动,回归风险较高。 模式:LLM + 规则;风险等级:high;置信度:high。 共审查 3/3 个文件,发现 2 个高价值问题(critical 0 / high 1 / medium 1 / low 0)。 本次变更没有检测到跳过文件。
摘要中的补充问题
-
缺少测试覆盖 (PR_OVERALL)
- 严重性: high
- 描述: PR 修复了 dashboard job overflow 和 password input behavior 两个 bug,但未包含任何测试变更。Input.tsx 组件的密码输入行为修复可能影响多个使用场景,缺乏回归测试可能导致问题复现。
- 建议: 建议为 Input 组件的密码输入行为添加单元测试,为 dashboard 页面的布局溢出修复添加视觉回归测试或集成测试,确保修复效果可验证且不会再次回归。
-
本次变更缺少测试变更 (PR_OVERALL)
- 严重性: medium
- 描述: PR 修改了代码或配置,但没有看到对应的测试改动,回归风险较高。
- 建议: 为新增逻辑、边界条件或修复路径补充测试,至少覆盖主要成功/失败分支。
建议动作
-
建议为 Input 组件的密码输入行为添加单元测试,为 dashboard 页面的布局溢出修复添加视觉回归测试或集成测试,确保修复效果可验证且不会再次回归。
-
为新增逻辑、边界条件或修复路径补充测试,至少覆盖主要成功/失败分支。
There was a problem hiding this comment.
CodaGraph Review 摘要
- PR: #11 [codex] fix dashboard job overflow and password input behavior
- 风险等级: high
- 运行模式: improve
- 置信度: high
- 覆盖情况: 3/3 文件
- 跳过文件: 0
- 报告 ID: 9245
- 已发布行级评论: 0
PR 修改了代码或配置,但没有看到对应的测试改动,回归风险较高。 模式:LLM + 规则;风险等级:high;置信度:high。 共审查 3/3 个文件,发现 3 个高价值问题(critical 0 / high 1 / medium 2 / low 0)。 本次变更没有检测到跳过文件。
摘要中的补充问题
-
缺少测试覆盖密码输入行为修复 (PR_OVERALL)
- 严重性: high
- 描述: PR 标题表明修复了 password input behavior,但未包含测试变更。密码输入涉及敏感操作,缺少测试可能导致回归风险难以检测,尤其是在未来修改 Input 组件时。
- 建议: 为 Input 组件的密码相关行为添加单元测试,验证密码显示/隐藏切换、输入值处理等场景。
-
状态更新方式变更缺少验证 (PR_OVERALL)
- 严重性: medium
- 描述: settings/page.tsx 中 setPasswordForm 改为函数式更新是正确的重构,但缺少测试验证状态更新逻辑在并发场景下的正确性。
- 建议: 考虑为 settings 页面的表单状态更新添加集成测试,特别是涉及密码设置的流程。
-
本次变更缺少测试变更 (PR_OVERALL)
- 严重性: medium
- 描述: PR 修改了代码或配置,但没有看到对应的测试改动,回归风险较高。
- 建议: 为新增逻辑、边界条件或修复路径补充测试,至少覆盖主要成功/失败分支。
建议动作
-
为 Input 组件的密码相关行为添加单元测试,验证密码显示/隐藏切换、输入值处理等场景。
-
考虑为 settings 页面的表单状态更新添加集成测试,特别是涉及密码设置的流程。
-
为新增逻辑、边界条件或修复路径补充测试,至少覆盖主要成功/失败分支。
cf9b1d1 to
6c13228
Compare
There was a problem hiding this comment.
CodaGraph Review 摘要
- PR: #11 [codex] fix dashboard job overflow and password input behavior
- 风险等级: medium
- 运行模式: improve
- 置信度: high
- 覆盖情况: 3/3 文件
- 跳过文件: 0
- 报告 ID: 9246
- 已发布行级评论: 0
PR 修改了代码或配置,但没有看到对应的测试改动,回归风险较高。 模式:LLM + 规则;风险等级:medium;置信度:high。 共审查 3/3 个文件,发现 1 个高价值问题(critical 0 / high 0 / medium 1 / low 0)。 本次变更没有检测到跳过文件。
摘要中的补充问题
- 本次变更缺少测试变更 (PR_OVERALL)
- 严重性: medium
- 描述: PR 修改了代码或配置,但没有看到对应的测试改动,回归风险较高。
- 建议: 为新增逻辑、边界条件或修复路径补充测试,至少覆盖主要成功/失败分支。
建议动作
- 为新增逻辑、边界条件或修复路径补充测试,至少覆盖主要成功/失败分支。
There was a problem hiding this comment.
CodaGraph Review 摘要
- PR: #11 [codex] fix dashboard job overflow and password input behavior
- 风险等级: critical
- 运行模式: improve
- 置信度: high
- 覆盖情况: 3/3 文件
- 跳过文件: 0
- 报告 ID: 9247
- 已发布行级评论: 2
PR 修改了代码或配置,但没有看到对应的测试改动,回归风险较高。 模式:LLM + 规则;风险等级:critical;置信度:high。 共审查 3/3 个文件,发现 3 个高价值问题(critical 1 / high 0 / medium 1 / low 1)。 本次变更没有检测到跳过文件。
摘要中的补充问题
- 本次变更缺少测试变更 (PR_OVERALL)
- 严重性: medium
- 描述: PR 修改了代码或配置,但没有看到对应的测试改动,回归风险较高。
- 建议: 为新增逻辑、边界条件或修复路径补充测试,至少覆盖主要成功/失败分支。
建议动作
-
在 package.json 中确保 react 和 react-dom 版本 >= 18.0.0,或添加运行时检查/条件回退逻辑(如 typeof React.useId !== 'undefined')。
-
为新增逻辑、边界条件或修复路径补充测试,至少覆盖主要成功/失败分支。
-
考虑添加 NaN 检查:
onChange((value) => { const num = Number(event.target.value); onChange(isNaN(num) ? 0 : num); })或在组件内部验证。
| ...props | ||
| }: InputProps) { | ||
| const inputId = id || `input-${Math.random().toString(36).slice(2, 11)}`; | ||
| const generatedId = React.useId(); |
There was a problem hiding this comment.
CRITICAL · React.useId() 需要 React 18+ 环境
useId 是 React 18 引入的 API。如果部署环境使用 React 17.x 或更低版本,此组件会在运行时崩溃。需要确认项目的 peer dependencies 约束。
建议:在 package.json 中确保 react 和 react-dom 版本 >= 18.0.0,或添加运行时检查/条件回退逻辑(如 typeof React.useId !== 'undefined')。
| label={label} | ||
| type="number" | ||
| value={value.toString()} | ||
| onChange={(event) => onChange(Number(event.target.value))} |
There was a problem hiding this comment.
LOW · NumberInput 的 onChange 缺乏 NaN 保护
当用户在 number input 中输入非数字字符时,Number(event.target.value) 会返回 NaN,可能导致父组件收到无效的状态值。虽然 HTML type="number" 会在大多数情况下阻止无效输入,但用户仍可能通过粘贴等途径输入非数字内容。
建议:考虑添加 NaN 检查:onChange((value) => { const num = Number(event.target.value); onChange(isNaN(num) ? 0 : num); }) 或在组件内部验证。
Summary
This PR fixes two frontend regressions in the dashboard/settings experience.
Root Cause
The password input issue came from the shared input component generating a new random id on every render. In a controlled password form, that caused unstable input/label wiring and focus/selection problems while typing.
The dashboard overflow issue came from a flexible row layout that allowed long job metadata to push the right-side timestamp area outside the card bounds.
User Impact
Validation