fix(dashboard): stop /dashboard/project/ spinning without slug - #413
fix(dashboard): stop /dashboard/project/ spinning without slug#413duyetbot wants to merge 1 commit into
Conversation
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>
Reviewer's guide (collapsed on small PRs)Reviewer's GuideEnsures 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 slugsequenceDiagram
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/
File-Level Changes
Assessment against linked issues
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
|
Warning Review limit reached
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 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 configurationConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Pro Plus Run ID: 📒 Files selected for processing (2)
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 |
Problem
/dashboard/project/without?slug=spun forever.useProjectDatastartsloading=trueand returned immediately when!slugwithout settingloadingfalse orerror, so_ProjectErrorStatenever mounted.Fixes #407
Fix
loading/errorfrom the slug so the first render is already not-found when it is missingload()with no slug, setloading=falseanderror="not-found"project-content, treat a missing slug as not-found before the loading spinnerThe existing error card already links back to
/dashboard/.Verification
bun build(per issue instruction)biome check --writeran on commit hookSummary by Sourcery
Bug Fixes: