Skip to content

feat: show config status in TUI and VS Code extension#74

Merged
digitarald merged 2 commits intomainfrom
copilot/involved-skunk
Mar 22, 2026
Merged

feat: show config status in TUI and VS Code extension#74
digitarald merged 2 commits intomainfrom
copilot/involved-skunk

Conversation

@digitarald
Copy link
Collaborator

Summary

When opening the TUI, eval presence was already displayed but agentrc.config.json status was not. This PR surfaces config detection in both the TUI and VS Code extension, with quick shortcuts to scaffold one.

Changes

Shared service

  • packages/core/src/services/configScaffold.ts — Extracted scaffoldAgentrcConfig() from the init command so both TUI and CLI share the same logic.

TUI (src/ui/tui.tsx)

  • Detects agentrc.config.json at root and .github/ on mount
  • New Config row in the Context section: green "found" / yellow "no config — press [C] to create"
  • [C] keybinding in idle state scaffolds the config from detected areas
  • [C] Create config KeyHint appears when no config exists
  • Bugfix: resets repoAreas to [] if analyzeRepo fails (prevents stale areas)

VS Code extension

  • WorkspaceStatusTreeProvider — New tree provider showing Config and Evals items with green/yellow status indicators. Missing items are clickable and trigger agentrc.init / agentrc.evalInit.
  • agentrc.workspace view registered above Analysis/Readiness in the sidebar
  • Workspace status refreshes after init and evalInit commands

Refactored

  • src/commands/init.ts now uses the shared scaffoldAgentrcConfig() service

Verification

  • ✅ Lint: 0 errors, 0 warnings
  • ✅ Typecheck: CLI + extension both pass
  • ✅ Tests: 574/574 passing
  • ✅ Code review: no blockers

Copilot AI review requested due to automatic review settings March 22, 2026 02:35
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds visibility into whether agentrc.config.json is present, surfacing that status in both the Ink-based TUI and the VS Code extension, and refactors config scaffolding into a shared core service so multiple frontends can reuse the same logic.

Changes:

  • Extracts scaffoldAgentrcConfig() into @agentrc/core so CLI/TUI can share config scaffolding logic.
  • Updates the TUI to detect agentrc.config.json, display its status, and add a [C] shortcut to scaffold it.
  • Adds a new VS Code “Workspace” view with status items for Config and Evals, including click-to-create actions.

Reviewed changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
vscode-extension/src/views/providers.ts Registers the new workspace status tree provider singleton.
vscode-extension/src/views/WorkspaceStatusTreeProvider.ts Implements the new “Workspace” status tree items for Config/Evals presence.
vscode-extension/src/extension.ts Registers the new tree view and refreshes status after init/evalInit.
vscode-extension/package.json Adds the agentrc.workspace view and welcome content.
src/ui/tui.tsx Detects config presence, displays it in the Context section, and scaffolds config via [C].
src/commands/init.ts Refactors CLI init to use the shared scaffoldAgentrcConfig() service.
packages/core/src/services/configScaffold.ts Introduces shared config scaffolding service used by CLI/TUI.

Comment on lines +55 to +61
item.description = "not found — click to create";
item.tooltip =
"No agentrc.config.json found. Click to run agentrc init and scaffold one.";
item.command = {
command: "agentrc.init",
title: "Create agentrc.config.json"
};
Copy link

Copilot AI Mar 22, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The Config tree item’s click action runs agentrc.init, but the extension’s initCommand() doesn’t scaffold/write agentrc.config.json, so clicking this will not actually create the config and the status will stay “not found”. Either update the extension init flow to call the new shared scaffoldAgentrcConfig() (and write the file) or wire this item to a dedicated command that creates agentrc.config.json.

Suggested change
item.description = "not found — click to create";
item.tooltip =
"No agentrc.config.json found. Click to run agentrc init and scaffold one.";
item.command = {
command: "agentrc.init",
title: "Create agentrc.config.json"
};
item.description = "not found";
item.tooltip =
"No agentrc.config.json found in this workspace. Run agentrc init to create one.";

Copilot uses AI. Check for mistakes.
- Fix Prettier formatting in init.ts, tui.tsx, extension.ts, WorkspaceStatusTreeProvider.ts
- Use node: prefix for built-in imports in WorkspaceStatusTreeProvider.ts
- Gate [C] Create config KeyHint on hasAgentrcConfig === false (not null)
- Add scaffoldAgentrcConfig to extension services and call it from initCommand so clicking the Config tree item actually creates agentrc.config.json
- Support multi-root workspaces in WorkspaceStatusTreeProvider: flat items for single folder, per-folder collapsible groups for multi-root
- Add unit tests for scaffoldAgentrcConfig (empty areas, standalone areas, workspace grouping, skip/force overwrite, description preservation)

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@digitarald digitarald merged commit bbfd2bd into main Mar 22, 2026
11 checks passed
@digitarald digitarald deleted the copilot/involved-skunk branch March 22, 2026 03:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants