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

@@ -128,6 +128,122 @@
font-size: 14px;
}
/* ============================================
Archive & Merge Buttons
============================================ */
.chat-history-main {
flex: 1;
display: flex;
align-items: center;
gap: 12px;
min-width: 0;
}
.chat-history-archive,
.chat-history-unarchive {
flex-shrink: 0;
width: 32px;
height: 32px;
padding: 0;
background: transparent;
border: none;
border-radius: 6px;
cursor: pointer;
display: flex;
align-items: center;
justify-content: center;
font-size: 16px;
transition: all 0.2s ease;
opacity: 0;
}
.chat-history-item:hover .chat-history-archive,
.chat-history-item:hover .chat-history-unarchive {
opacity: 0.7;
}
.chat-history-archive:hover,
.chat-history-unarchive:hover {
opacity: 1 !important;
background: #2a2a2a;
transform: scale(1.1);
}
/* Merge selection state */
.chat-history-item.selected-for-merge {
background: #1a3a5a;
border-color: #4a9eff;
}
.chat-history-item.selected-for-merge::before {
content: '✓';
position: absolute;
left: 8px;
top: 50%;
transform: translateY(-50%);
color: #4a9eff;
font-weight: bold;
}
.chat-history-item {
position: relative;
}
/* Merge button */
#merge-sessions-btn {
display: none;
position: fixed;
bottom: 100px;
right: 20px;
padding: 12px 20px;
background: linear-gradient(135deg, #4a9eff 0%, #a78bfa 100%);
color: white;
border: none;
border-radius: 8px;
font-size: 14px;
font-weight: 600;
cursor: pointer;
box-shadow: 0 4px 12px rgba(74, 158, 255, 0.4);
z-index: 1000;
transition: all 0.2s ease;
}
#merge-sessions-btn:hover {
transform: translateY(-2px);
box-shadow: 0 6px 16px rgba(74, 158, 255, 0.5);
}
/* Archived sessions header button */
.sidebar-header {
display: flex;
align-items: center;
justify-content: space-between;
gap: 8px;
}
.sidebar-header-archives {
display: flex;
align-items: center;
gap: 8px;
}
.btn-show-archives {
padding: 6px 12px;
background: #2a2a2a;
border: 1px solid #444;
border-radius: 6px;
color: #e0e0e0;
font-size: 12px;
cursor: pointer;
transition: all 0.2s ease;
}
.btn-show-archives:hover {
background: #333;
border-color: #4a9eff;
}
/* ============================================
Enhanced Message Animations
============================================ */
@@ -314,11 +430,12 @@
}
/* ============================================
Enhanced Chat Layout
Enhanced Chat Layout - CODENOMAD-INSPIRED
Single-screen layout with min-height: 0 pattern
============================================ */
.chat-layout {
height: calc(100vh - 60px);
height: 100%;
overflow: hidden;
}
@@ -327,10 +444,12 @@
flex-direction: column;
height: 100%;
overflow: hidden;
min-height: 0; /* CRITICAL: Enables proper flex growth for nested flex items */
}
.chat-messages {
flex: 1;
min-height: 0; /* CRITICAL: Allows flex item to shrink below content size */
overflow-y: auto;
padding: 20px;
scroll-behavior: smooth;
@@ -354,11 +473,55 @@
}
.chat-input-container {
flex-shrink: 0; /* CRITICAL: Prevent input container from shrinking */
border-top: 1px solid #333;
background: #1a1a1a;
padding: 16px 20px;
}
/* Chat Modes Bar - Fixed at bottom above input */
.chat-modes-bar {
flex-shrink: 0; /* CRITICAL: Prevent modes bar from shrinking */
display: flex;
gap: 4px;
padding: 8px 16px;
background: #161b22;
border-top: 1px solid #333;
}
.chat-modes-bar .mode-btn {
display: flex;
align-items: center;
gap: 6px;
padding: 8px 12px;
background: transparent;
border: 1px solid transparent;
border-radius: 6px;
color: #8b949e;
cursor: pointer;
transition: all 0.2s ease;
font-size: 13px;
}
.chat-modes-bar .mode-btn:hover {
background: #21262d;
color: #c9d1d9;
}
.chat-modes-bar .mode-btn.active {
background: #1f6feb;
border-color: #58a6ff;
color: white;
}
.mode-icon {
font-size: 14px;
}
.mode-label {
font-weight: 500;
}
/* ============================================
Message Header Styling
============================================ */