Part of #162. Depends on #163 (vscode stub). Can be worked in parallel with #164/#165.
Problem
There is no way to inspect past runs or browse the active pipeline's steps without opening the YAML file manually. The user has no audit trail and no step-navigation shortcut.
Solution
Two new tree views in the ail-chat-sidebar container, hidden by default behind a toggle button in the chat view's title bar.
Toggle mechanism
let panelVisible = false;
commands.registerCommand('ail-chat.toggleInfoPanel', () => {
panelVisible = !panelVisible;
void commands.executeCommand('setContext', 'ail-chat.panelVisible', panelVisible);
});
Views use "when": "ail-chat.panelVisible" in package.json so they appear/disappear without disposal.
Run History tree (ail-chat.historyView)
RunHistoryProvider stores { runId, prompt, timestamp, logPath } in workspaceState
logPath is computed at record time: ~/.ail/projects/<sha1(cwd)>/runs/<runId>.jsonl — not at click time, so workspace changes don't lose history
- Capped at 100 entries (evict oldest on overflow)
addRun(runId, prompt, cwd) called by ChatViewProvider on each run_started event
- Tree item: first 60 chars of prompt + relative timestamp
ail-chat.openRunLog command:
- Read
logPath from the RunItem
- Parse NDJSON, format as readable text (step IDs, responses, costs, errors)
vscode.workspace.openTextDocument({ content, language: 'log' }) + showTextDocument — no webview message; native document gives find/copy/folding for free
Pipeline Steps tree (ail-chat.stepsView)
PipelineStepsProvider reads the active pipeline YAML via the yaml package (already a dep)
- Top-level steps only — sub-pipeline references (
pipeline: ./workflows/foo.ail.yaml) render as a single node labelled with the filename; no recursion
- Error node (no expand) when pipeline is missing, YAML is malformed, or in passthrough mode
- Each item: step
id + type icon (prompt/context/skill/sub-pipeline)
ail-chat.openStep command:
vscode.window.showTextDocument(vscode.Uri.file(pipelinePath))
- Search for the step
id: line → editor.revealRange(..., InCenter)
Files
New:
vscode-ail-chat/src/history-tree-provider.ts
vscode-ail-chat/src/steps-tree-provider.ts
vscode-ail-chat/test/history-tree-provider.test.ts
vscode-ail-chat/test/steps-tree-provider.test.ts
Modified:
vscode-ail-chat/src/extension.ts — register both providers + toggle command
vscode-ail-chat/src/chat-view-provider.ts — call historyProvider.addRun(...) on run_started; call stepsProvider.refresh(pipeline) on pipeline change
vscode-ail-chat/package.json:
- New views with
when: ail-chat.panelVisible
ail-chat.toggleInfoPanel command + $(layout-sidebar-right) icon
menus.view/title entry for the toggle button
ail-chat.openRunLog and ail-chat.openStep commands
Reference implementations: vscode-ail/src/views/HistoryTreeProvider.ts (152 lines) and vscode-ail/src/views/StepsTreeProvider.ts (185 lines) — match tree-item shape and contextValue conventions, but adapt to the chat extension's state model.
Test coverage (requires vscode stub from #163)
history-tree-provider.test.ts:
addRun stores entry with correct logPath computed from cwd
- 101st entry evicts the oldest
- workspaceState round-trip (mock the context)
getChildren returns entries reverse-chronological
steps-tree-provider.test.ts:
- Valid multi-step pipeline → one
StepItem per top-level step
- Sub-pipeline reference → single node with filename label
- Malformed YAML → error node, no throw
- Null pipeline (passthrough) → empty tree
Verification
- Toggle button in chat view title → "Run History" and "Pipeline Steps" appear; click again → disappear
- Run two prompts → both appear in history; click one → VS Code opens the run log as a
log-language document
- Open a multi-step pipeline → steps tree shows top-level steps; click a step → YAML opens at that
id: line, revealed in viewport
npm test passes
Risk
Low. Tree views are hidden by default; toggle is fully opt-in.
Part of #162. Depends on #163 (vscode stub). Can be worked in parallel with #164/#165.
Problem
There is no way to inspect past runs or browse the active pipeline's steps without opening the YAML file manually. The user has no audit trail and no step-navigation shortcut.
Solution
Two new tree views in the
ail-chat-sidebarcontainer, hidden by default behind a toggle button in the chat view's title bar.Toggle mechanism
Views use
"when": "ail-chat.panelVisible"inpackage.jsonso they appear/disappear without disposal.Run History tree (
ail-chat.historyView)RunHistoryProviderstores{ runId, prompt, timestamp, logPath }inworkspaceStatelogPathis computed at record time:~/.ail/projects/<sha1(cwd)>/runs/<runId>.jsonl— not at click time, so workspace changes don't lose historyaddRun(runId, prompt, cwd)called byChatViewProvideron eachrun_startedeventail-chat.openRunLogcommand:logPathfrom theRunItemvscode.workspace.openTextDocument({ content, language: 'log' })+showTextDocument— no webview message; native document gives find/copy/folding for freePipeline Steps tree (
ail-chat.stepsView)PipelineStepsProviderreads the active pipeline YAML via theyamlpackage (already a dep)pipeline: ./workflows/foo.ail.yaml) render as a single node labelled with the filename; no recursionid+ type icon (prompt/context/skill/sub-pipeline)ail-chat.openStepcommand:vscode.window.showTextDocument(vscode.Uri.file(pipelinePath))id:line →editor.revealRange(..., InCenter)Files
New:
vscode-ail-chat/src/history-tree-provider.tsvscode-ail-chat/src/steps-tree-provider.tsvscode-ail-chat/test/history-tree-provider.test.tsvscode-ail-chat/test/steps-tree-provider.test.tsModified:
vscode-ail-chat/src/extension.ts— register both providers + toggle commandvscode-ail-chat/src/chat-view-provider.ts— callhistoryProvider.addRun(...)onrun_started; callstepsProvider.refresh(pipeline)on pipeline changevscode-ail-chat/package.json:when: ail-chat.panelVisibleail-chat.toggleInfoPanelcommand +$(layout-sidebar-right)iconmenus.view/titleentry for the toggle buttonail-chat.openRunLogandail-chat.openStepcommandsReference implementations:
vscode-ail/src/views/HistoryTreeProvider.ts(152 lines) andvscode-ail/src/views/StepsTreeProvider.ts(185 lines) — match tree-item shape andcontextValueconventions, but adapt to the chat extension's state model.Test coverage (requires vscode stub from #163)
history-tree-provider.test.ts:addRunstores entry with correctlogPathcomputed from cwdgetChildrenreturns entries reverse-chronologicalsteps-tree-provider.test.ts:StepItemper top-level stepVerification
log-language documentid:line, revealed in viewportnpm testpassesRisk
Low. Tree views are hidden by default; toggle is fully opt-in.