Skip to content

feat(views)!: replace Activity Bar TreeViews with Ansible NavTree - #3039

Open
cidrblock wants to merge 7 commits into
ansible:nextfrom
cidrblock:feat/ansible-navtree
Open

feat(views)!: replace Activity Bar TreeViews with Ansible NavTree#3039
cidrblock wants to merge 7 commits into
ansible:nextfrom
cidrblock:feat/ansible-navtree

Conversation

@cidrblock

@cidrblock cidrblock commented Jul 21, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Replace stacked Activity Bar TreeViews with a single host-agnostic accordion sidebar (ADR-025)
  • User-facing name is Ansible (not Hub — avoids confusion with Automation Hub); code identifiers use NavTree (ansibleNavTree, AnsibleNavTreeProvider, SidebarNavTreeView)
  • Controllers (*Controller) hydrate the NavTree and own commands; Lightspeed explorer tree removed
  • Adds section registry + checklist (.sdlc/docs/add-navtree-section.md), unit/UI tests including WDIO navTreeSmoke

Review follow-ups

  • Activation no longer early-returns without a workspace (only LSP is skipped) so contributed/registered commands remain available in integration tests
  • Split view vs controller disposables so MCP/Collection Sources refresh survives webview hide/show; controllers registered on context.subscriptions
  • Welcome Python install action passes ms-python.python; DevTools pip-exec failures fall through Layer 2/3; AI Tools label uses “1 tool”
  • Docs: ADR-025 Implemented + shorter titles; catalog paths; sidebar terminology in user stories
  • CI no-envs: install ms-python.python + redhat.vscode-yaml and --disable-extension=ms-python.vscode-python-envs (empty --extensions-dir ignored installExtensions)
  • CI WDIO: stop double-opening the NavTree webview (#active-frame timeout)
  • Debounce change-driven NavTree snapshot rebuilds; harden CommandService/DevToolsService test cleanup
  • Rebased onto next after tox-ansible (feat(core): port tox-ansible integration from main with full rewrite #3046) — kept both Tox and Sidebar type re-exports

Breaking change

  • Native TreeViews are gone; only ansibleNavTree remains in the Ansible Activity Bar container
  • Open via ansible.sidebar.navTree.open / Activity Bar icon

Test plan

  • pnpm run compile after rebase onto next
  • pnpm run test:integration:no-envs (pre-rebase)
  • Vitest CommandService + DevToolsService cleanup changes
  • CI green after rebase
  • Manual: Activity Bar → Ansible → accordion sections expand/collapse; welcome actions work without python-envs
  • Confirm no user-visible “Hub” copy in sidebar, walkthrough, or command palette

@codecov

codecov Bot commented Jul 21, 2026

Copy link
Copy Markdown

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

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 implements ADR-025 by replacing the stacked native Activity Bar TreeViews with a single host-agnostic Ansible NavTree accordion rendered in a webview, backed by a serializable SidebarSnapshot model and section registry.

Changes:

  • Replace native TreeView providers with controller-driven snapshot hydration and a single ansibleNavTree webview view.
  • Introduce shared sidebar DTOs (@ansible/common), snapshot/model + section builders (@ansible/developer-services), and host-agnostic React UI (@ansible/ui).
  • Update/extend unit, integration, and WDIO coverage for the new NavTree + supporting services.

Reviewed changes

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

Show a summary per file
File Description
vitest.config.mts Adds TSX test glob for packages/ui Vitest project.
test/unit/sidebar/sidebarSnapshotPatch.test.ts Adds unit test for snapshot patching without mutation.
test/unit/sidebar/navTreeHostHelpers.test.ts Adds unit tests for host helpers (arg normalization, labels, CSP HTML).
test/ui/noAiFallback.spec.ts Updates WDIO test to validate NavTree-only view contribution + AI commands behavior.
test/ui/navTreeSmoke.spec.ts Adds WDIO smoke test for opening NavTree and expanding a section.
test/integration/no-envs/activation.test.ts Updates integration assertions to expect only ansibleNavTree.
test/integration/activation.test.ts Updates integration assertions and command prefix list for NavTree command.
src/views/SkillsProvider.ts Removes native Skills TreeDataProvider implementation.
src/views/SkillsController.ts Adds controller for skills refresh + empty-source notifications (NavTree backing).
src/views/PlaybooksController.ts Adds controller wrapper around PlaybooksService for NavTree hydration triggers.
src/views/McpToolsController.ts Adds controller to load MCP tools (static + creator-generated) for NavTree section.
src/views/ExecutionEnvironmentsController.ts Adds controller wrapper around ExecutionEnvService for NavTree updates.
src/views/EnvironmentManagersController.ts Adds controller that shapes Python env manager data for the NavTree snapshot.
src/views/CreatorProvider.ts Removes native Creator TreeDataProvider implementation.
src/views/CreatorController.ts Adds controller wrapper around CreatorService/schema state for NavTree.
src/views/CollectionsProvider.ts Removes native Collections TreeDataProvider implementation.
src/views/CollectionsController.ts Adds controller wrapper around CollectionsService + env change refresh behavior.
src/views/AnsibleDevToolsController.ts Converts provider into controller emitting change events (no TreeDataProvider UI).
src/sidebar/navTreeHtml.ts Adds CSP-safe HTML shell builder for NavTree webview.
src/sidebar/navTreeCommandArgs.ts Adds pure helpers to normalize/enrich command args from the webview.
src/sidebar/mcpLabels.ts Adds user-facing MCP category labels + IDE display name mapping for NavTree.
src/services/TerminalService.ts Improves active env resolution by falling back to cached environment selection.
src/services/PythonEnvironmentService.ts Extends terminal venv-creation fallback to optionally pip install extra packages.
src/panels/webview-entry.tsx Adds SidebarNavTreeView rendering path and sidebar CSS injection in webview entry.
README.md Updates user-facing docs to describe the Ansible accordion sidebar (NavTree).
packages/ui/test/sidebar/SidebarTree.test.tsx Adds SSR tests for SidebarTree rendering.
packages/ui/test/sidebar/SidebarShell.test.tsx Adds SSR tests for accordion open-section behavior.
packages/ui/src/views/SidebarNavTreeView.tsx Adds webview entry component that posts/receives sidebar messages.
packages/ui/src/sidebar/types.ts Re-exports sidebar DTOs from @ansible/common for stable UI import paths.
packages/ui/src/sidebar/SidebarTree.tsx Adds host-agnostic expandable tree UI with inline actions + lazy expand.
packages/ui/src/sidebar/SidebarShell.tsx Adds accordion shell UI with header actions, welcome actions, and tooltips.
packages/ui/src/sidebar/index.ts Exports sidebar components + types from UI package.
packages/ui/src/index.ts Re-exports sidebar components/types and SidebarNavTreeView from UI package root.
packages/ui/playground/vscode-theme.css Adds standalone --vscode-* CSS presets for the NavTree playground.
packages/ui/playground/vite.config.ts Adds Vite config for running the sidebar playground.
packages/ui/playground/sidebar-navtree.tsx Adds interactive playground app for sidebar UI fidelity testing.
packages/ui/playground/sidebar-navtree.html Adds HTML entrypoint for the sidebar playground.
packages/ui/playground/mock-snapshot.ts Adds mock snapshot scenarios + actions for playground rendering.
packages/ui/package.json Adds playground:sidebar script for running the UI playground.
packages/services/test/sidebar/registry.test.ts Adds tests ensuring registry order matches skeleton/full snapshot behavior.
packages/services/test/services/DevToolsService.test.ts Updates tests for new install flow preferring python -m pip when possible.
packages/services/test/services/DevToolsService.terminal.test.ts Extends terminal fallback tests, including Layer 2 failure fallback.
packages/services/test/services/CommandService.test.ts Adds test ensuring PATH is not used when an active binDir exists but tool is missing.
packages/services/src/SidebarModel.ts Adds stable re-export surface for sidebar model/types/registry/assemblers.
packages/services/src/sidebar/types.ts Defines sidebar model input types for section builders and host assembly.
packages/services/src/sidebar/SidebarModel.ts Implements snapshot/skeleton building, suggest-open logic, and expansion helpers.
packages/services/src/sidebar/sections/playbooks.ts Adds Playbooks section builder mirroring folder hierarchy and actions.
packages/services/src/sidebar/sections/lightspeed.ts Adds Lightspeed section builder for NavTree (sign-in vs feature items).
packages/services/src/sidebar/sections/executionEnvironments.ts Adds Execution Environments section builder with lazy details + actions.
packages/services/src/sidebar/sections/envManagers.ts Adds Environment Managers section builder with capability-driven welcome states.
packages/services/src/sidebar/sections/devTools.ts Adds Dev Tools section builder with install/upgrade guidance and package list.
packages/services/src/sidebar/sections/creator.ts Adds Creator section builder that maps schema into expandable command nodes.
packages/services/src/sidebar/sections/collectionSources.ts Adds Collection Sources section builder with Galaxy/GitHub actions + lazy expand.
packages/services/src/sidebar/sections/collections.ts Adds Installed Collections section builder with plugin actions and indexing state.
packages/services/src/sidebar/sections/aiTools.ts Adds AI Tools section builder (categorized MCP tools + MCP config warning).
packages/services/src/sidebar/sections/aiSkills.ts Adds AI Skills section builder (sources/modules/skills) with tooltips and actions.
packages/services/src/sidebar/registry.ts Adds ordered SECTION_REGISTRY for consistent section order + inclusion gates.
packages/services/src/sidebar/preserveExpanded.ts Preserves expanded lazy children across full snapshot rebuilds.
packages/services/src/sidebar/helpers.ts Adds shared helper for skeleton “Loading…” nodes.
packages/services/src/sidebar/assembleSidebarInput.ts Adds pure assembly functions to shape host data into SidebarModelInput.
packages/services/src/index.ts Re-exports sidebar DTO types and new SidebarModel APIs from services package.
packages/services/src/DevToolsService.ts Reworks install path to prefer deterministic python -m pip, then Layer 2, then terminal.
packages/services/src/CommandService.ts Changes tool resolution to avoid PATH leakage when a selected env binDir exists.
packages/services/src/CollectionsService.ts Treats empty cache as a miss to avoid “instant empty UI” from stale/empty cache.
packages/lightspeed/test/unit/lightspeedView.test.ts Removes unit tests for the removed Lightspeed native TreeView provider.
packages/lightspeed/src/views/lightspeedView.ts Removes the Lightspeed native TreeView provider implementation.
packages/lightspeed/src/activate.ts Removes Lightspeed TreeView registration; notes NavTree replaces it.
packages/common/test/types/execution-env.test.ts Adds tests for shortExecutionEnvironmentName.
packages/common/src/types/index.ts Exports shortExecutionEnvironmentName from common types index.
packages/common/src/types/execution-env.ts Adds shortExecutionEnvironmentName helper for EE display labels.
packages/common/src/sidebar.ts Introduces host-agnostic sidebar DTOs (SidebarSnapshot, nodes/actions, etc.).
packages/common/src/index.ts Re-exports sidebar DTOs from @ansible/common root index.
media/walkthroughs/getting-started/sidebar.md Updates walkthrough copy to describe the accordion sidebar.
knip.json Updates knip entries/ignore list for new UI playground + codicons dependency.
eslint.config.mjs Excludes UI playground from ESLint (dev-only).
.sdlc/user-stories.yaml Updates user stories to reflect accordion sidebar semantics (XC-001/002/003).
.sdlc/research/sidebar-navtree-native-parity-audit.md Adds research note documenting NavTree cutover/parity audit.
.sdlc/docs/add-navtree-section.md Adds contributor checklist for adding new NavTree sections.
.sdlc/adrs/README.md Registers ADR-025 and bumps “next ADR number” guidance.
.sdlc/adrs/ADR-025-host-agnostic-sidebar-navtree.md Adds new ADR defining NavTree architecture and rules.
.sdlc/adrs/ADR-013-scm-plugin-docs-via-shallow-clone.md Updates reference from removed provider to controller name.
.sdlc/adrs/ADR-006-esbuild-bundler.md Updates example path to match new controller naming.
.gitignore Ignores UI playground build output directory.
.agents/skills/ux-walkthrough/catalog.md Updates UX walkthrough catalog to reflect NavTree/controllers replacing TreeViews.
Files not reviewed (1)
  • pnpm-lock.yaml: Generated file

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread packages/services/src/sidebar/sections/devTools.ts
Comment thread packages/services/src/sidebar/sections/envManagers.ts Outdated
Comment thread packages/services/src/sidebar/sections/devTools.ts Outdated
Comment thread src/views/EnvironmentManagersController.ts
Comment thread src/views/EnvironmentManagersController.ts
Comment thread src/views/EnvironmentManagersController.ts
Comment thread src/services/PythonEnvironmentService.ts
@coderabbitai

coderabbitai Bot commented Jul 21, 2026

Copy link
Copy Markdown

Caution

Review failed

An error occurred during the review process. Please try again later.

📝 Walkthrough

Walkthrough

This PR replaces multiple VS Code tree views with a host-agnostic accordion sidebar. It adds shared snapshot contracts, service-side section builders, a React webview UI, controller-based host integration, progressive hydration, lazy expansion, updated installation behavior, documentation, and tests.

Changes

Ansible NavTree migration

Layer / File(s) Summary
Sidebar contracts and model
packages/common/src/sidebar.ts, packages/services/src/sidebar/*
Defines serializable snapshots, ordered section builders, lazy expansion, empty/loading states, and expanded-child preservation.
React UI and playground
packages/ui/src/sidebar/*, packages/ui/playground/*
Adds the accordion shell, recursive tree, host bridge, VS Code-themed styling, and playground scenarios.
Webview host and wiring
src/sidebar/*, src/panels/webview-entry.tsx, src/extension.ts
Registers the NavTree webview, handles bridge messages, builds snapshots, resolves lazy nodes, and routes commands.
Controllers and services
src/views/*Controller.ts, packages/services/src/*, src/services/*
Replaces provider-backed views with controllers and updates caching, tool resolution, installation, and environment handling.
Documentation and validation
.sdlc/*, README.md, package.json, test/*
Updates ADRs, UX documentation, extension metadata, integration scenarios, and automated coverage.

Estimated code review effort: 5 (Critical) | ~120 minutes

Possibly related PRs

Suggested labels: feat

Suggested reviewers: shatakshiiii, rockygeekz

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 16

🧹 Nitpick comments (5)
packages/ui/test/sidebar/SidebarShell.test.tsx (1)

42-51: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Test title doesn't match what's asserted.

The test name says "fires onOpenSectionChange…" but the body only checks markup and that onOpen was not called (SSR can't simulate clicks, per the inline comment). Consider renaming to something like renders toggle buttons for accordion control (SSR) to avoid implying click-behavior coverage that doesn't exist here.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@packages/ui/test/sidebar/SidebarShell.test.tsx` around lines 42 - 51, Rename
the test case around the SidebarShell SSR render to describe its actual
assertion: rendering accordion toggle controls and their collapsed state. Remove
the implication that onOpenSectionChange fires, while preserving the existing
markup and not-called assertions.
packages/services/src/sidebar/sections/collectionSources.ts (1)

31-102: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Consider extracting shared action-builder helpers.

The galaxy/github branches for sourceActions (Lines 31-102) and collectionActions (Lines 148-167) repeat the refresh/AI-summary action shape with only 1-2 entries differing per type. A small helper (e.g. buildRefreshAction(source), buildAiSummaryAction(source, enabled)) would reduce duplication and make future action changes single-sourced.

Also applies to: 148-167

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@packages/services/src/sidebar/sections/collectionSources.ts` around lines 31
- 102, Extract shared helpers for the refresh and AI-summary actions used by
sourceActions and collectionActions, such as builders accepting the source and
AI feature flag. Replace the duplicated action definitions in both galaxy/github
branches and collectionActions with these helpers, preserving existing IDs,
arguments, ordering, and conditional inclusion.
packages/services/src/sidebar/sections/aiTools.ts (1)

103-138: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

Unchecked as cast on tool.toolInfo shape.

The cast assumes a specific nested shape without runtime validation. Every access already uses optional chaining, so failures degrade safely — but a shared typed interface (e.g. imported ToolInfo type) would be safer than an inline unchecked cast if the MCP tool payload shape changes.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@packages/services/src/sidebar/sections/aiTools.ts` around lines 103 - 138,
Replace the inline unchecked cast in formatAiToolTooltip with the shared
ToolInfo type used for MCP tool metadata, importing it from the existing type
definition. Preserve the current optional access and fallback behavior for tool
name, description, inputSchema, and examplePrompt.
packages/services/src/sidebar/sections/devTools.ts (1)

81-84: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

Remove the leftover empty JSDoc stub above the documented shouldSuggest* helpers. Both files carry a redundant auto-generated /** * @PARAM input */ block immediately above the real doc comment; it adds noise with no value.

  • packages/services/src/sidebar/sections/devTools.ts#L81-L84: delete the empty stub block, keep the descriptive one at Lines 85-89.
  • packages/services/src/sidebar/sections/envManagers.ts#L144-L147: delete the empty stub block, keep the descriptive one at Lines 148-152.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@packages/services/src/sidebar/sections/devTools.ts` around lines 81 - 84,
Remove the redundant empty JSDoc stub above the documented shouldSuggest*
helpers in packages/services/src/sidebar/sections/devTools.ts (lines 81-84) and
packages/services/src/sidebar/sections/envManagers.ts (lines 144-147). Keep each
helper’s descriptive JSDoc comment unchanged.
src/sidebar/AnsibleNavTreeProvider.ts (1)

125-162: 🚀 Performance & Scalability | 🔵 Trivial | ⚡ Quick win

Consider debouncing _pushSnapshot triggers.

Nearly a dozen independent event sources (env managers, dev tools, collections, creator, EE service, config changes, auth session changes) each call _pushSnapshot() directly, and _buildSnapshot() unconditionally re-runs discoverPlaybooks per workspace folder and (when idle) eeService.loadExecutionEnvironments() on every call. Bursts of unrelated events (e.g., several services updating close together) will trigger redundant full rebuilds and filesystem scans rather than one coalesced refresh.

A small debounce (e.g., collect trigger sources and schedule a single _pushSnapshot() after a short delay) would reduce redundant I/O without changing behavior.

Also applies to: 354-457

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/sidebar/AnsibleNavTreeProvider.ts` around lines 125 - 162, Debounce
refreshes initiated by the event subscriptions in AnsibleNavTreeProvider so
bursts of env manager, service, configuration, and authentication changes
schedule one coalesced _pushSnapshot call. Replace direct trigger calls with a
shared scheduling method, cancel and reschedule pending work within the debounce
window, and dispose any timer or pending callback through _disposables. Apply
the same scheduling behavior to the additional _pushSnapshot triggers referenced
later in the provider.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In @.agents/skills/ux-walkthrough/catalog.md:
- Line 15: Update the Ansible catalog entry’s source references to use
src/sidebar/AnsibleNavTreeProvider.ts for the NavTree host/provider and
src/views/*Controller.ts for migrated controllers, replacing the incorrect
src/sidebar/ + *Controller.ts reference.

In @.sdlc/adrs/ADR-025-host-agnostic-sidebar-navtree.md:
- Line 1: Shorten the ADR-025 document heading from “Host-Agnostic Accordion
Sidebar NavTree” to a concise title such as “Sidebar NavTree” so the full
heading remains compact in the documentation sidebar.
- Line 5: Mark ADR-025 as Implemented by changing its status in
.sdlc/adrs/ADR-025-host-agnostic-sidebar-navtree.md at line 5. In
.sdlc/adrs/README.md at line 30, move ADR-025 from the Accepted table to the
Implemented table.

In @.sdlc/docs/add-navtree-section.md:
- Line 42: Update the controller event reference in add-navtree-section.md from
onDidChange to the documented onDidChangeTreeData contract, keeping the
surrounding guidance unchanged.

In @.sdlc/research/sidebar-navtree-native-parity-audit.md:
- Line 1: Shorten the document’s top-level heading from “Ansible NavTree vs
Native Activity Bar — Parity Audit” to a concise title such as “NavTree Parity
Audit,” preserving the audit’s meaning.

In @.sdlc/user-stories.yaml:
- Line 752: Update the acceptance-criteria wording in the environment,
collection, creator, playbook, execution-environment, and AI stories to replace
migrated “tree view” or “view” terminology with “sidebar section” or “section
item,” including the criteria at the referenced locations. Preserve the existing
acceptance behavior while aligning all descriptions with the current sidebar UI.

In `@packages/services/src/DevToolsService.ts`:
- Around line 181-231: Update install() so failures from _installViaPipExec
within the resolved-python branch are caught and logged, then continue through
the existing _packageInstaller Layer 2 attempt and _installViaTerminal fallback
instead of propagating immediately. Preserve the current early return when pip
execution succeeds, and add a regression test covering a resolved Python whose
pip install fails before fallback proceeds.

In `@packages/services/src/sidebar/assembleSidebarInput.ts`:
- Around line 167-169: Update the label construction in the tools mapping
callback so an empty or whitespace-only first description line falls back to
t.tool.name, replacing the nullish-only fallback in the firstLine expression
while preserving the existing truncation behavior.

In `@packages/services/src/sidebar/sections/devTools.ts`:
- Around line 40-46: Update the `install-python` welcome action’s `command`
configuration to pass `['ms-python.python']` to `workbench.extensions.search`,
matching the query behavior used by `envManagers.ts` while preserving the
existing label and action ID.

In `@packages/services/test/SidebarModel.test.ts`:
- Around line 185-188: Update the AI tools label formatting in the aiTools
section so a count of 1 renders “1 tool” while other counts retain the plural
“tools”; then update the SidebarModel test’s expected Discovery description to
match the singular label.

In `@packages/ui/playground/vscode-theme.css`:
- Line 29: Update the font-family declarations in the VS Code theme styles,
including the duplicate declarations, to use the casing required by Stylelint
for the BlinkMacSystemFont and Consolas font keywords. Preserve the existing
font order and fallback values.

In `@packages/ui/src/sidebar/SidebarTree.tsx`:
- Around line 62-72: Update the row keyboard handler in SidebarTree’s onKeyDown
to process Enter/Space only when the event target is the row element itself,
ignoring bubbled keydown events from nested inline action buttons rendered
alongside runAction. Preserve the existing onRowActivate behavior for direct row
activation.

In `@src/extension.ts`:
- Around line 460-508: Complete controller lifecycle management: in
src/extension.ts lines 460-508, register all nine controllers with
context.subscriptions. In src/views/ExecutionEnvironmentsController.ts lines
6-31, add dispose() for _serviceListener and _onDidChange; in
src/views/PlaybooksController.ts lines 6-29, retain the service-change
disposable and release it with _onDidChange; in src/views/SkillsController.ts
lines 18-28, dispose _onDidChange; and in src/views/McpToolsController.ts lines
52-55 and src/views/CollectionSourcesController.ts lines 585-588, extend
dispose() to release _onDidChange.
- Around line 491-504: Wire the newly created SkillsController into
AnsibleNavTreeProvider by registering its SkillsController.onDidChange event
with the provider’s refresh mechanism, alongside the existing McpToolsController
and CollectionSourcesController setup. Ensure ansibleSkills.refresh causes the
sidebar skills section to rehydrate.

In `@src/sidebar/AnsibleNavTreeProvider.ts`:
- Around line 76-98: Move the onDidChange subscription setup for _mcpTools and
_collectionSources from setMcpToolsController and setCollectionSourcesController
into resolveWebviewView, guarded by the respective controller references, so
listeners are recreated on every view resolve and tracked by the current
_disposables cycle. Keep the setters limited to storing the controller and
triggering _pushSnapshot when _view already exists.

In `@test/ui/navTreeSmoke.spec.ts`:
- Around line 18-32: Update the NavTree discovery inside the waitUntil callback
to search getAllWebviews() for the webview identified by its NavTree-specific
title or identifying property instead of assigning webviews[0]. Set navTree only
to the matching webview and keep the wait condition dependent on that match.

---

Nitpick comments:
In `@packages/services/src/sidebar/sections/aiTools.ts`:
- Around line 103-138: Replace the inline unchecked cast in formatAiToolTooltip
with the shared ToolInfo type used for MCP tool metadata, importing it from the
existing type definition. Preserve the current optional access and fallback
behavior for tool name, description, inputSchema, and examplePrompt.

In `@packages/services/src/sidebar/sections/collectionSources.ts`:
- Around line 31-102: Extract shared helpers for the refresh and AI-summary
actions used by sourceActions and collectionActions, such as builders accepting
the source and AI feature flag. Replace the duplicated action definitions in
both galaxy/github branches and collectionActions with these helpers, preserving
existing IDs, arguments, ordering, and conditional inclusion.

In `@packages/services/src/sidebar/sections/devTools.ts`:
- Around line 81-84: Remove the redundant empty JSDoc stub above the documented
shouldSuggest* helpers in packages/services/src/sidebar/sections/devTools.ts
(lines 81-84) and packages/services/src/sidebar/sections/envManagers.ts (lines
144-147). Keep each helper’s descriptive JSDoc comment unchanged.

In `@packages/ui/test/sidebar/SidebarShell.test.tsx`:
- Around line 42-51: Rename the test case around the SidebarShell SSR render to
describe its actual assertion: rendering accordion toggle controls and their
collapsed state. Remove the implication that onOpenSectionChange fires, while
preserving the existing markup and not-called assertions.

In `@src/sidebar/AnsibleNavTreeProvider.ts`:
- Around line 125-162: Debounce refreshes initiated by the event subscriptions
in AnsibleNavTreeProvider so bursts of env manager, service, configuration, and
authentication changes schedule one coalesced _pushSnapshot call. Replace direct
trigger calls with a shared scheduling method, cancel and reschedule pending
work within the debounce window, and dispose any timer or pending callback
through _disposables. Apply the same scheduling behavior to the additional
_pushSnapshot triggers referenced later in the provider.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: 048c26c8-b6b5-4003-8ae7-c8b579eb525c

📥 Commits

Reviewing files that changed from the base of the PR and between 3d61f8f and b93aa7b.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (95)
  • .agents/skills/ux-walkthrough/catalog.md
  • .gitignore
  • .sdlc/adrs/ADR-006-esbuild-bundler.md
  • .sdlc/adrs/ADR-013-scm-plugin-docs-via-shallow-clone.md
  • .sdlc/adrs/ADR-025-host-agnostic-sidebar-navtree.md
  • .sdlc/adrs/README.md
  • .sdlc/docs/add-navtree-section.md
  • .sdlc/research/sidebar-navtree-native-parity-audit.md
  • .sdlc/user-stories.yaml
  • README.md
  • eslint.config.mjs
  • knip.json
  • media/walkthroughs/getting-started/sidebar.md
  • package.json
  • packages/common/src/index.ts
  • packages/common/src/sidebar.ts
  • packages/common/src/types/execution-env.ts
  • packages/common/src/types/index.ts
  • packages/common/test/types/execution-env.test.ts
  • packages/lightspeed/src/activate.ts
  • packages/lightspeed/src/views/lightspeedView.ts
  • packages/lightspeed/test/unit/lightspeedView.test.ts
  • packages/services/src/CollectionsService.ts
  • packages/services/src/CommandService.ts
  • packages/services/src/DevToolsService.ts
  • packages/services/src/SidebarModel.ts
  • packages/services/src/index.ts
  • packages/services/src/sidebar/SidebarModel.ts
  • packages/services/src/sidebar/assembleSidebarInput.ts
  • packages/services/src/sidebar/expand.ts
  • packages/services/src/sidebar/helpers.ts
  • packages/services/src/sidebar/preserveExpanded.ts
  • packages/services/src/sidebar/registry.ts
  • packages/services/src/sidebar/sections/aiSkills.ts
  • packages/services/src/sidebar/sections/aiTools.ts
  • packages/services/src/sidebar/sections/collectionSources.ts
  • packages/services/src/sidebar/sections/collections.ts
  • packages/services/src/sidebar/sections/creator.ts
  • packages/services/src/sidebar/sections/devTools.ts
  • packages/services/src/sidebar/sections/envManagers.ts
  • packages/services/src/sidebar/sections/executionEnvironments.ts
  • packages/services/src/sidebar/sections/lightspeed.ts
  • packages/services/src/sidebar/sections/playbooks.ts
  • packages/services/src/sidebar/types.ts
  • packages/services/test/SidebarModel.test.ts
  • packages/services/test/services/CommandService.test.ts
  • packages/services/test/services/DevToolsService.terminal.test.ts
  • packages/services/test/services/DevToolsService.test.ts
  • packages/services/test/sidebar/registry.test.ts
  • packages/ui/package.json
  • packages/ui/playground/mock-snapshot.ts
  • packages/ui/playground/sidebar-navtree.html
  • packages/ui/playground/sidebar-navtree.tsx
  • packages/ui/playground/vite.config.ts
  • packages/ui/playground/vscode-theme.css
  • packages/ui/src/index.ts
  • packages/ui/src/sidebar/SidebarShell.tsx
  • packages/ui/src/sidebar/SidebarTree.tsx
  • packages/ui/src/sidebar/index.ts
  • packages/ui/src/sidebar/sidebar.css
  • packages/ui/src/sidebar/types.ts
  • packages/ui/src/views/SidebarNavTreeView.tsx
  • packages/ui/test/sidebar/SidebarShell.test.tsx
  • packages/ui/test/sidebar/SidebarTree.test.tsx
  • src/extension.ts
  • src/panels/webview-entry.tsx
  • src/services/PythonEnvironmentService.ts
  • src/services/TerminalService.ts
  • src/sidebar/AnsibleNavTreeProvider.ts
  • src/sidebar/mcpLabels.ts
  • src/sidebar/navTreeCommandArgs.ts
  • src/sidebar/navTreeHtml.ts
  • src/views/AnsibleDevToolsController.ts
  • src/views/CollectionSourcesController.ts
  • src/views/CollectionsController.ts
  • src/views/CollectionsProvider.ts
  • src/views/CreatorController.ts
  • src/views/CreatorProvider.ts
  • src/views/EnvironmentManagersController.ts
  • src/views/EnvironmentManagersProvider.ts
  • src/views/ExecutionEnvironmentsController.ts
  • src/views/ExecutionEnvironmentsProvider.ts
  • src/views/McpToolsController.ts
  • src/views/McpToolsProvider.ts
  • src/views/PlaybooksController.ts
  • src/views/PlaybooksProvider.ts
  • src/views/SkillsController.ts
  • src/views/SkillsProvider.ts
  • test/integration/activation.test.ts
  • test/integration/no-envs/activation.test.ts
  • test/ui/navTreeSmoke.spec.ts
  • test/ui/noAiFallback.spec.ts
  • test/unit/sidebar/navTreeHostHelpers.test.ts
  • test/unit/sidebar/sidebarSnapshotPatch.test.ts
  • vitest.config.mts
💤 Files with no reviewable changes (9)
  • src/views/McpToolsProvider.ts
  • src/views/CollectionsProvider.ts
  • packages/lightspeed/src/views/lightspeedView.ts
  • packages/lightspeed/test/unit/lightspeedView.test.ts
  • src/views/EnvironmentManagersProvider.ts
  • src/views/SkillsProvider.ts
  • src/views/PlaybooksProvider.ts
  • src/views/ExecutionEnvironmentsProvider.ts
  • src/views/CreatorProvider.ts

Comment thread .agents/skills/ux-walkthrough/catalog.md Outdated
Comment thread .sdlc/adrs/ADR-025-host-agnostic-sidebar-navtree.md Outdated
Comment thread .sdlc/adrs/ADR-025-host-agnostic-sidebar-navtree.md Outdated
Comment thread .sdlc/docs/add-navtree-section.md Outdated
Comment thread .sdlc/research/sidebar-navtree-native-parity-audit.md Outdated
Comment thread packages/ui/src/sidebar/SidebarTree.tsx
Comment thread src/extension.ts
Comment thread src/extension.ts
Comment thread src/sidebar/AnsibleNavTreeProvider.ts
Comment thread test/ui/navTreeSmoke.spec.ts
@github-project-automation github-project-automation Bot moved this from In Progress to Review in 🧰 devtools project board Jul 23, 2026

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 4

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@packages/services/test/services/CommandService.test.ts`:
- Around line 609-615: Clean up the shared environment cache populated by
cacheSelectedEnvironment in the getToolPath test. Add cleanup in a finally block
or test-level afterEach so the cache is cleared even when the test fails,
preventing state from leaking into subsequent tests.

In `@packages/services/test/services/DevToolsService.test.ts`:
- Around line 195-223: The test “install prefers pip exec when selected python
is known” should create its bin directory with a unique temporary-directory API
instead of hard-coding /tmp/ansible-adt-venv-bin. Wrap the setup, installation,
and assertions in try/finally, and move the recursive directory removal into the
finally block so cleanup always runs, including when assertions or setup fail.

In `@src/sidebar/AnsibleNavTreeProvider.ts`:
- Around line 126-163: Debounce snapshot rebuild requests from all change
sources in the AnsibleNavTreeProvider event subscriptions. Introduce or reuse a
debounced wrapper around _pushSnapshot, following the existing
PythonEnvironmentService._fireChangeDebounced pattern, and replace each direct
void this._pushSnapshot() callback—including configuration and authentication
session handlers—so bursts collapse into one rebuild while preserving the
existing event filters.

In `@test/integration/no-envs/activation.test.ts`:
- Around line 37-43: In the activation test, update the asserted extension
accesses around the contributed-command checks and the related lines 55–66 to
use direct access after the extension existence/active assertions. Replace
optional chaining on ext.packageJSON and ext.isActive with direct property
access, preserving the existing command inspection and assertions.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: 401154b5-bd8a-432c-9540-b78bbb0da5d2

📥 Commits

Reviewing files that changed from the base of the PR and between b93aa7b and 5ef7a2f.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (97)
  • .agents/skills/ux-walkthrough/catalog.md
  • .gitignore
  • .sdlc/adrs/ADR-006-esbuild-bundler.md
  • .sdlc/adrs/ADR-013-scm-plugin-docs-via-shallow-clone.md
  • .sdlc/adrs/ADR-025-host-agnostic-sidebar-navtree.md
  • .sdlc/adrs/README.md
  • .sdlc/docs/add-navtree-section.md
  • .sdlc/research/sidebar-navtree-native-parity-audit.md
  • .sdlc/user-stories.yaml
  • .vscode-test.mjs
  • README.md
  • eslint.config.mjs
  • knip.json
  • media/walkthroughs/getting-started/sidebar.md
  • package.json
  • packages/common/src/index.ts
  • packages/common/src/sidebar.ts
  • packages/common/src/types/execution-env.ts
  • packages/common/src/types/index.ts
  • packages/common/test/types/execution-env.test.ts
  • packages/lightspeed/src/activate.ts
  • packages/lightspeed/src/views/lightspeedView.ts
  • packages/lightspeed/test/unit/lightspeedView.test.ts
  • packages/services/src/CollectionsService.ts
  • packages/services/src/CommandService.ts
  • packages/services/src/DevToolsService.ts
  • packages/services/src/SidebarModel.ts
  • packages/services/src/index.ts
  • packages/services/src/sidebar/SidebarModel.ts
  • packages/services/src/sidebar/assembleSidebarInput.ts
  • packages/services/src/sidebar/expand.ts
  • packages/services/src/sidebar/helpers.ts
  • packages/services/src/sidebar/preserveExpanded.ts
  • packages/services/src/sidebar/registry.ts
  • packages/services/src/sidebar/sections/aiSkills.ts
  • packages/services/src/sidebar/sections/aiTools.ts
  • packages/services/src/sidebar/sections/collectionSources.ts
  • packages/services/src/sidebar/sections/collections.ts
  • packages/services/src/sidebar/sections/creator.ts
  • packages/services/src/sidebar/sections/devTools.ts
  • packages/services/src/sidebar/sections/envManagers.ts
  • packages/services/src/sidebar/sections/executionEnvironments.ts
  • packages/services/src/sidebar/sections/lightspeed.ts
  • packages/services/src/sidebar/sections/playbooks.ts
  • packages/services/src/sidebar/types.ts
  • packages/services/test/SidebarModel.test.ts
  • packages/services/test/services/CommandService.test.ts
  • packages/services/test/services/DevToolsService.terminal.test.ts
  • packages/services/test/services/DevToolsService.test.ts
  • packages/services/test/sidebar/registry.test.ts
  • packages/ui/package.json
  • packages/ui/playground/mock-snapshot.ts
  • packages/ui/playground/sidebar-navtree.html
  • packages/ui/playground/sidebar-navtree.tsx
  • packages/ui/playground/vite.config.ts
  • packages/ui/playground/vscode-theme.css
  • packages/ui/src/index.ts
  • packages/ui/src/sidebar/SidebarShell.tsx
  • packages/ui/src/sidebar/SidebarTree.tsx
  • packages/ui/src/sidebar/index.ts
  • packages/ui/src/sidebar/sidebar.css
  • packages/ui/src/sidebar/types.ts
  • packages/ui/src/views/SidebarNavTreeView.tsx
  • packages/ui/test/sidebar/SidebarShell.test.tsx
  • packages/ui/test/sidebar/SidebarTree.test.tsx
  • src/extension.ts
  • src/panels/webview-entry.tsx
  • src/services/PythonEnvironmentService.ts
  • src/services/TerminalService.ts
  • src/sidebar/AnsibleNavTreeProvider.ts
  • src/sidebar/mcpLabels.ts
  • src/sidebar/navTreeCommandArgs.ts
  • src/sidebar/navTreeHtml.ts
  • src/statusBar/ansibleStatusBar.ts
  • src/views/AnsibleDevToolsController.ts
  • src/views/CollectionSourcesController.ts
  • src/views/CollectionsController.ts
  • src/views/CollectionsProvider.ts
  • src/views/CreatorController.ts
  • src/views/CreatorProvider.ts
  • src/views/EnvironmentManagersController.ts
  • src/views/EnvironmentManagersProvider.ts
  • src/views/ExecutionEnvironmentsController.ts
  • src/views/ExecutionEnvironmentsProvider.ts
  • src/views/McpToolsController.ts
  • src/views/McpToolsProvider.ts
  • src/views/PlaybooksController.ts
  • src/views/PlaybooksProvider.ts
  • src/views/SkillsController.ts
  • src/views/SkillsProvider.ts
  • test/integration/activation.test.ts
  • test/integration/no-envs/activation.test.ts
  • test/ui/navTreeSmoke.spec.ts
  • test/ui/noAiFallback.spec.ts
  • test/unit/sidebar/navTreeHostHelpers.test.ts
  • test/unit/sidebar/sidebarSnapshotPatch.test.ts
  • vitest.config.mts
💤 Files with no reviewable changes (9)
  • packages/lightspeed/test/unit/lightspeedView.test.ts
  • packages/lightspeed/src/views/lightspeedView.ts
  • src/views/CreatorProvider.ts
  • src/views/CollectionsProvider.ts
  • src/views/ExecutionEnvironmentsProvider.ts
  • src/views/McpToolsProvider.ts
  • src/views/SkillsProvider.ts
  • src/views/EnvironmentManagersProvider.ts
  • src/views/PlaybooksProvider.ts
🚧 Files skipped from review as they are similar to previous changes (73)
  • packages/common/src/types/index.ts
  • packages/ui/playground/sidebar-navtree.html
  • packages/common/test/types/execution-env.test.ts
  • packages/services/src/sidebar/helpers.ts
  • eslint.config.mjs
  • .sdlc/adrs/ADR-006-esbuild-bundler.md
  • packages/ui/playground/vite.config.ts
  • vitest.config.mts
  • .gitignore
  • src/sidebar/mcpLabels.ts
  • packages/ui/src/sidebar/index.ts
  • test/unit/sidebar/sidebarSnapshotPatch.test.ts
  • .sdlc/research/sidebar-navtree-native-parity-audit.md
  • packages/services/src/SidebarModel.ts
  • test/ui/noAiFallback.spec.ts
  • packages/ui/test/sidebar/SidebarTree.test.tsx
  • src/sidebar/navTreeHtml.ts
  • src/views/PlaybooksController.ts
  • packages/ui/src/sidebar/types.ts
  • packages/services/src/sidebar/sections/lightspeed.ts
  • src/views/CreatorController.ts
  • packages/ui/package.json
  • packages/services/src/sidebar/registry.ts
  • media/walkthroughs/getting-started/sidebar.md
  • packages/common/src/index.ts
  • packages/services/src/sidebar/preserveExpanded.ts
  • src/views/ExecutionEnvironmentsController.ts
  • .sdlc/adrs/ADR-013-scm-plugin-docs-via-shallow-clone.md
  • packages/services/src/CollectionsService.ts
  • .sdlc/adrs/README.md
  • src/sidebar/navTreeCommandArgs.ts
  • test/ui/navTreeSmoke.spec.ts
  • packages/services/src/sidebar/types.ts
  • src/views/CollectionsController.ts
  • packages/ui/src/sidebar/sidebar.css
  • src/views/SkillsController.ts
  • packages/services/src/index.ts
  • src/panels/webview-entry.tsx
  • packages/services/src/sidebar/sections/playbooks.ts
  • packages/services/test/sidebar/registry.test.ts
  • packages/services/src/sidebar/sections/creator.ts
  • packages/services/src/CommandService.ts
  • knip.json
  • packages/ui/src/views/SidebarNavTreeView.tsx
  • packages/common/src/sidebar.ts
  • packages/ui/src/sidebar/SidebarShell.tsx
  • packages/ui/test/sidebar/SidebarShell.test.tsx
  • packages/services/src/sidebar/sections/aiSkills.ts
  • test/integration/activation.test.ts
  • packages/services/src/sidebar/sections/collections.ts
  • src/services/TerminalService.ts
  • packages/services/src/sidebar/sections/executionEnvironments.ts
  • src/views/McpToolsController.ts
  • packages/services/src/sidebar/sections/aiTools.ts
  • .agents/skills/ux-walkthrough/catalog.md
  • packages/services/src/sidebar/expand.ts
  • packages/services/src/sidebar/sections/collectionSources.ts
  • packages/services/src/sidebar/sections/envManagers.ts
  • packages/services/src/sidebar/SidebarModel.ts
  • packages/ui/playground/vscode-theme.css
  • packages/services/src/sidebar/assembleSidebarInput.ts
  • packages/lightspeed/src/activate.ts
  • packages/ui/src/sidebar/SidebarTree.tsx
  • packages/services/test/SidebarModel.test.ts
  • packages/services/src/DevToolsService.ts
  • packages/ui/playground/sidebar-navtree.tsx
  • src/services/PythonEnvironmentService.ts
  • src/views/CollectionSourcesController.ts
  • src/views/AnsibleDevToolsController.ts
  • README.md
  • packages/ui/playground/mock-snapshot.ts
  • src/views/EnvironmentManagersController.ts
  • src/extension.ts

Comment thread packages/services/test/services/CommandService.test.ts
Comment thread packages/services/test/services/DevToolsService.test.ts Outdated
Comment thread src/sidebar/AnsibleNavTreeProvider.ts
Comment thread test/integration/no-envs/activation.test.ts
@github-project-automation github-project-automation Bot moved this from Review to In Progress in 🧰 devtools project board Jul 23, 2026

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@test/integration/no-envs/activation.test.ts`:
- Around line 21-27: Extend the test named “python-envs extension is not active
in this profile” to also assert the post-startup degraded-mode behavior of the
redhat.ansible extension, rather than only checking PYTHON_ENVS_ID.isActive.
Verify the expected fallback result after startup using the existing Ansible
extension behavior or API symbols, while retaining the profile-disabled
assertion.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: 79890fbd-ffdd-4c65-af79-0e17abb7909a

📥 Commits

Reviewing files that changed from the base of the PR and between 5ef7a2f and e9c6cfb.

📒 Files selected for processing (2)
  • .vscode-test.mjs
  • test/integration/no-envs/activation.test.ts

Comment thread test/integration/no-envs/activation.test.ts
coderabbitai[bot]
coderabbitai Bot previously approved these changes Jul 23, 2026
@github-project-automation github-project-automation Bot moved this from In Progress to Review in 🧰 devtools project board Jul 23, 2026
Ship a host-agnostic accordion sidebar (ADR-025) as the sole Activity Bar UI.
User-facing copy says "Ansible" (not Hub, to avoid Automation Hub confusion);
code identifiers use NavTree (ansibleNavTree, AnsibleNavTreeProvider).

BREAKING CHANGE: Native TreeViews and Lightspeed explorer tree are removed.
Only the ansibleNavTree webview remains in the Ansible Activity Bar container.
Keep command registration when no workspace is open (only skip LSP),
fix dispose/refresh lifetime for MCP/sources, and apply Copilot/CodeRabbit
feedback on welcome args, logging, install fallback, and docs.
Use "1 tool" vs "N tools" for NavTree category descriptions.
The no-python-envs vscode-test profile had an empty extensions dir, so
ms-python.python / redhat.vscode-yaml were missing and commands did not
surface. Install those deps while still excluding python-envs.
Assert package.json contributes the expected prefixes and include
activation diagnostics when getCommands() is missing them.
@vscode/test-cli installs extensions into the shared cache and ignores
a custom --extensions-dir in launchArgs, so the empty dir left
extensionDependencies unmet. Install python/yaml and disable
python-envs instead.
Avoid double-opening the NavTree webview in WDIO smoke, debounce
snapshot rebuilds on change bursts, harden services test cleanup, and
assert ADR-019 python-only degraded mode in no-envs integration.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

Status: Review

Development

Successfully merging this pull request may close these issues.

2 participants