MCPcopy
hub / github.com/stravu/crystal / openMainRepoSession

Function openMainRepoSession

frontend/src/components/ProjectTreeView.tsx:237–261  ·  view source on GitHub ↗
(project: Project)

Source from the content-addressed store, hash-verified

235 };
236
237 const openMainRepoSession = async (project: Project) => {
238 try {
239 // Get or create the main repo session
240 const response = await API.sessions.getOrCreateMainRepoSession(project.id);
241
242 if (response.success && response.data) {
243 // Navigate to the main repo session
244 const session = response.data;
245 useSessionStore.getState().setActiveSession(session.id);
246
247 // Don't expand the project - main repo sessions are accessed via folder click only
248 } else {
249 showError({
250 title: 'Failed to open main repository session',
251 error: response.error || 'Unknown error occurred'
252 });
253 }
254 } catch (error: unknown) {
255 console.error('Error handling project click:', error);
256 showError({
257 title: 'Failed to open main repository session',
258 error: error instanceof Error ? error.message : 'Unknown error occurred'
259 });
260 }
261 };
262
263 const handleCreateSession = (project: Project) => {
264 // Just show the dialog for any project

Callers 2

handleProjectClickFunction · 0.85
ProjectTreeViewFunction · 0.85

Calls 3

setActiveSessionMethod · 0.80
errorMethod · 0.80

Tested by

no test coverage detected