fix: project selector now works

This commit is contained in:
2026-02-10 13:14:20 +01:00
parent 4eecf509cd
commit 6a80f7c7b6
5 changed files with 75 additions and 5 deletions

View File

@@ -192,14 +192,46 @@ export class DatabaseConnection {
CREATE INDEX IF NOT EXISTS idx_posts_slug ON posts(slug);
CREATE INDEX IF NOT EXISTS idx_posts_status ON posts(status);
CREATE INDEX IF NOT EXISTS idx_posts_project_id ON posts(project_id);
CREATE INDEX IF NOT EXISTS idx_posts_sync_status ON posts(sync_status);
CREATE INDEX IF NOT EXISTS idx_posts_created_at ON posts(created_at);
CREATE INDEX IF NOT EXISTS idx_media_project_id ON media(project_id);
CREATE INDEX IF NOT EXISTS idx_media_sync_status ON media(sync_status);
CREATE INDEX IF NOT EXISTS idx_sync_log_status ON sync_log(status);
`);
// Check if project_id column exists in posts table, add if missing (migration)
const postsColumns = await this.localClient.execute(
"SELECT name FROM pragma_table_info('posts') WHERE name = 'project_id'"
);
if (postsColumns.rows.length === 0) {
await this.localClient.execute(
"ALTER TABLE posts ADD COLUMN project_id TEXT NOT NULL DEFAULT 'default'"
);
await this.localClient.execute(
"CREATE INDEX IF NOT EXISTS idx_posts_project_id ON posts(project_id)"
);
} else {
await this.localClient.execute(
"CREATE INDEX IF NOT EXISTS idx_posts_project_id ON posts(project_id)"
);
}
// Check if project_id column exists in media table, add if missing (migration)
const mediaColumns = await this.localClient.execute(
"SELECT name FROM pragma_table_info('media') WHERE name = 'project_id'"
);
if (mediaColumns.rows.length === 0) {
await this.localClient.execute(
"ALTER TABLE media ADD COLUMN project_id TEXT NOT NULL DEFAULT 'default'"
);
await this.localClient.execute(
"CREATE INDEX IF NOT EXISTS idx_media_project_id ON media(project_id)"
);
} else {
await this.localClient.execute(
"CREATE INDEX IF NOT EXISTS idx_media_project_id ON media(project_id)"
);
}
// Create FTS5 virtual table for full-text search
await this.localClient.execute(`
CREATE VIRTUAL TABLE IF NOT EXISTS posts_fts USING fts5(

View File

@@ -2,6 +2,9 @@
position: relative;
padding: 8px 12px;
border-bottom: 1px solid var(--vscode-sideBar-border);
flex-shrink: 0;
background-color: var(--vscode-sideBar-background);
min-height: 44px;
}
.project-selector-trigger {
@@ -10,10 +13,10 @@
gap: 8px;
width: 100%;
padding: 6px 8px;
background-color: var(--vscode-input-background);
border: 1px solid var(--vscode-input-border);
background-color: #3c3c3c;
border: 1px solid #555555;
border-radius: 4px;
color: var(--vscode-input-foreground);
color: #e0e0e0;
cursor: pointer;
font-size: 13px;
text-align: left;

View File

@@ -12,14 +12,21 @@
--vscode-tab-inactiveBackground: #2d2d2d;
--vscode-list-hoverBackground: #2a2d2e;
--vscode-list-activeSelectionBackground: #094771;
--vscode-list-activeSelectionForeground: #ffffff;
--vscode-list-inactiveSelectionBackground: #37373d;
--vscode-input-background: #3c3c3c;
--vscode-dropdown-background: #3c3c3c;
--vscode-dropdown-foreground: #f0f0f0;
--vscode-dropdown-border: #3c3c3c;
--vscode-widget-border: #454545;
--vscode-button-background: #0e639c;
--vscode-button-hoverBackground: #1177bb;
--vscode-button-secondaryBackground: #3a3d41;
--vscode-button-secondaryForeground: #ffffff;
--vscode-button-secondaryHoverBackground: #45494e;
/* Foreground colors */
--vscode-foreground: #cccccc;
--vscode-editor-foreground: #d4d4d4;
--vscode-sideBar-foreground: #cccccc;
--vscode-activityBar-foreground: #ffffff;
@@ -44,6 +51,7 @@
--vscode-notificationsErrorIcon-foreground: #f48771;
--vscode-testing-iconPassed: #73c991;
--vscode-testing-iconFailed: #f14c4c;
--vscode-terminal-ansiGreen: #23d18b;
/* Badge colors */
--vscode-badge-background: #4d4d4d;