feat(sidebar): rename demoGroup to demoGroups, add multi-group support, search by group name, and context menu group navigation

This commit is contained in:
2026-01-27 09:03:10 +00:00
parent a778ad6855
commit aa2c065918
13 changed files with 1658 additions and 1796 deletions

View File

@@ -62,6 +62,33 @@ Section names are URL-encoded. Legacy routes (`element`/`page` as section name)
---
## Element Demo Groups (2026-01-27)
### Overview
Elements can declare `demoGroups` (renamed from `demoGroup`) as a static property to appear grouped in the sidebar. Supports `string | string[]` — elements with an array appear in multiple groups simultaneously.
### Usage
```typescript
// Single group
public static demoGroups = 'Buttons';
// Multiple groups — element appears in both
public static demoGroups = ['Buttons', 'Form Controls'];
```
### Features
- Search matches group names (searching "Buttons" shows all elements in that group)
- Groups sorted alphabetically by group name
- Multi-group elements show `library_books` icon instead of `featured_video`
- Context menu shows "Show in Group:" with clickable group entries that scroll to and highlight the group
- `data-group` attribute on `.item-group` containers for DOM querying
### Files Changed
- `ts_web/elements/wcc-sidebar.ts` — grouping logic, search filter, sort key, icon, context menu, scrollToGroup
- `test/elements/test-button-*.ts`, `test/elements/test-input-*.ts` — renamed `demoGroup``demoGroups`
---
## UI Redesign with Shadcn-like Styles (2025-06-27)
### Changes Made