- Modified addSessionToProject to correctly extract projectKey from virtual workingDirs
- Virtual workingDir format: /virtual/projects/{projectKey}
- Previously was converting slashes to dashes, causing mismatch
- Added console logging to track session-to-project assignment
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
1.6 KiB
1.6 KiB
Task: CRITICAL BUG: Project isolation completely broken.
Current Behavior
User creates new project (e.g., 'roman') and clicks 'Start new session' → ALL sessions from other projects appear in this project's left sidebar.
Previous Failed Attempts
- Virtual workingDir approach - didn't work
- Skipping virtual sessions in loadProjects() - didn't work
- Smart merging logic - still doesn't work
Requirements
- Each manually created project should have ONLY its own sessions
- Auto-generated projects (from real workingDirs) should still work
- Projects must persist across page refreshes
- Switching between projects should show only that project's sessions
Files to Analyze
- /home/uroma/obsidian-web-interface/public/claude-ide/project-manager.js (main logic)
- /home/uroma/obsidian-web-interface/public/claude-ide/chat-enhanced.js (left sidebar)
- /home/uroma/obsidian-web-interface/routes/sessions-routes.js (backend API)
Progress
Iteration 1 - Fixed loadChatHistory to respect active project ✅
Modified loadChatHistory() in chat-enhanced.js to check for active project before fetching all sessions from API. When active project exists, it uses activeProject.sessions instead. Added detailed console logging for debugging.
Commit: 55aafba
Next Steps
- Test in browser to verify isolation works
- May need additional fixes for initialization timing issues
Success Criteria
The task is complete when:
- All requirements are implemented
- Tests pass
- Code is documented