refactor: switch to HashRouter for client-side routing#104
Conversation
Replace BrowserRouter with HashRouter in the App component to improve routing compatibility, particularly for static site deployments that do not support server-side routing. This change ensures that navigation within the app remains functional by using hash-based URLs, which are less likely to be affected by server configuration issues. The removal of the basename prop is also consistent with the switch to HashRouter.
Reviewer's guide (collapsed on small PRs)Reviewer's GuideReplaces BrowserRouter with HashRouter usage in the App component by removing the basename configuration from the router, simplifying client-side routing for static deployments. Flow diagram for updated HashRouter-based routing in App componentflowchart TD
A[Browser_location_with_hash] --> B[HashRouter]
B --> C[Routes]
C --> D[PublicLayout_route_path_/]
C --> E[Other_app_routes]
D --> F[PublicLayout_component]
E --> G[Corresponding_page_components]
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
|
Warning Rate limit exceeded
To continue reviewing without waiting, purchase usage credits in the billing tab. ⌛ 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. ✨ 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 |
|
Failed to generate code suggestions for PR |
|
|
Infisical secrets check: 🚨 Secrets leaked! Caution The Infisical CLI tool found secrets leaked in your repository. 💻 Scan logs2026-05-07T17:11:47Z INF scanning for exposed secrets...
5:11PM INF 91 commits scanned.
2026-05-07T17:11:47Z INF scan completed in 231ms
2026-05-07T17:11:47Z WRN leaks found: 6
🔎 Detected secrets in your GIT history
Warning The above table only displays the first 10 leaked secrets. 🐾 Secrets fingerprint2e1522054d3009edd4cc682e479341776b266eb0:src/pages/Integrations.tsx:generic-api-key:12
2e1522054d3009edd4cc682e479341776b266eb0:src/mockData.ts:generic-api-key:505
2e1522054d3009edd4cc682e479341776b266eb0:src/pages/RepositoryDetail.tsx:generic-api-key:124
2e1522054d3009edd4cc682e479341776b266eb0:src/pages/RepositoryDetail.tsx:generic-api-key:160
2e1522054d3009edd4cc682e479341776b266eb0:src/pages/Settings.tsx:generic-api-key:127
2e1522054d3009edd4cc682e479341776b266eb0:src/pages/RepositoryDetail.tsx:generic-api-key:178
Tip If you want to ignore these leaked secrets, add the above fingerprint content to a file named |
There was a problem hiding this comment.
Hey - I've left some high level feedback:
- With the switch away from
basename, double-check any hardcoded paths orLink/navigateusages that relied onimport.meta.env.BASE_URLso they still generate correct URLs in all environments. - Since routing is now hash-based, review any logic that inspects
window.location.pathname(e.g., for analytics, conditional rendering, or redirects) to ensure it uses the hash portion where appropriate.
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- With the switch away from `basename`, double-check any hardcoded paths or `Link`/`navigate` usages that relied on `import.meta.env.BASE_URL` so they still generate correct URLs in all environments.
- Since routing is now hash-based, review any logic that inspects `window.location.pathname` (e.g., for analytics, conditional rendering, or redirects) to ensure it uses the hash portion where appropriate.Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.



📑 Description
Replace BrowserRouter with HashRouter in the App component to improve routing compatibility, particularly for static site deployments that do not support server-side routing. This change ensures that navigation within the app remains functional by using hash-based URLs, which are less likely to be affected by server configuration issues. The removal of the basename prop is also consistent with the switch to HashRouter.
✅ Checks
☢️ Does this introduce a breaking change?
Summary by Sourcery
Enhancements: