Skip to content

refactor: switch to HashRouter for client-side routing#104

Merged
guibranco merged 1 commit into
mainfrom
feature/fix-gh-pages-deployment
May 7, 2026
Merged

refactor: switch to HashRouter for client-side routing#104
guibranco merged 1 commit into
mainfrom
feature/fix-gh-pages-deployment

Conversation

@guibranco
Copy link
Copy Markdown
Owner

@guibranco guibranco commented May 7, 2026

📑 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

  • My pull request adheres to the code style of this project
  • My code requires changes to the documentation
  • I have updated the documentation as required
  • All the tests have passed

☢️ Does this introduce a breaking change?

  • Yes
  • No

Summary by Sourcery

Enhancements:

  • Remove the router basename configuration to align with hash-based routing behavior.

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.
@guibranco guibranco enabled auto-merge (squash) May 7, 2026 17:11
@gstraccini gstraccini Bot added the ☑️ auto-merge Automatic merging of pull requests (gstraccini-bot) label May 7, 2026
@sourcery-ai
Copy link
Copy Markdown

sourcery-ai Bot commented May 7, 2026

Reviewer's guide (collapsed on small PRs)

Reviewer's Guide

Replaces 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 component

flowchart 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]
Loading

File-Level Changes

Change Details Files
Switched the app routing from BrowserRouter with a basename to HashRouter without a basename for better static-site compatibility.
  • Updated the root router component from BrowserRouter (aliased as Router) to HashRouter configuration semantics
  • Removed the basename prop that relied on import.meta.env.BASE_URL from the router instantiation
  • Left all existing routes and layouts unchanged so that path structure is preserved while routing behavior changes to hash-based URLs
src/App.tsx

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 7, 2026

Warning

Rate limit exceeded

@guibranco has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 48 minutes and 9 seconds before requesting another review.

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 @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

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 configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 3093cbde-8126-4359-885c-0c4819b3743b

📥 Commits

Reviewing files that changed from the base of the PR and between 5c3a4a6 and f1fca38.

📒 Files selected for processing (1)
  • src/App.tsx
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feature/fix-gh-pages-deployment

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@github-actions github-actions Bot added the size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. label May 7, 2026
@penify-dev
Copy link
Copy Markdown

penify-dev Bot commented May 7, 2026

Failed to generate code suggestions for PR

@sonarqubecloud
Copy link
Copy Markdown

sonarqubecloud Bot commented May 7, 2026

@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 7, 2026

Infisical secrets check: 🚨 Secrets leaked!

Caution

The Infisical CLI tool found secrets leaked in your repository.
Please review the scan results and take the necessary actions.
Secrets found: 6

