feat: add desktop horizontal scroll for wide card tables#3394
feat: add desktop horizontal scroll for wide card tables#3394MisonL wants to merge 2 commits intoQuantumNous:mainfrom
Conversation
WalkthroughOn non‑mobile renders, Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Poem
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 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.
Actionable comments posted: 1
🧹 Nitpick comments (1)
web/src/index.css (1)
845-871: Consider Firefox scrollbar styling parity for desktop tables.Current scrollbar styling is WebKit-only. Adding Firefox equivalents improves cross-browser consistency for the same feature.
Optional enhancement
.card-table-desktop-scroll { width: 100%; overflow-x: auto; overflow-y: hidden; padding-bottom: 4px; + scrollbar-width: thin; + scrollbar-color: rgba(var(--semi-grey-2), 0.3) transparent; }🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@web/src/index.css` around lines 845 - 871, The WebKit-only scrollbar styles in .card-table-desktop-scroll lack Firefox equivalents; add Firefox-specific properties to .card-table-desktop-scroll (e.g., scrollbar-width: thin; scrollbar-color: <thumb-color> transparent) so the thumb color and track transparency match the WebKit rules, and optionally add a :hover state by toggling scrollbar-color on hover of .card-table-desktop-scroll to mirror ::-webkit-scrollbar-thumb:hover behavior. Ensure you reference and update the .card-table-desktop-scroll and .card-table-desktop-scroll:hover selectors so Firefox shows a thin, semi-transparent thumb and transparent track consistent with the existing WebKit styling.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@web/src/components/common/ui/CardTable.jsx`:
- Around line 89-98: The new outer wrapper in CardTable (the JSX that renders
the outermost div around card-table-desktop-scroll and
card-table-desktop-scroll-inner) prevents consumer classes applied to the Table
from affecting the actual scroll container; update CardTable so that consumer
styling/className/classNames passed to the Table are preserved on the outermost
scroll container instead of only on the inner table node — for example, forward
the incoming className/props from the Table to the outermost div (or merge
tableNode.props.className into the outer wrapper) in the CardTable component so
radius/clipping (e.g., rounded-xl overflow-hidden) still apply in horizontal
mode.
---
Nitpick comments:
In `@web/src/index.css`:
- Around line 845-871: The WebKit-only scrollbar styles in
.card-table-desktop-scroll lack Firefox equivalents; add Firefox-specific
properties to .card-table-desktop-scroll (e.g., scrollbar-width: thin;
scrollbar-color: <thumb-color> transparent) so the thumb color and track
transparency match the WebKit rules, and optionally add a :hover state by
toggling scrollbar-color on hover of .card-table-desktop-scroll to mirror
::-webkit-scrollbar-thumb:hover behavior. Ensure you reference and update the
.card-table-desktop-scroll and .card-table-desktop-scroll:hover selectors so
Firefox shows a thin, semi-transparent thumb and transparent track consistent
with the existing WebKit styling.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 91776a07-15a1-4709-847b-ab823e672908
📒 Files selected for processing (2)
web/src/components/common/ui/CardTable.jsxweb/src/index.css
6f921ad to
013d0f0
Compare
📝 变更描述 / Description
CardTable的桌面端宽表补上真正可拖动的横向滚动容器。scroll.x且为桌面端时启用,不影响未声明横向滚动的表格。🚀 变更类型 / Type of change
🔗 关联任务 / Related Issue
✅ 提交前检查项 / Checklist
📸 运行证明 / Proof of Work
cd web && bunx prettier src/components/common/ui/CardTable.jsx src/index.css --writecd web && PATH=./node_modules/.bin:$PATH eslint src/components/common/ui/CardTable.jsxcd web && PATH=./node_modules/.bin:$PATH vite build