Fix project isolation: Make loadChatHistory respect active project sessions

- Modified loadChatHistory() to check for active project before fetching all sessions
- When active project exists, use project.sessions instead of fetching from API
- Added detailed console logging to debug session filtering
- This prevents ALL sessions from appearing in every project's sidebar

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
uroma
2026-01-22 14:43:05 +00:00
Unverified
parent b82837aa5f
commit 55aafbae9a
6463 changed files with 1115462 additions and 4486 deletions

View File

@@ -623,6 +623,7 @@ body {
display: flex;
flex-direction: column;
overflow: hidden;
min-height: 0; /* CRITICAL: Enables proper flex growth for nested flex items */
}
/* Chat Header */
@@ -632,6 +633,7 @@ body {
display: flex;
justify-content: space-between;
align-items: center;
flex-shrink: 0; /* Prevent header from shrinking */
}
.chat-session-info h2 {
@@ -650,11 +652,13 @@ body {
gap: 0.5rem;
}
/* Chat Messages */
/* Chat Messages - CODENOMAD-INSPIRED: Single-screen layout */
.chat-messages {
flex: 1;
min-height: 0; /* CRITICAL: Allows flex item to shrink below content size */
overflow-y: auto;
padding: 2rem;
scroll-behavior: smooth;
}
.chat-welcome {
@@ -1219,6 +1223,48 @@ body {
color: #888;
}
/* Session Close Button - Always visible but subtle */
.session-close-btn {
position: absolute;
top: 12px;
right: 12px;
width: 28px;
height: 28px;
display: flex;
align-items: center;
justify-content: center;
background: rgba(255, 77, 77, 0.08);
border: 1px solid rgba(255, 77, 77, 0.2);
border-radius: 6px;
color: #ff6b6b;
cursor: pointer;
opacity: 0.5;
transition: all 0.2s ease;
font-size: 16px;
line-height: 1;
z-index: 10;
}
.session-item {
position: relative;
}
.session-item:hover .session-close-btn {
opacity: 1;
background: rgba(255, 77, 77, 0.15);
border-color: rgba(255, 77, 77, 0.4);
}
.session-close-btn:hover {
background: rgba(255, 77, 77, 0.2);
border-color: #ff6b6b;
transform: scale(1.1);
}
.session-close-btn:active {
transform: scale(0.95);
}
/* Empty/Error States */
.empty-state, .error-state {
text-align: center;