Skip to content

Visualize running container counts on tree root and group nodes#492

Open
SATYAM-PRATIBHAN wants to merge 3 commits into
microsoft:mainfrom
SATYAM-PRATIBHAN:feature/visualize-container-states
Open

Visualize running container counts on tree root and group nodes#492
SATYAM-PRATIBHAN wants to merge 3 commits into
microsoft:mainfrom
SATYAM-PRATIBHAN:feature/visualize-container-states

Conversation

@SATYAM-PRATIBHAN

Copy link
Copy Markdown

Description

This PR improves container visibility in the tree view when nodes are collapsed or grouped, which is especially helpful in environments with many containers.

Dynamic status summaries were added to the description field of the Containers root node and individual container group nodes (such as Docker Compose projects). This makes it possible to see container state at a glance without manually expanding nodes.

Key Changes

  • Root Node: Displays (X running) next to the Containers label when one or more containers are active.
  • Group Nodes: Displays (X/Y running) next to group names, showing the number of running containers versus the total number of containers in that group.
  • Base Class Refactor: Updated LocalRootTreeItemBase and LocalGroupTreeItemBase to safely expose item data to subclasses, enabling these summaries while following existing architectural patterns.
  • Unit Tests: Added a new test suite at src/test/tree/containers/ContainerTreeVisualization.test.ts to verify the description logic for both root and group nodes.

Related Issue

Fixes #485

Visuals

Before:
Screenshot 2026-05-29 at 00 33 02

After:
Screenshot 2026-05-29 at 00 28 40

Testing

  • Manual verification: Verified in Extension Development Host that descriptions update correctly when containers start and stop.
  • Type checking: npm run build:check passed successfully.

@SATYAM-PRATIBHAN
SATYAM-PRATIBHAN requested a review from a team as a code owner May 28, 2026 19:09
Copilot AI review requested due to automatic review settings May 28, 2026 19:09
@bwateratmsft bwateratmsft self-assigned this May 28, 2026
@SATYAM-PRATIBHAN

Copy link
Copy Markdown
Author

@microsoft-github-policy-service agree

@bwateratmsft
bwateratmsft self-requested a review May 28, 2026 19:10
Comment thread src/tree/LocalGroupTreeItemBase.ts Outdated
@bwateratmsft

Copy link
Copy Markdown
Collaborator

@fiveisprime / @SATYAM-PRATIBHAN what do you think about only showing this additional description if there are non-running containers? i.e. less than 100% running

@bwateratmsft bwateratmsft left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Can you also include a screenshot of the label on the Containers root?

private _cachedItems: TItem[] | undefined;
private _currentDockerStatus: DockerStatus;

protected get currentItems(): TItem[] | undefined {

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

To protect against mistakes, I'd do:

Suggested change
protected get currentItems(): TItem[] | undefined {
protected get currentItems(): Readonly<TItem[]> | undefined {

Or maybe there's ReadonlyArray<TItem>, I can't remember

private _items: TItem[];
private _childTreeItems: AzExtTreeItem[];

protected get items(): TItem[] {

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

To protect against mistakes, I'd do:

Suggested change
protected get items(): TItem[] {
protected get items(): Readonly<TItem[]> {

Or maybe there's ReadonlyArray<TItem>, I can't remember

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.

[FEAT] Show if some or all containers are running

2 participants