Skip to content

fix(dashboard): domains page never leaves skeleton - #417

Open
duyetbot wants to merge 1 commit into
mainfrom
fix/domains-project-id-409
Open

fix(dashboard): domains page never leaves skeleton#417
duyetbot wants to merge 1 commit into
mainfrom
fix/domains-project-id-409

Conversation

@duyetbot

@duyetbot duyetbot commented Aug 14, 2026

Copy link
Copy Markdown
Collaborator

Summary

Dashboard custom domains stayed on the loading skeleton forever.

_use-project-id.ts read project_id from GET /v1/projects, but ProjectResponse only has id. projectId stayed null, so the list hook never fetched and never set loading=false.

  • Use useProjectScope() / selectedProject.id instead of a second /v1/projects fetch
  • Set loading false when there is no project (after the shared scope finishes loading)
  • Add Domains to Settings nav in app-shell.tsx

Fixes #409

Test plan

  • Open /dashboard/domains/ with a signed-in project — page leaves the skeleton and lists domains (or empty state)
  • Open the page with no project — skeleton clears instead of hanging
  • Settings nav shows Domains and highlights on /dashboard/domains/
  • Switching the sidebar project reloads the domains list

Summary by Sourcery

Fix the dashboard custom domains page so it correctly loads based on the shared project scope and expose it in the Settings navigation.

Bug Fixes:

  • Resolve domains page remaining on the loading skeleton by using the active project from the shared scope and updating loading behaviour when no project is present.

Enhancements:

  • Use the shared project scope hook for domains list loading state to align with global project loading and reset state when no project is selected.
  • Add a Domains entry with icon to the Settings navigation in the app shell.

GET /v1/projects returns ProjectResponse.id, but the domains hook read
project_id and never got a project. The list hook then skipped the fetch
and never set loading=false, so the page stayed on the skeleton.

Use the shared project scope's p.id, clear loading when there is no
project, and add Domains to the Settings nav.

Fixes #409

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

Fixes the dashboard Domains page skeleton hang by sourcing the active project ID from the shared project scope, updating the domains list hook to respect scope loading state and handle no-project scenarios, and adding a Domains entry to the Settings navigation.

Sequence diagram for dashboard domains loading and skeleton behavior

sequenceDiagram
  actor User
  participant DomainsPage
  participant ProjectScope as useProjectScope
  participant DomainsListHook as useDomainsList
  participant DomainsService as loadDomains

  User->>DomainsPage: open /dashboard/domains/
  DomainsPage->>ProjectScope: useProjectScope()
  ProjectScope-->>DomainsPage: selectedProject, loadingProjects
  DomainsPage->>DomainsListHook: useDomainsList(selectedProject.id)

  alt [loadingProjects true]
    DomainsListHook-->>DomainsListHook: [wait for project scope]
  else [loadingProjects false]
    alt [projectId not null]
      DomainsListHook->>DomainsService: loadDomains(projectId)
      DomainsService-->>DomainsListHook: domains
      DomainsListHook-->>DomainsPage: setLoading(false)
    else [projectId null]
      DomainsListHook-->>DomainsPage: setDomains([])
      DomainsListHook-->>DomainsPage: setLoading(false)
    end
  end
Loading

File-Level Changes

Change Details Files
Use the shared project scope to derive the active project ID instead of performing an extra projects API request.
  • Replaced local state and effect-based fetch of /v1/projects with useProjectScope.
  • Returned selectedProject.id (falling back to null) instead of project_id from a custom response type.
  • Removed error-handling around the redundant projects fetch.
packages/dashboard/src/components/dashboard/domains/_use-project-id.ts
Update the domains list hook to wait for shared project loading to complete, trigger domain loading only when a project exists, and clear the skeleton when no project is selected.
  • Imported useProjectScope to access loadingProjects.
  • Guarded the effect so it early-returns while projects are still loading.
  • Triggered domain loading only when projectId is non-null, otherwise cleared domains and set loading to false.
packages/dashboard/src/components/dashboard/domains/_use-domains-list.ts
Expose the Domains page in the dashboard Settings navigation.
  • Imported the Globe icon for use in navigation.
  • Extended the Settings nav items with a new Domains entry pointing to /dashboard/domains/.
  • Associated the Domains nav item with the Globe icon for visual distinction.
packages/dashboard/src/components/app-shell.tsx

Assessment against linked issues

Issue Objective Addressed Explanation
#409 Use the correct project identifier (via useProjectScope) for the domains page and ensure the domains list stops loading (sets loading=false) when there is no active project.
#409 Add the Domains page to the Settings navigation in app-shell.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

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: 116 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: 6921fe33-f548-4622-8139-ffad41d96ca6

📥 Commits

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

📒 Files selected for processing (3)
  • packages/dashboard/src/components/app-shell.tsx
  • packages/dashboard/src/components/dashboard/domains/_use-domains-list.ts
  • packages/dashboard/src/components/dashboard/domains/_use-project-id.ts

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.

Domains page never leaves skeleton: reads project_id but API returns id

2 participants