You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Problem: The Amicode sidebar is a native VS Code TreeDataProvider that clones the workspace file explorer — it cannot render custom UI (styled buttons, status pills, device lists) and has no awareness of which project the active session is bound to.
Approach: Replace the amicode.workspace view registration from type: "tree" to type: "webview". Implement a WebviewViewProvider with a vanilla TS/DOM browser entry point and a dedicated typed postMessage bridge. The sidebar renders a fixed header (Chat + New Project buttons), a session-aware unified project tree (Research Projects with lifecycle metadata + Dev Projects as plain nodes), and a fleet section placeholder.
Scope: The sidebar registration, provider, browser-side rendering, message bridge, project scanning, and session-to-project binding. Does NOT include fleet implementation (deferred), the in-app Rail concept (deferred), or a recently-deleted recovery section (future enhancement).
Assumptions: Research Projects are detected by project.toml presence (ADR 0012). Fleet section ships as a placeholder. The sidebar is navigation chrome — destinations open in the editor area. Sessions are bound to exactly one Project (ADR 0012).
Research Project nodes show name, lifecycle phase pill, last-active timestamp
Research Project nodes expand to show file tree (lazy-loaded, respects files.exclude, hides .git)
Research Project nodes show hover-revealed action icons (new session, open)
Dev Projects and plain workspace folders show as expandable file tree nodes (no metadata)
Right-click context menu on all node types with full file-operation parity: new file, new folder, rename, delete (trash only), copy path, copy relative path, reveal in Finder, open in terminal, open to side
Research Project root nodes additionally offer "New Session" in context menu
Workspace root nodes offer "Remove from Workspace"
Delete always moves to trash (useTrash: true) — no permanent delete option
Session awareness
Sidebar highlights and auto-expands the project bound to the active session
Switching sessions (chat tabs) updates the sidebar's active project highlight
No highlight when no session is open (Landing / fresh chat state)
Clicking a non-active project only browses (expands file tree); does not switch sessions
Fleet (deferred)
Fleet section present as a collapsible placeholder or hidden behind feature flag
Cleanup
Existing workspace-tree tests removed or migrated
Key Decisions
Decision
Choice
Ref
Sidebar rendering
WebviewViewProvider (webview), not TreeDataProvider
ADR 0013
Rendering technology
Vanilla TS/DOM, no framework
ADR 0013
Communication
New sidebar_bridge.ts (typed postMessage)
—
Project + file model
Unified tree: Research Projects (rich) + Dev Projects (plain)
—
Session awareness
Sidebar follows active session; highlights bound project
—
Delete behavior
Trash only, no permanent delete
—
Fleet
Collapsible section, deferred
—
View registration
Replace amicode.workspace in-place, no coexistence
ADR 0013
Constraints & Invariants
The sidebar is navigation chrome — it never hosts a chat surface or rich visualizations
The sidebar follows sessions; it never drives session switching
Directory tree is lazy-loaded (read on expand, not upfront)
File operations reach parity with the deleted TreeView (context menus by node type)
Delete always uses { useTrash: true } — no permanent deletion from the sidebar
Important
Problem: The Amicode sidebar is a native VS Code
TreeDataProviderthat clones the workspace file explorer — it cannot render custom UI (styled buttons, status pills, device lists) and has no awareness of which project the active session is bound to.Approach: Replace the
amicode.workspaceview registration fromtype: "tree"totype: "webview". Implement aWebviewViewProviderwith a vanilla TS/DOM browser entry point and a dedicated typed postMessage bridge. The sidebar renders a fixed header (Chat + New Project buttons), a session-aware unified project tree (Research Projects with lifecycle metadata + Dev Projects as plain nodes), and a fleet section placeholder.Scope: The sidebar registration, provider, browser-side rendering, message bridge, project scanning, and session-to-project binding. Does NOT include fleet implementation (deferred), the in-app Rail concept (deferred), or a recently-deleted recovery section (future enhancement).
Assumptions: Research Projects are detected by
project.tomlpresence (ADR 0012). Fleet section ships as a placeholder. The sidebar is navigation chrome — destinations open in the editor area. Sessions are bound to exactly one Project (ADR 0012).Branching
amico/issue-663-research-projectsamico/issue-673-webview-sidebaramico/issue-663-research-projects(notmain)The sidebar's Research Project nodes depend on the
project.tomldetection and prescribed layout introduced by #663. The two features ship together.Acceptance Criteria
Registration and build
package.jsonregistersamicode.workspaceastype: "webview"SidebarViewProviderimplementsWebviewViewProviderwith CSP-nonce HTML shellsidebar_webview.tsadded as a browser entry point inesbuild.config.mjs(browser/iife)sidebar_bridge.tswith typed message protocol (separate fromchat_bridge.ts)--vscode-sideBar-background, etc.)workspace_tree.tsandtrees.tsare deletedFixed header
project.tomlscaffold)Project tree
files.exclude, hides.git)useTrash: true) — no permanent delete optionSession awareness
Fleet (deferred)
Cleanup
Key Decisions
WebviewViewProvider(webview), notTreeDataProvidersidebar_bridge.ts(typed postMessage)amicode.workspacein-place, no coexistenceConstraints & Invariants
{ useTrash: true }— no permanent deletion from the sidebarFuture Enhancements
Source
ADR 0013:
docs/adr/0013-webview-sidebar.md