fix: Use dynamic project name detection for ChromaDB collections and observations (#142)
* fix: Use dynamic project name detection instead of hardcoded values Fixes #140 Previously, the worker process used hardcoded "claude-mem" for: - ChromaSync instantiation in DatabaseManager - ChromaDB collection naming in search-server This caused all observations to be tagged with "claude-mem" regardless of the actual project being worked on. Now both services use getCurrentProjectName() to dynamically detect the project based on the worker's current working directory. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com> * fix: Simplify viewer UI overflow CSS to enable scrolling - Remove overcomplicated nested overflow containers - Use explicit 100vh for layout height - Add overflow: hidden to main-col to constrain feed - Keep simple overflow-y: auto on feed element - Fix issue where feed content wouldn't scroll --------- Co-authored-by: Claude <noreply@anthropic.com>
This commit is contained in:
File diff suppressed because one or more lines are too long
@@ -289,17 +289,21 @@
|
|||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
html {
|
||||||
|
height: 100%;
|
||||||
|
}
|
||||||
|
|
||||||
body {
|
body {
|
||||||
|
height: 100%;
|
||||||
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Helvetica', 'Arial', sans-serif;
|
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Helvetica', 'Arial', sans-serif;
|
||||||
background: var(--color-bg-primary);
|
background: var(--color-bg-primary);
|
||||||
color: var(--color-text-primary);
|
color: var(--color-text-primary);
|
||||||
font-size: 14px;
|
font-size: 14px;
|
||||||
overflow: hidden;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.full-height-flex-layout {
|
.full-height-flex-layout {
|
||||||
display: flex;
|
display: flex;
|
||||||
height: 100%;
|
height: 100vh;
|
||||||
position: relative;
|
position: relative;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -307,6 +311,7 @@
|
|||||||
flex: 1;
|
flex: 1;
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
|
overflow: hidden;
|
||||||
}
|
}
|
||||||
|
|
||||||
.sidebar {
|
.sidebar {
|
||||||
|
|||||||
@@ -17,13 +17,13 @@ import { basename } from 'path';
|
|||||||
import { SessionSearch } from '../services/sqlite/SessionSearch.js';
|
import { SessionSearch } from '../services/sqlite/SessionSearch.js';
|
||||||
import { SessionStore } from '../services/sqlite/SessionStore.js';
|
import { SessionStore } from '../services/sqlite/SessionStore.js';
|
||||||
import { ObservationSearchResult, SessionSummarySearchResult, UserPromptSearchResult } from '../services/sqlite/types.js';
|
import { ObservationSearchResult, SessionSummarySearchResult, UserPromptSearchResult } from '../services/sqlite/types.js';
|
||||||
import { VECTOR_DB_DIR } from '../shared/paths.js';
|
import { VECTOR_DB_DIR, getCurrentProjectName } from '../shared/paths.js';
|
||||||
|
|
||||||
// Initialize search instances
|
// Initialize search instances
|
||||||
let search: SessionSearch;
|
let search: SessionSearch;
|
||||||
let store: SessionStore;
|
let store: SessionStore;
|
||||||
let chromaClient: Client | null = null;
|
let chromaClient: Client | null = null;
|
||||||
const COLLECTION_NAME = 'cm__claude-mem';
|
const COLLECTION_NAME = `cm__${getCurrentProjectName()}`;
|
||||||
|
|
||||||
try {
|
try {
|
||||||
search = new SessionSearch();
|
search = new SessionSearch();
|
||||||
|
|||||||
@@ -12,6 +12,7 @@ import { SessionStore } from '../sqlite/SessionStore.js';
|
|||||||
import { SessionSearch } from '../sqlite/SessionSearch.js';
|
import { SessionSearch } from '../sqlite/SessionSearch.js';
|
||||||
import { ChromaSync } from '../sync/ChromaSync.js';
|
import { ChromaSync } from '../sync/ChromaSync.js';
|
||||||
import { logger } from '../../utils/logger.js';
|
import { logger } from '../../utils/logger.js';
|
||||||
|
import { getCurrentProjectName } from '../../shared/paths.js';
|
||||||
import type { DBSession } from '../worker-types.js';
|
import type { DBSession } from '../worker-types.js';
|
||||||
|
|
||||||
export class DatabaseManager {
|
export class DatabaseManager {
|
||||||
@@ -27,8 +28,9 @@ export class DatabaseManager {
|
|||||||
this.sessionStore = new SessionStore();
|
this.sessionStore = new SessionStore();
|
||||||
this.sessionSearch = new SessionSearch();
|
this.sessionSearch = new SessionSearch();
|
||||||
|
|
||||||
// Initialize ChromaSync
|
// Initialize ChromaSync with actual project name
|
||||||
this.chromaSync = new ChromaSync('claude-mem');
|
const projectName = getCurrentProjectName();
|
||||||
|
this.chromaSync = new ChromaSync(projectName);
|
||||||
|
|
||||||
// Start background backfill (fire-and-forget, with error logging)
|
// Start background backfill (fire-and-forget, with error logging)
|
||||||
this.chromaSync.ensureBackfilled().catch((error) => {
|
this.chromaSync.ensureBackfilled().catch((error) => {
|
||||||
|
|||||||
@@ -289,17 +289,21 @@
|
|||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
html {
|
||||||
|
height: 100%;
|
||||||
|
}
|
||||||
|
|
||||||
body {
|
body {
|
||||||
|
height: 100%;
|
||||||
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Helvetica', 'Arial', sans-serif;
|
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Helvetica', 'Arial', sans-serif;
|
||||||
background: var(--color-bg-primary);
|
background: var(--color-bg-primary);
|
||||||
color: var(--color-text-primary);
|
color: var(--color-text-primary);
|
||||||
font-size: 14px;
|
font-size: 14px;
|
||||||
overflow: hidden;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.full-height-flex-layout {
|
.full-height-flex-layout {
|
||||||
display: flex;
|
display: flex;
|
||||||
height: 100%;
|
height: 100vh;
|
||||||
position: relative;
|
position: relative;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -307,6 +311,7 @@
|
|||||||
flex: 1;
|
flex: 1;
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
|
overflow: hidden;
|
||||||
}
|
}
|
||||||
|
|
||||||
.sidebar {
|
.sidebar {
|
||||||
|
|||||||
Reference in New Issue
Block a user