diff --git a/public/claude-ide/ide.js b/public/claude-ide/ide.js index b94bb831..776fa5d7 100644 --- a/public/claude-ide/ide.js +++ b/public/claude-ide/ide.js @@ -1,5 +1,6 @@ // Claude Code IDE JavaScript let currentSession = null; +let currentProjectName = null; let ws = null; // Make ws globally accessible for other scripts @@ -15,10 +16,18 @@ document.addEventListener('DOMContentLoaded', () => { initNavigation(); connectWebSocket(); - // Check URL params for session and prompt + // Check URL params for session, prompt, and project const urlParams = new URLSearchParams(window.location.search); const sessionId = urlParams.get('session'); const prompt = urlParams.get('prompt'); + const project = urlParams.get('project'); + + // Parse project parameter if present + if (project) { + window.currentProjectDir = decodeURIComponent(project); + currentProjectName = project.split('/').filter(Boolean).pop() || 'Project'; + console.log('[Init] Project context loaded:', currentProjectName, window.currentProjectDir); + } if (sessionId || prompt) { // Switch to chat view first