From cc4d8dabbc75b9a7a19763b717bab279c8d4d3c0 Mon Sep 17 00:00:00 2001 From: Arunavo Ray Date: Tue, 17 Jun 2025 14:54:23 +0530 Subject: [PATCH] refactor: enhance starred repos content selection and improve layout --- .../config/GitHubMirrorSettings.tsx | 178 ++++++++++++++---- 1 file changed, 141 insertions(+), 37 deletions(-) diff --git a/src/components/config/GitHubMirrorSettings.tsx b/src/components/config/GitHubMirrorSettings.tsx index a191dbc..eb9d701 100644 --- a/src/components/config/GitHubMirrorSettings.tsx +++ b/src/components/config/GitHubMirrorSettings.tsx @@ -76,6 +76,18 @@ export function GitHubMirrorSettings({ // When metadata is disabled, all components should be disabled const isMetadataEnabled = mirrorOptions.mirrorMetadata; + + // Calculate what content is included for starred repos + const starredRepoContent = { + code: true, // Always included + releases: !advancedOptions.skipStarredIssues && mirrorOptions.mirrorReleases, + issues: !advancedOptions.skipStarredIssues && mirrorOptions.mirrorMetadata && mirrorOptions.metadataComponents.issues, + pullRequests: !advancedOptions.skipStarredIssues && mirrorOptions.mirrorMetadata && mirrorOptions.metadataComponents.pullRequests, + wiki: !advancedOptions.skipStarredIssues && mirrorOptions.mirrorMetadata && mirrorOptions.metadataComponents.wiki, + }; + + const starredContentCount = Object.entries(starredRepoContent).filter(([key, value]) => key !== 'code' && value).length; + const totalStarredOptions = 4; // releases, issues, PRs, wiki return (
@@ -112,7 +124,7 @@ export function GitHubMirrorSettings({
-
+
- {/* Lightweight starred repos option - inline to prevent layout shift */} + {/* Starred repos content selection - inline to prevent layout shift */}
- handleAdvancedChange('skipStarredIssues', !!checked)} - disabled={!githubConfig.mirrorStarred} - /> -
- -

- Only code, skip issues and metadata -

-
+ + + + + +
+
+
Starred repos content
+ + + + + + +

+ Choose what content to mirror from starred repositories. + Selecting "Lightweight mode" will only mirror code for better performance. +

+
+
+
+
+ + + +
+
+ handleAdvancedChange('skipStarredIssues', !!checked)} + /> + +
+ + {!advancedOptions.skipStarredIssues && ( + <> + +
+

+ Content included for starred repos: +

+ +
+
+ + Source code + Always +
+ +
+ + Releases & Tags + {starredRepoContent.releases && Included} +
+ +
+ + Issues + {starredRepoContent.issues && Included} +
+ +
+ + Pull Requests + {starredRepoContent.pullRequests && Included} +
+ +
+ + Wiki + {starredRepoContent.wiki && Included} +
+
+ +

+ To include more content, enable them in the Content & Data section below +

+
+ + )} +
+
+
+