fix: render numeric zero dialog chrome - #586
Conversation
|
@nrps9909 is attempting to deploy a commit to the React Component Team on Vercel. A member of the Team first needs to authorize it. |
|
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 (2)
Included review availability: Your plan provides up to 2 included reviews per hour; 1 remains after this review. WalkthroughChangesDialog 0 值内容支持
Estimated code review effort: 1 (简单) | ~5 分钟 Merge Risk: ⚪ Minimal · up to Numeric zero now renders correctly in dialog titles and footers while preserving accessibility wiring, with no actionable merge-blocking risk remaining after normal checks and review. Suggested reviewers: Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
Full details: Docstring CoverageExplanation No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 2 files. ✨ Finishing Touches 💡 1🛠️ Fix failing CI checks 💡
🧪 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 |
Summary
0passed through the public ReactNodetitleandfooterpropsaria-labelledbyrelationship when the title is zeroProblem
titleandfooteracceptReactNode, butPanelused truthiness checks to decide whether to render them. As a result, a valid numeric zero was silently dropped. Fortitle={0}, the title element was also omitted and the dialog lost itsaria-labelledbyreference.The fix distinguishes numeric zero from other falsy React values while preserving the existing behavior for empty strings,
false,null, andundefined.Validation
tsc --noEmit)git diff --checkI checked current open issues and pull requests. I found no report or PR for numeric-zero title/footer rendering. There are older unrelated PRs that also touch
Panel.tsx, but none changes these render conditions.AI assistance disclosure: Codex was used to trace the render conditions, audit open issues/PR files, run the exact-base regression, and draft this report. The implementation and test are directly reproducible from this branch.
Summary by CodeRabbit
Bug 修复
0时无法正常显示的问题。0时,辅助技术关联属性仍能正确指向标题元素。测试
0,以及无障碍关联属性正确性的验证。