You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Add useSystemReadiness hook for onboarding state #892
We need to track whether the user has completed the initial setup (adding an AI agent and monitoring a repository) so we can display targeted onboarding guidance.
Requirements
Create a custom React hook useSystemReadiness that checks for configured agents and repositories.
It should fetch data from getAgents and getRepoConfig APIs.
Return an object with hasAgents, hasRepos, isLoading, and error state.
Implementation Specification
Create a new file propr-ui/src/hooks/useSystemReadiness.ts containing the custom hook.
Handle loading states appropriately to prevent UI flashing before the API calls complete.
Acceptance Criteria
The hook successfully fetches data from both APIs.
It correctly evaluates whether at least one enabled agent and one repository exist.
Creating a centralized hook for system readiness allows any component (Dashboard, Layout Sidebar) to react to the user's onboarding progress without duplicating API calls or logic. We use Promise.all for efficiency.
File: propr-ui/src/hooks/useSystemReadiness.ts
import{useState,useEffect}from'react';import{getAgents,getRepoConfig,AgentConfig}from'../api/proprApi';exportinterfaceSystemReadiness{hasAgents: boolean;hasRepos: boolean;isLoading: boolean;error: string|null;}exportfunctionuseSystemReadiness(): SystemReadiness{const[readiness,setReadiness]=useState<SystemReadiness>({hasAgents: false,hasRepos: false,isLoading: true,error: null});useEffect(()=>{letisMounted=true;constcheckSystem=async()=>{try{// Fetch agent and repo configurations in parallel to minimize load timeconst[agentsData,repoData]=awaitPromise.all([getAgents(),getRepoConfig()]);if(!isMounted)return;// Check if there is at least one enabled agentconstenabledAgents=(agentsData.agents||[]).filter((a: AgentConfig)=>a.enabled);// Extract and validate repository configuration// Handle both legacy string array formats and newer object array formatsconstrepos=(repoDataasany).repos_to_monitor||[];constenabledRepos=repos.filter((r: any)=>{if(typeofr==='string')returntrue;if(r&&typeofr==='object')returnr.enabled!==false;returnfalse;});setReadiness({hasAgents: enabledAgents.length>0,hasRepos: enabledRepos.length>0,isLoading: false,error: null});}catch(err){if(isMounted){setReadiness(prev=>({
...prev,isLoading: false,error: (errasError).message}));}}};checkSystem();return()=>{isMounted=false;};},[]);returnreadiness;}
Activity
propr-dev commentedon Mar 3, 2026
Suggested Implementation:
Implementation Approach
Creating a centralized hook for system readiness allows any component (Dashboard, Layout Sidebar) to react to the user's onboarding progress without duplicating API calls or logic. We use
Promise.allfor efficiency.File:
propr-ui/src/hooks/useSystemReadiness.tspropr-dev commentedon Mar 3, 2026
🤖 AI processing has started for this issue using claude agent with claude-opus-4-5-20251101 model.
I'll analyze the problem and work on a solution. This may take a few minutes.
Processing Details:
claudeclaude-opus-4-5-20251101892/claude-opus-4-5-20251101-add-usesystemreadiness-ho-20260303-1203-iox892-epic-create-usesystemreadiness-xcnissue-892-20260303-1203-claude-opus-4-5-20251101-iox🔍 Track Task Execution
Implementation Summary
Implementation Summary