Skip to content

routing fix for sidebar navigation#985

Merged
mshriver merged 1 commit into
ibutsu:mainfrom
mshriver:nav-route-fix
Jul 23, 2026
Merged

routing fix for sidebar navigation#985
mshriver merged 1 commit into
ibutsu:mainfrom
mshriver:nav-route-fix

Conversation

@mshriver

@mshriver mshriver commented Jul 23, 2026

Copy link
Copy Markdown
Contributor

urls were getting appended resulting in invalid paths

Summary by Sourcery

Fix sidebar navigation routing to use full project-scoped paths for all links.

Bug Fixes:

  • Prevent sidebar links from appending relative paths that resulted in invalid URLs when navigating within a project.

Enhancements:

  • Use the current project_id from route params to generate consistent, project-specific sidebar navigation links.

@sourcery-ai

sourcery-ai Bot commented Jul 23, 2026

Copy link
Copy Markdown
Contributor
Reviewer's guide (collapsed on small PRs)

Reviewer's Guide

Updates sidebar navigation links to use full project-scoped routes derived from URL params, preventing relative path concatenation issues.

File-Level Changes

Change Details Files
Use project-scoped, parameterized routes instead of relative paths for sidebar navigation links.
  • Import useParams from the routing library alongside Link.
  • Read project_id from route params inside IbutsuSidebar.
  • Update Dashboard, Runs, and Test Results links to use /project/${project_id}/... absolute paths instead of relative paths like dashboard, runs/, and results/.
  • Update dynamic view links to include the project prefix /project/${project_id}/view/${view.id} instead of view/${view.id}.
frontend/src/components/sidebar.js

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

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown
Contributor

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:

  • The sidebar now assumes useParams is available from react-router, but in most setups hooks come from react-router-dom; double-check the import source to avoid runtime errors.
  • Consider guarding against a missing or undefined project_id (e.g., when the sidebar is rendered outside a project route) to prevent generating broken links.
  • You might want to factor the repeated /project/${project_id} prefix into a single projectBasePath variable to reduce duplication and make future route changes easier.
Prompt for AI Agents
Please address the comments from this code review:

## Overall Comments
- The sidebar now assumes `useParams` is available from `react-router`, but in most setups hooks come from `react-router-dom`; double-check the import source to avoid runtime errors.
- Consider guarding against a missing or undefined `project_id` (e.g., when the sidebar is rendered outside a project route) to prevent generating broken links.
- You might want to factor the repeated `/project/${project_id}` prefix into a single `projectBasePath` variable to reduce duplication and make future route changes easier.

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.

@codecov

codecov Bot commented Jul 23, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 64.35%. Comparing base (f3a9869) to head (f38aab4).

❌ Your project check has failed because the head coverage (64.35%) is below the target coverage (85.00%). You can increase the head coverage or adjust the target coverage.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #985      +/-   ##
==========================================
+ Coverage   63.78%   64.35%   +0.56%     
==========================================
  Files          91       91              
  Lines        3916     3919       +3     
==========================================
+ Hits         2498     2522      +24     
+ Misses       1418     1397      -21     
Files with missing lines Coverage Δ
frontend/src/components/sidebar.js 92.30% <100.00%> (+92.30%) ⬆️

Continue to review full report in Codecov by Harness.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update f3a9869...f38aab4. Read the comment docs.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

urls were getting appended resulting in invalid paths

Co-authored-by: Claude <noreply@anthropic.com>
@mshriver
mshriver merged commit a9a6fb5 into ibutsu:main Jul 23, 2026
8 of 10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant