fix: project selector now works
This commit is contained in:
21
LICENSE
Normal file
21
LICENSE
Normal file
@@ -0,0 +1,21 @@
|
|||||||
|
MIT License
|
||||||
|
|
||||||
|
Copyright (c) 2026 bDS Contributors
|
||||||
|
|
||||||
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
|
of this software and associated documentation files (the "Software"), to deal
|
||||||
|
in the Software without restriction, including without limitation the rights
|
||||||
|
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||||
|
copies of the Software, and to permit persons to whom the Software is
|
||||||
|
furnished to do so, subject to the following conditions:
|
||||||
|
|
||||||
|
The above copyright notice and this permission notice shall be included in all
|
||||||
|
copies or substantial portions of the Software.
|
||||||
|
|
||||||
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||||
|
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||||
|
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||||
|
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||||
|
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||||
|
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||||
|
SOFTWARE.
|
||||||
@@ -33,6 +33,12 @@ All sidebar areas and panels can be resized easily and resizings are persisted s
|
|||||||
application start. UI configuration is persisted on the project level, so when I switch projects, I get the
|
application start. UI configuration is persisted on the project level, so when I switch projects, I get the
|
||||||
same layout and opened tabs as the last time I worked on that project.
|
same layout and opened tabs as the last time I worked on that project.
|
||||||
|
|
||||||
|
Sidebar will be shown/hidden by repeated clicking on same icon, just as with vscode. Also the title bar
|
||||||
|
has the typical "show/hide left sidebar" icon as vscode has it.
|
||||||
|
|
||||||
|
The main area is a tabbed layout with proper tab support that stay open even on sidebar switching and that
|
||||||
|
grow and shrink accordingly when the sidebar is activated or deactivated.
|
||||||
|
|
||||||
There are no lengthy synchronous actions in the UI thread, everything is offloaded to the main thread and
|
There are no lengthy synchronous actions in the UI thread, everything is offloaded to the main thread and
|
||||||
if it is complex, to async tasks, with proper integration with the UI and notification about state of those
|
if it is complex, to async tasks, with proper integration with the UI and notification about state of those
|
||||||
asynchronous tasks via toasts. There is a central notification framework used by everything, so we are sure
|
asynchronous tasks via toasts. There is a central notification framework used by everything, so we are sure
|
||||||
|
|||||||
@@ -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_slug ON posts(slug);
|
||||||
CREATE INDEX IF NOT EXISTS idx_posts_status ON posts(status);
|
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_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_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_media_sync_status ON media(sync_status);
|
||||||
CREATE INDEX IF NOT EXISTS idx_sync_log_status ON sync_log(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
|
// Create FTS5 virtual table for full-text search
|
||||||
await this.localClient.execute(`
|
await this.localClient.execute(`
|
||||||
CREATE VIRTUAL TABLE IF NOT EXISTS posts_fts USING fts5(
|
CREATE VIRTUAL TABLE IF NOT EXISTS posts_fts USING fts5(
|
||||||
|
|||||||
@@ -2,6 +2,9 @@
|
|||||||
position: relative;
|
position: relative;
|
||||||
padding: 8px 12px;
|
padding: 8px 12px;
|
||||||
border-bottom: 1px solid var(--vscode-sideBar-border);
|
border-bottom: 1px solid var(--vscode-sideBar-border);
|
||||||
|
flex-shrink: 0;
|
||||||
|
background-color: var(--vscode-sideBar-background);
|
||||||
|
min-height: 44px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.project-selector-trigger {
|
.project-selector-trigger {
|
||||||
@@ -10,10 +13,10 @@
|
|||||||
gap: 8px;
|
gap: 8px;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
padding: 6px 8px;
|
padding: 6px 8px;
|
||||||
background-color: var(--vscode-input-background);
|
background-color: #3c3c3c;
|
||||||
border: 1px solid var(--vscode-input-border);
|
border: 1px solid #555555;
|
||||||
border-radius: 4px;
|
border-radius: 4px;
|
||||||
color: var(--vscode-input-foreground);
|
color: #e0e0e0;
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
font-size: 13px;
|
font-size: 13px;
|
||||||
text-align: left;
|
text-align: left;
|
||||||
|
|||||||
@@ -12,14 +12,21 @@
|
|||||||
--vscode-tab-inactiveBackground: #2d2d2d;
|
--vscode-tab-inactiveBackground: #2d2d2d;
|
||||||
--vscode-list-hoverBackground: #2a2d2e;
|
--vscode-list-hoverBackground: #2a2d2e;
|
||||||
--vscode-list-activeSelectionBackground: #094771;
|
--vscode-list-activeSelectionBackground: #094771;
|
||||||
|
--vscode-list-activeSelectionForeground: #ffffff;
|
||||||
--vscode-list-inactiveSelectionBackground: #37373d;
|
--vscode-list-inactiveSelectionBackground: #37373d;
|
||||||
--vscode-input-background: #3c3c3c;
|
--vscode-input-background: #3c3c3c;
|
||||||
--vscode-dropdown-background: #3c3c3c;
|
--vscode-dropdown-background: #3c3c3c;
|
||||||
|
--vscode-dropdown-foreground: #f0f0f0;
|
||||||
|
--vscode-dropdown-border: #3c3c3c;
|
||||||
|
--vscode-widget-border: #454545;
|
||||||
--vscode-button-background: #0e639c;
|
--vscode-button-background: #0e639c;
|
||||||
--vscode-button-hoverBackground: #1177bb;
|
--vscode-button-hoverBackground: #1177bb;
|
||||||
--vscode-button-secondaryBackground: #3a3d41;
|
--vscode-button-secondaryBackground: #3a3d41;
|
||||||
|
--vscode-button-secondaryForeground: #ffffff;
|
||||||
|
--vscode-button-secondaryHoverBackground: #45494e;
|
||||||
|
|
||||||
/* Foreground colors */
|
/* Foreground colors */
|
||||||
|
--vscode-foreground: #cccccc;
|
||||||
--vscode-editor-foreground: #d4d4d4;
|
--vscode-editor-foreground: #d4d4d4;
|
||||||
--vscode-sideBar-foreground: #cccccc;
|
--vscode-sideBar-foreground: #cccccc;
|
||||||
--vscode-activityBar-foreground: #ffffff;
|
--vscode-activityBar-foreground: #ffffff;
|
||||||
@@ -44,6 +51,7 @@
|
|||||||
--vscode-notificationsErrorIcon-foreground: #f48771;
|
--vscode-notificationsErrorIcon-foreground: #f48771;
|
||||||
--vscode-testing-iconPassed: #73c991;
|
--vscode-testing-iconPassed: #73c991;
|
||||||
--vscode-testing-iconFailed: #f14c4c;
|
--vscode-testing-iconFailed: #f14c4c;
|
||||||
|
--vscode-terminal-ansiGreen: #23d18b;
|
||||||
|
|
||||||
/* Badge colors */
|
/* Badge colors */
|
||||||
--vscode-badge-background: #4d4d4d;
|
--vscode-badge-background: #4d4d4d;
|
||||||
|
|||||||
Reference in New Issue
Block a user