mirror of
https://github.com/catlog22/Claude-Code-Workflow.git
synced 2026-02-11 02:33:51 +08:00
feat: add tests and implementation for issue discovery and queue pages
- Implemented `DiscoveryPage` with session management and findings display. - Added tests for `DiscoveryPage` to ensure proper rendering and functionality. - Created `QueuePage` for managing issue execution queues with stats and actions. - Added tests for `QueuePage` to verify UI elements and translations. - Introduced `useIssues` hooks for fetching and managing issue data. - Added loading skeletons and error handling for better user experience. - Created `vite-env.d.ts` for TypeScript support in Vite environment.
This commit is contained in:
@@ -5,6 +5,7 @@
|
||||
|
||||
import { useQuery } from '@tanstack/react-query';
|
||||
import { fetchProjectOverview } from '../lib/api';
|
||||
import { useWorkflowStore, selectProjectPath } from '@/stores/workflowStore';
|
||||
|
||||
// Query key factory
|
||||
export const projectOverviewKeys = {
|
||||
@@ -33,11 +34,14 @@ export interface UseProjectOverviewOptions {
|
||||
export function useProjectOverview(options: UseProjectOverviewOptions = {}) {
|
||||
const { staleTime = STALE_TIME, enabled = true } = options;
|
||||
|
||||
const projectPath = useWorkflowStore(selectProjectPath);
|
||||
const queryEnabled = enabled && !!projectPath;
|
||||
|
||||
const query = useQuery({
|
||||
queryKey: projectOverviewKeys.detail(),
|
||||
queryFn: fetchProjectOverview,
|
||||
queryFn: () => fetchProjectOverview(projectPath),
|
||||
staleTime,
|
||||
enabled,
|
||||
enabled: queryEnabled,
|
||||
retry: 2,
|
||||
retryDelay: (attemptIndex) => Math.min(1000 * 2 ** attemptIndex, 10000),
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user