💻 Scan logs
2026-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
RuleID Commit File SymlinkFile Secret Match StartLine EndLine StartColumn EndColumn Author Message Date Email Fingerprint Tags Link
generic-api-key 2e15220 src/pages/Integrations.tsx REDACTED "apiKey: ""REDACTED""" 12 12 8 43 deepsource-autofix[bot] "style: format code with Prettier (#35)\n\nThis commit fixes the style issues introduced in f85b623 according to the output\nfrom Prettier.\n\nDetails: None\n\nCo-authored-by: deepsource-autofix[bot] <62050782+deepsource-autofix[bot]@users.noreply.github.com>\nCo-authored-by: gstraccini[bot] <150967461+gstraccini[bot]@users.noreply.github.com>\nCo-authored-by: Guilherme Branco Stracini guilherme@guilhermebranco.com.br" 2025-09-04T11:22:37Z 62050782+deepsource-autofix[bot]@users.noreply.github.com 2e15220:src/pages/Integrations.tsx:generic-api-key:12
apiKey: "sonar_12345678901234567890",
generic-api-key 2e15220 src/mockData.ts REDACTED "apiKey: ""REDACTED""" 505 505 6 41 deepsource-autofix[bot] "style: format code with Prettier (#35)\n\nThis commit fixes the style issues introduced in f85b623 according to the output\nfrom Prettier.\n\nDetails: None\n\nCo-authored-by: deepsource-autofix[bot] <62050782+deepsource-autofix[bot]@users.noreply.github.com>\nCo-authored-by: gstraccini[bot] <150967461+gstraccini[bot]@users.noreply.github.com>\nCo-authored-by: Guilherme Branco Stracini guilherme@guilhermebranco.com.br" 2025-09-04T11:22:37Z 62050782+deepsource-autofix[bot]@users.noreply.github.com 2e15220:src/mockData.ts:generic-api-key:505
apiKey: "sonar_12345678901234567890",
generic-api-key 2e15220 src/pages/RepositoryDetail.tsx REDACTED "apiKey: ""REDACTED""" 124 124 8 43 deepsource-autofix[bot] "style: format code with Prettier (#35)\n\nThis commit fixes the style issues introduced in f85b623 according to the output\nfrom Prettier.\n\nDetails: None\n\nCo-authored-by: deepsource-autofix[bot] <62050782+deepsource-autofix[bot]@users.noreply.github.com>\nCo-authored-by: gstraccini[bot] <150967461+gstraccini[bot]@users.noreply.github.com>\nCo-authored-by: Guilherme Branco Stracini guilherme@guilhermebranco.com.br" 2025-09-04T11:22:37Z 62050782+deepsource-autofix[bot]@users.noreply.github.com 2e15220:src/pages/RepositoryDetail.tsx:generic-api-key:124
apiKey: "sonar_12345678901234567890",
generic-api-key 2e15220 src/pages/RepositoryDetail.tsx REDACTED "apiKey: ""REDACTED""" 160 160 8 44 deepsource-autofix[bot] "style: format code with Prettier (#35)\n\nThis commit fixes the style issues introduced in f85b623 according to the output\nfrom Prettier.\n\nDetails: None\n\nCo-authored-by: deepsource-autofix[bot] <62050782+deepsource-autofix[bot]@users.noreply.github.com>\nCo-authored-by: gstraccini[bot] <150967461+gstraccini[bot]@users.noreply.github.com>\nCo-authored-by: Guilherme Branco Stracini guilherme@guilhermebranco.com.br" 2025-09-04T11:22:37Z 62050782+deepsource-autofix[bot]@users.noreply.github.com 2e15220:src/pages/RepositoryDetail.tsx:generic-api-key:160
apiKey: "codacy_12345678901234567890",
generic-api-key 2e15220 src/pages/Settings.tsx REDACTED "apiKey: ""REDACTED""" 127 127 8 43 deepsource-autofix[bot] "style: format code with Prettier (#35)\n\nThis commit fixes the style issues introduced in f85b623 according to the output\nfrom Prettier.\n\nDetails: None\n\nCo-authored-by: deepsource-autofix[bot] <62050782+deepsource-autofix[bot]@users.noreply.github.com>\nCo-authored-by: gstraccini[bot] <150967461+gstraccini[bot]@users.noreply.github.com>\nCo-authored-by: Guilherme Branco Stracini guilherme@guilhermebranco.com.br" 2025-09-04T11:22:37Z 62050782+deepsource-autofix[bot]@users.noreply.github.com 2e15220:src/pages/Settings.tsx:generic-api-key:127
apiKey: "sonar_12345678901234567890",
generic-api-key 2e15220 src/pages/RepositoryDetail.tsx REDACTED "apiKey: ""REDACTED""" 178 178 8 42 deepsource-autofix[bot] "style: format code with Prettier (#35)\n\nThis commit fixes the style issues introduced in f85b623 according to the output\nfrom Prettier.\n\nDetails: None\n\nCo-authored-by: deepsource-autofix[bot] <62050782+deepsource-autofix[bot]@users.noreply.github.com>\nCo-authored-by: gstraccini[bot] <150967461+gstraccini[bot]@users.noreply.github.com>\nCo-authored-by: Guilherme Branco Stracini guilherme@guilhermebranco.com.br" 2025-09-04T11:22:37Z 62050782+deepsource-autofix[bot]@users.noreply.github.com 2e15220:src/pages/RepositoryDetail.tsx:generic-api-key:178
apiKey: "snyk_12345678901234567890",

Warning

The above table only displays the first 10 leaked secrets.
You can find the full report here: secrets.csv


🐾 Secrets fingerprint
2e1522054d3009edd4cc682e479341776b266eb0: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 .infisicalignore at the repository root level.

Copy link
Copy Markdown

@sourcery-ai sourcery-ai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey - I've left some high level feedback:

  • 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.
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.

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

@guibranco guibranco disabled auto-merge May 7, 2026 17:27
@guibranco guibranco merged commit b650520 into main May 7, 2026
17 of 18 checks passed
@guibranco guibranco deleted the feature/fix-gh-pages-deployment branch May 7, 2026 17:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

☑️ auto-merge Automatic merging of pull requests (gstraccini-bot) size/XS Denotes a PR that changes 0-9 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant