diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..6d59796 --- /dev/null +++ b/LICENSE @@ -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. diff --git a/VISION.md b/VISION.md index af5bcec..14f99c9 100644 --- a/VISION.md +++ b/VISION.md @@ -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 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 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 diff --git a/src/main/database/connection.ts b/src/main/database/connection.ts index 9d258cd..7d423b3 100644 --- a/src/main/database/connection.ts +++ b/src/main/database/connection.ts @@ -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( diff --git a/src/renderer/components/ProjectSelector/ProjectSelector.css b/src/renderer/components/ProjectSelector/ProjectSelector.css index 6edab25..3e1b03f 100644 --- a/src/renderer/components/ProjectSelector/ProjectSelector.css +++ b/src/renderer/components/ProjectSelector/ProjectSelector.css @@ -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; diff --git a/src/renderer/styles/global.css b/src/renderer/styles/global.css index db46635..aa6f14e 100644 --- a/src/renderer/styles/global.css +++ b/src/renderer/styles/global.css @@ -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;