Skip to content

Implement tree structure groups for hierarchical resource organization#11

Draft
Copilot wants to merge 4 commits intomainfrom
copilot/fix-10
Draft

Implement tree structure groups for hierarchical resource organization#11
Copilot wants to merge 4 commits intomainfrom
copilot/fix-10

Conversation

Copy link

Copilot AI commented Sep 16, 2025

This PR implements the requested tree structure groups feature that allows organizing instructions, chatmodes, and prompts in a hierarchical structure with group-level enable/disable functionality.

Overview

The feature automatically detects folder-based organization in catalogs and creates collapsible groups in the VS Code tree view. Users can now enable/disable entire groups of related resources with a single click, making it much easier to manage complex catalogs with many resources.

Tree Structure Groups Demo

Key Changes

Resource Model Extensions:

  • Added groupPath property to Resource interface to track folder-based organization
  • New ResourceGroup interface for managing hierarchical groups with state tracking
  • Support for nested groups with recursive enable/disable operations

Enhanced Resource Discovery:

  • New extractGroupPath() method automatically detects group structure from file paths
  • Example: chatmodes/ai-agents/code-assistant.chatmode.md → creates "ai-agents" group
  • Works seamlessly with all existing catalog discovery modes (root override, per-category, remote)

Tree Provider Updates:

  • CategoryTreeProvider now displays collapsible folder groups with proper state indicators
  • Group nodes show activation status: ✅ (fully enabled), ⚠️ (partially enabled), ⏸️ (disabled)
  • Resource counts displayed as (active/total) for each group
  • Ungrouped resources continue to display normally for backward compatibility

Bulk Operations:

  • New commands: copilotCatalog.activateGroup and copilotCatalog.deactivateGroup
  • Context menus on group items provide easy access to bulk operations
  • Recursive activation/deactivation of all resources in a group and its children

Example Transformation

Before (flat structure):

📁 Chat Modes (0/5)
├── ⏸️ code-assistant
├── ⏸️ documentation-writer
├── ⏸️ testing-assistant
├── ⏸️ release-workflow
└── ⏸️ review-process

After (hierarchical groups):

📁 Chat Modes (1/5)
├── 📁 ai-agents (1/3) ⚠️
│   ├── ✅ code-assistant
│   ├── ⏸️ documentation-writer
│   └── ⏸️ testing-assistant
└── 📁 workflows (0/2) ⏸️
    ├── ⏸️ release-workflow
    └── ⏸️ review-process

Catalog Structure Support

The feature works with existing folder structures:

copilot_catalog/
├── chatmodes/
│   ├── ai-agents/           ← Becomes "ai-agents" group
│   │   ├── code-assistant.chatmode.md
│   │   └── testing-assistant.chatmode.md
│   └── workflows/           ← Becomes "workflows" group
│       └── release-process.chatmode.md
├── instructions/
│   ├── setup/               ← Becomes "setup" group
│   └── advanced/            ← Becomes "advanced" group
└── prompts/
    └── dev/                 ← Becomes "dev" group

Benefits

  • Logical Organization: Related resources are visually grouped together
  • Efficient Workflow: Enable/disable entire categories of functionality with one click
  • Clear Visibility: Immediate understanding of which groups are active/inactive
  • Scalable Management: Handle large catalogs with many resources efficiently
  • Backward Compatible: Existing flat catalogs continue to work unchanged

Testing

  • Unit tests validate group path extraction and state calculation logic
  • Integration tests verify hierarchical catalog discovery
  • VSIX package built and ready for deployment
  • Comprehensive documentation and visual demos created

The feature requires no configuration - groups are automatically created based on existing folder structures in catalogs.

Fixes #10.


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Copilot AI and others added 3 commits September 16, 2025 00:29
Co-authored-by: joninafta <12600882+joninafta@users.noreply.github.com>
…lk operations

Co-authored-by: joninafta <12600882+joninafta@users.noreply.github.com>
…ructure groups

Co-authored-by: joninafta <12600882+joninafta@users.noreply.github.com>
Copilot AI changed the title [WIP] Tree structure groups Implement tree structure groups for hierarchical resource organization Sep 16, 2025
Copilot AI requested a review from joninafta September 16, 2025 00:49
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.

Tree structure groups

2 participants