diff --git a/src/components/RepositoryList.tsx b/src/components/RepositoryList.tsx index 36d84d7e..c02027c5 100644 --- a/src/components/RepositoryList.tsx +++ b/src/components/RepositoryList.tsx @@ -25,11 +25,12 @@ export const RepositoryList: React.FC = ({ updateRepository, language, customCategories, + analysisProgress, + setAnalysisProgress } = useAppStore(); const [showAISummary, setShowAISummary] = useState(true); const [showDropdown, setShowDropdown] = useState(false); - const [analysisProgress, setAnalysisProgress] = useState({ current: 0, total: 0 }); const [isPaused, setIsPaused] = useState(false); const [searchTime, setSearchTime] = useState(undefined); diff --git a/src/store/useAppStore.ts b/src/store/useAppStore.ts index 4103091d..7daeae1f 100644 --- a/src/store/useAppStore.ts +++ b/src/store/useAppStore.ts @@ -1,6 +1,6 @@ import { create } from 'zustand'; import { persist } from 'zustand/middleware'; -import { AppState, Repository, Release, AIConfig, WebDAVConfig, SearchFilters, GitHubUser, Category, AssetFilter, UpdateNotification } from '../types'; +import { AppState, Repository, Release, AIConfig, WebDAVConfig, SearchFilters, GitHubUser, Category, AssetFilter, UpdateNotification, AnalysisProgress } from '../types'; interface AppActions { // Auth actions @@ -56,6 +56,9 @@ interface AppActions { // Update actions setUpdateNotification: (notification: UpdateNotification | null) => void; dismissUpdateNotification: () => void; + + // Update Analysis Progress + setAnalysisProgress: (newProgress: AnalysisProgress) => void; } const initialSearchFilters: SearchFilters = { @@ -182,6 +185,7 @@ export const useAppStore = create()( currentView: 'repositories', language: 'zh', updateNotification: null, + analysisProgress: { current: 0, total: 0 }, // Auth actions setUser: (user) => { @@ -316,6 +320,7 @@ export const useAppStore = create()( // Update actions setUpdateNotification: (notification) => set({ updateNotification: notification }), dismissUpdateNotification: () => set({ updateNotification: null }), + setAnalysisProgress: (newProgress) => set({ analysisProgress: newProgress }) }), { name: 'github-stars-manager', diff --git a/src/types/index.ts b/src/types/index.ts index e7b0616c..35d7e321 100644 --- a/src/types/index.ts +++ b/src/types/index.ts @@ -157,6 +157,9 @@ export interface AppState { // Update updateNotification: UpdateNotification | null; + + // Analysis Progress + analysisProgress: AnalysisProgress } export interface UpdateNotification { @@ -165,4 +168,9 @@ export interface UpdateNotification { changelog: string[]; downloadUrl: string; dismissed: boolean; +} + +export interface AnalysisProgress { + current: number; + total: number; } \ No newline at end of file