MCPcopy
hub / github.com/Dimillian/CodexMonitor / useMainAppGitState

Function useMainAppGitState

src/features/app/hooks/useMainAppGitState.ts:189–543  ·  view source on GitHub ↗
({
  activeWorkspace,
  activeWorkspaceId,
  activeItems,
  activeThreadId,
  activeTab,
  tabletTab,
  isCompact,
  isTablet,
  setActiveTab,
  appSettings,
  addDebugEntry,
  updateWorkspaceSettings,
  commitMessageModelId,
  connectWorkspace,
  startThreadForWorkspace,
  sendUserMessageToThread,
}: UseMainAppGitStateOptions)

Source from the content-addressed store, hash-verified

187}
188
189export function useMainAppGitState({
190 activeWorkspace,
191 activeWorkspaceId,
192 activeItems,
193 activeThreadId,
194 activeTab,
195 tabletTab,
196 isCompact,
197 isTablet,
198 setActiveTab,
199 appSettings,
200 addDebugEntry,
201 updateWorkspaceSettings,
202 commitMessageModelId,
203 connectWorkspace,
204 startThreadForWorkspace,
205 sendUserMessageToThread,
206}: UseMainAppGitStateOptions) {
207 const alertError = useCallback((error: unknown) => {
208 alert(error instanceof Error ? error.message : String(error));
209 }, []);
210
211 const {
212 gitIssues,
213 gitIssuesTotal,
214 gitIssuesLoading,
215 gitIssuesError,
216 gitPullRequests,
217 gitPullRequestsTotal,
218 gitPullRequestsLoading,
219 gitPullRequestsError,
220 gitPullRequestDiffs,
221 gitPullRequestDiffsLoading,
222 gitPullRequestDiffsError,
223 gitPullRequestComments,
224 gitPullRequestCommentsLoading,
225 gitPullRequestCommentsError,
226 handleGitIssuesChange,
227 handleGitPullRequestsChange,
228 handleGitPullRequestDiffsChange,
229 handleGitPullRequestCommentsChange,
230 resetGitHubPanelState,
231 } = useGitHubPanelController();
232
233 useEffect(() => {
234 resetGitHubPanelState();
235 }, [activeWorkspaceId, resetGitHubPanelState]);
236
237 const { remote: gitRemoteUrl, refresh: refreshGitRemote } = useGitRemote(activeWorkspace);
238 const {
239 repos: gitRootCandidates,
240 isLoading: gitRootScanLoading,
241 error: gitRootScanError,
242 depth: gitRootScanDepth,
243 hasScanned: gitRootScanHasScanned,
244 scan: scanGitRoots,
245 setDepth: setGitRootScanDepth,
246 clear: clearGitRootCandidates,

Callers 1

MainAppFunction · 0.90

Calls 12

useGitHubPanelControllerFunction · 0.90
useGitRemoteFunction · 0.90
useGitRepoScanFunction · 0.90
useGitPanelControllerFunction · 0.90
useGitActionsFunction · 0.90
useGitRootSelectionFunction · 0.90
useSyncSelectedDiffPathFunction · 0.90
useGitCommitControllerFunction · 0.90
buildGitStatusTextFunction · 0.85

Tested by

no test coverage detected