Homepage dashboard reads one arbitrary repository instead of everything you can see #26

Open AtlantisPleb opened this 7h ago

Outcome

The homepage dashboard's Open Issues and Projects panels reflect what /issues and /projects actually show: everything you can read, not one arbitrary repository's slice.

Evidence

A signed-in owner with many repositories sees "no open issues" and "no projects" on the homepage while /issues lists dozens. Cause, in HomeLive.assign_dashboard/1:

  • dashboard_repository/1 picks Enum.find(visible_repositories, &(&1.lifecycle_state == "ready")) — whichever visible ready repository sorts first.
  • The issue counts, feed, and project list then read only that one repository.

When that pick is a quiet repository (a personal import, say) while the work lives elsewhere, the panels report zero against a full workspace list one click away. The choice also silently changes when repositories are added or renamed, since it depends on listing order.

Work

  • Read the dashboard's issues through Issues.list_visible_issues_page/2 and its projects through the equivalent viewer-wide authorized read, so both panels agree with /issues and /projects by construction.
  • Keep the existing bounds: the feed stays capped at @feed_limit, the project panel at six rows, counts stay cheap.
  • Decide deliberately what happens to the per-repository framing (the "View all in " links): either drop it in favor of links to /issues and /projects, or keep a secondary pointer to a specific repository without letting it define the data.
  • Preserve authorization exactly as /issues does; nothing private may appear that those pages would not show.
  • While here, note the dashboard is a mount-time snapshot; wiring it to the #14 change topic is welcome but out of scope.

Acceptance criteria

  • With issues spread across several repositories, the homepage shows the same total /issues shows.
  • A viewer whose visible set includes no issues still gets honest empty states naming why.
  • No row appears that /issues or /projects would not show to the same viewer.

Verification

LiveView tests with issues seeded across two repositories asserting homepage totals match /issues; an authorization test with a private repository; mix precommit.

  1. AtlantisPleb opened this issue 7h ago
Sign in with GitHub to comment on this issue.