Skip to content

fix(dashboard): stop /dashboard/project/ spinning without slug - #413

Open
duyetbot wants to merge 1 commit into
mainfrom
fix/project-missing-slug-407
Open

fix(dashboard): stop /dashboard/project/ spinning without slug#413
duyetbot wants to merge 1 commit into
mainfrom
fix/project-missing-slug-407

Conversation

@duyetbot

@duyetbot duyetbot commented Aug 14, 2026

Copy link
Copy Markdown
Collaborator

Problem

/dashboard/project/ without ?slug= spun forever. useProjectData starts loading=true and returned immediately when !slug without setting loading false or error, so _ProjectErrorState never mounted.

Fixes #407

Fix

  • Initialize loading/error from the slug so the first render is already not-found when it is missing
  • On load() with no slug, set loading=false and error="not-found"
  • In project-content, treat a missing slug as not-found before the loading spinner

The existing error card already links back to /dashboard/.

Verification

  • No bun build (per issue instruction)
  • biome check --write ran on commit hook

Summary by Sourcery

Bug Fixes:

  • Stop the /dashboard/project/ route from spinning indefinitely when accessed without a slug by treating it as a not-found error.

useProjectData returned early when slug was missing and left
loading=true, so the error state never mounted.

Fixes #407

Co-Authored-By: Duyet Le <me@duyet.net>
Co-Authored-By: duyetbot <bot@duyet.net>
@sourcery-ai

sourcery-ai Bot commented Aug 14, 2026

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

Reviewer's Guide

Ensures the dashboard project page treats a missing ?slug= as a not-found error instead of a perpetual loading state, by initializing and updating hook state and adding an early not-found branch in the content component.

Sequence diagram for dashboard project rendering with missing slug

sequenceDiagram
  actor User
  participant Router as DashboardRouter
  participant ProjectContent
  participant useProjectData
  participant _ProjectErrorState

  User->>Router: GET /dashboard/project/
  Router->>ProjectContent: render(slug=null)
  ProjectContent->>useProjectData: useProjectData(slug=null)
  useProjectData-->>ProjectContent: { loading=false, error=not-found, project=null, retry=load }
  ProjectContent->>ProjectContent: check slug
  ProjectContent-->>_ProjectErrorState: render kind=not-found onRetry=retry
  _ProjectErrorState-->>User: Not-found error card with link to /dashboard/
Loading

File-Level Changes

Change Details Files
Initialize project loading and error state based on presence of slug so a missing slug immediately yields a not-found error instead of loading.
  • Set the useProjectData loading state initial value to true only when a slug is present, and false otherwise
  • Set the useProjectData error state initial value to 'not-found' when the slug is missing, and null when present
packages/dashboard/src/components/dashboard/project/_use-project-data.ts
Handle load() calls and rendering logic for missing slug as a not-found case rather than attempting to load.
  • Update load() in useProjectData to short-circuit when slug is missing by clearing project/conversations, setting loading to false, and error to 'not-found', while still returning a cleanup function
  • Add an early return in ProjectContent that renders the not-found ProjectErrorState when slug is missing, with a comment explaining the behavior and preventing infinite loading
packages/dashboard/src/components/dashboard/project/_use-project-data.ts
packages/dashboard/src/components/dashboard/project/project-content.tsx

Assessment against linked issues

Issue Objective Addressed Explanation
#407 Ensure that when there is no slug (!slug), useProjectData does not leave loading stuck at true and instead treats the situation as a not-found error (e.g., loading=false, error="not-found").
#407 Update the /dashboard/project/ page (project-content.tsx) so that a missing slug is handled as a not-found state (showing the error UI) rather than displaying an infinite loading spinner.

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

coderabbitai Bot commented Aug 14, 2026

Copy link
Copy Markdown

Warning

Review limit reached

@duyetbot, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 119 minutes

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 6daaa5da-8483-47db-b25a-19ea789c96da

📥 Commits

Reviewing files that changed from the base of the PR and between 39c28e4 and c64391e.

📒 Files selected for processing (2)
  • packages/dashboard/src/components/dashboard/project/_use-project-data.ts
  • packages/dashboard/src/components/dashboard/project/project-content.tsx

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.

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Hey - I've reviewed your changes and they look great!


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.

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.

/dashboard/project/ without slug spins forever

2 participants