feat(web): add first-class RTL setup#53
Conversation
|
Warning Rate limit exceeded
To keep reviews running without waiting, you can enable usage-based add-on for your organization. This allows additional reviews beyond the hourly cap. Account admins can enable it under billing. ⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: Repository UI Review profile: ASSERTIVE Plan: Pro Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughThe PR implements RTL (Right-to-Left) direction support for dashboard routes by introducing a Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 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. Review rate limit: 0/1 reviews remaining, refill in 47 minutes and 28 seconds.Comment |
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@apps/web/src/App.vitest.tsx`:
- Around line 13-17: The test mock for DirectionProvider only verifies the
wrapper renders; update the mock of './components/ui/direction'
(DirectionProvider) to capture and render the incoming props as data attributes
(e.g., data-dir and data-direction) so tests can assert the actual RTL props,
then add assertions in the existing tests to expect data-dir="rtl" and
data-direction="rtl" when rendering the App for both "/dashboard/upload" and the
root "/dashboard" route; also apply the same change to the second mock block
referenced around lines 47-68 so both test cases validate the direction props
instead of only wrapper presence.
In `@apps/web/src/components/ui/sidebar.tsx`:
- Around line 328-333: The RTL rail currently applies two conflicting border
utilities (group-data-[side=right]:border-l and
group-data-[side=right]:border-s) in the className passed to cn for the rail
element, causing a double/thicker border in RTL; remove the redundant
group-data-[side=right]:border-l so only the logical edge rule
(group-data-[side=right]:border-s) remains in the className string used by the
sidebar rail component.
🪄 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: Repository UI
Review profile: ASSERTIVE
Plan: Pro
Run ID: 0a2e0498-d8d4-40df-8e37-1de6d4419d1e
📒 Files selected for processing (7)
apps/web/src/App.tsxapps/web/src/App.vitest.tsxapps/web/src/components/dashboard/DashboardShell.tsxapps/web/src/components/ui/direction.tsxapps/web/src/components/ui/sidebar.tsxapps/web/src/pages/DashboardPage.vitest.tsxapps/web/src/pages/UploadDataPage.tsx
📜 Review details
🧰 Additional context used
📓 Path-based instructions (1)
**/*.{ts,tsx,js,jsx}
📄 CodeRabbit inference engine (AGENTS.md)
Use the
@cs/*path aliases fromtsconfig.base.jsonfor cross-package imports
Files:
apps/web/src/pages/UploadDataPage.tsxapps/web/src/App.tsxapps/web/src/App.vitest.tsxapps/web/src/components/ui/direction.tsxapps/web/src/components/ui/sidebar.tsxapps/web/src/components/dashboard/DashboardShell.tsxapps/web/src/pages/DashboardPage.vitest.tsx
🧠 Learnings (1)
📚 Learning: 2026-04-29T09:08:43.271Z
Learnt from: CR
Repo: HusseinBaraja/CS PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-04-29T09:08:43.271Z
Learning: Keep tests focused on the behavior changed
Applied to files:
apps/web/src/App.vitest.tsx
🔇 Additional comments (5)
apps/web/src/pages/UploadDataPage.tsx (1)
74-74: Good RTL-safe alignment update.Line 74 correctly uses
text-end, which is direction-aware and matches the PR’s RTL objective.apps/web/src/components/ui/direction.tsx (1)
4-20: LGTM — this wrapper centralizes the Radix direction context cleanly.apps/web/src/App.tsx (1)
40-53: LGTM — dashboard routes now get the RTL direction provider without affecting marketing routes.apps/web/src/components/dashboard/DashboardShell.tsx (1)
60-146: RTL layout updates are internally consistent.The logical
start/endspacing,text-start, andend-2badge placement all match the direction-aware sidebar changes.apps/web/src/pages/DashboardPage.vitest.tsx (1)
62-226: These RTL assertions line up with the updated shell/sidebar behavior.The logical
start/endandps-*checks, plus thedir="rtl"assertion on the sidebar container, cover the intended direction-aware layout changes well.
Summary by CodeRabbit
New Features
Bug Fixes