From c6553218a28e882d74ac47566b182112a0bc8ed7 Mon Sep 17 00:00:00 2001 From: Christoph Brandau Date: Mon, 7 Sep 2026 16:19:26 +0200 Subject: [PATCH] feat(dashboard): show PR badges and deep-link to Review Center Add pull request badges to the repository dashboard and enable deep- linking to the Review Center with a repository and source pre-filter. Badges are populated by resolving remotes, matching them to configured integration sources, and querying providers for open PRs while handling loading, error, and unavailable states. The dashboard badge opens the Review Center pre-filled and the app stores initial query/source values to support the deep-link. - Resolve and normalize remotes to match integration sources reliably. - Query provider APIs using stored credentials with sensible timeouts. - Expose a badge action that navigates to the Review Center pre-filtered. --- src/App.svelte | 12 +- src/lib/components/RepositoryDashboard.svelte | 166 +++++++++++++++++- src/lib/components/ReviewCenter.svelte | 7 +- 3 files changed, 178 insertions(+), 7 deletions(-) diff --git a/src/App.svelte b/src/App.svelte index cce3116..f0fca95 100644 --- a/src/App.svelte +++ b/src/App.svelte @@ -315,6 +315,8 @@ let unlistenStartupRepository: (() => void) | undefined; let activeRepoPath = ""; let activeView: AppView = "management"; + let reviewCenterInitialQuery = ""; + let reviewCenterInitialSourceId = ""; let repoTabs: RepoTab[] = []; let repoTabContextMenu: RepoTabContextMenu | null = null; let recentRepoPaths: string[] = []; @@ -2587,9 +2589,11 @@ void backgroundRepoStatusTick(false); } - function openReviewCenter() { + function openReviewCenter(repository = "", sourceId = "") { if (isBusy) return; closeRepoTabContextMenu(); + reviewCenterInitialQuery = repository; + reviewCenterInitialSourceId = sourceId; activeView = "review-center"; trackEvent("review_center_opened", { integrations: Object.values(gitIntegrationSettings.providers).filter((provider) => provider.enabled && provider.tokenStored).length }); } @@ -5178,7 +5182,7 @@ {isBusy} language={appLanguage} onOpenManagement={openRepoManagement} - onOpenReviewCenter={openReviewCenter} + onOpenReviewCenter={() => openReviewCenter()} isActive={(path) => activeView === "repository" && sameRepoPath(activeRepoPath, path)} onSelect={selectRepoTab} onClose={closeRepoTab} @@ -5343,15 +5347,19 @@ {#if activeView === "management"} openReviewCenter(repository, sourceId)} /> {:else if activeView === "review-center"} { appSettingsOpen = true; }} /> diff --git a/src/lib/components/RepositoryDashboard.svelte b/src/lib/components/RepositoryDashboard.svelte index e1ac24e..9095a73 100644 --- a/src/lib/components/RepositoryDashboard.svelte +++ b/src/lib/components/RepositoryDashboard.svelte @@ -1,5 +1,8 @@