Add VS Code extension with sidebar, dashboard, and deep linking#23
Add VS Code extension with sidebar, dashboard, and deep linking#23hoangsonww merged 1 commit intomasterfrom
Conversation
…ar, and deep linking - Introduce `vscode-extension/` package with activity-bar sidebar, status bar integration, and dashboard webview - Implement commands for REPL, run task, run selection/file, dashboard lifecycle, doctor, settings, and task deep linking - Read stats and recent tasks directly from local SQLite index for offline support - Update docs, README, ARCHITECTURE.md, and index.html to document and showcase the new extension - Add .vscodeignore, tsconfig, tasks, and supporting files for extension build and packaging
There was a problem hiding this comment.
Code Review
This pull request introduces version 1.0.0 of Forge, featuring a new VS Code extension that integrates the agentic coding workflow directly into the editor. The update includes deep-linking for dashboard tasks, live markdown streaming, and a plan-edit modal. The server-side logic was enhanced to support cross-project task lookups via a global index. Review feedback focuses on optimizing project path resolution with direct SQL queries, improving the reliability of the Forge home directory detection in the extension, and ensuring shell command quoting is compatible with Windows environments.
| // caller having to know which project the task was created in. | ||
| const indexed = getTask(taskId); | ||
| if (indexed) { | ||
| const proj = listProjects().find((p) => p.id === indexed.project_id); |
There was a problem hiding this comment.
Fetching and iterating through all projects to find a single project path is inefficient, especially as the number of projects grows. Since getDb() is already available in this file, you can query the project path directly from the database using the project_id.
| const proj = listProjects().find((p) => p.id === indexed.project_id); | |
| const proj = getDb().prepare('SELECT path FROM projects WHERE id = ?').get(indexed.project_id) as { path: string } | undefined; |
| updated_at: string; | ||
| } | ||
|
|
||
| const FORGE_HOME = process.env.FORGE_HOME || path.join(os.homedir(), '.forge'); |
There was a problem hiding this comment.
The FORGE_HOME path is determined by the environment variable or a default location. However, environment variables might not be correctly propagated to the VS Code extension host depending on how VS Code was launched (e.g., from a GUI shortcut vs. terminal). Consider adding a forge.home configuration setting to allow users to explicitly define their Forge home directory, ensuring offline stats work correctly even in environments with inconsistent variable propagation.
| function shellQuote(s: string): string { | ||
| if (s === '') return "''"; | ||
| if (/^[A-Za-z0-9_./@:=+,-]+$/.test(s)) return s; | ||
| return `'${s.replace(/'/g, `'\\''`)}'`; | ||
| } |
There was a problem hiding this comment.
The shellQuote implementation uses single quotes, which is standard for POSIX shells (bash, zsh) but will fail in Windows PowerShell or Cmd when the path contains spaces (e.g., if forge.binaryPath is set to a path in C:\Program Files). In PowerShell, a quoted string is treated as a literal unless preceded by the call operator &.
Consider using a more robust quoting mechanism or detecting the shell type to ensure compatibility for Windows users not using WSL.
This pull request marks the first stable (1.0.0) release of Forge, introducing a major new surface: a first-class VS Code extension. Alongside the extension, the release includes enhancements to the dashboard (such as deep-linking and a plan-edit modal), improvements to markdown streaming and UI behavior, and several bug fixes. The documentation, changelogs, and release notes have been updated throughout to reflect the new stable status and added features.
Major new features and surfaces:
VS Code extension released: A new
vscode-extension/package provides an integrated editor experience, including an activity-bar webview, status-bar integration, command palette commands, deep-linking to the dashboard, and direct stats reading from the local database. The extension is documented in the README, changelog, architecture docs, and index page. [1] [2] [3] [4] [5] [6] [7] [8] [9] [10]Dashboard enhancements:
?task=<id>,?view=<name>) for direct navigation, used by the VS Code extension and other surfaces.Improvements and fixes:
Markdown streaming and UI: Live markdown now streams with smoother, frame-coalesced updates; REPL output formatting matches
forge run; status indicators are more reliable; and plan approval waits for explicit user action. [1] [2]Bug fixes: Addressed issues with streaming deltas, task row clickability and status, cross-project task lookups, and UI layout glitches. [1] [2]
Documentation and release process:
Changelog and release notes: Updated for v1.0.0, highlighting stable APIs, new features, and fixes. Release instructions now reference the 1.0.0 versions of both the npm and Docker packages. [1] [2] [3] [4]
VS Code workspace cleanup: Removed comment blocks from
.vscode/configuration files for clarity. [1] [2] [3] [4] [5] [6]