Skip to content

feat: item group support with section headers#25

Merged
gfargo merged 1 commit into
mainfrom
feat/item-groups-and-test-coverage
May 5, 2026
Merged

feat: item group support with section headers#25
gfargo merged 1 commit into
mainfrom
feat/item-groups-and-test-coverage

Conversation

@gfargo
Copy link
Copy Markdown
Owner

@gfargo gfargo commented May 5, 2026

Summary

Implements #13 — adds support for visually grouping items under section headers.

Also significantly expands test coverage (75 → 106 tests).

Changes

Item Groups (#13)

  • Added group?: string field to Item<V> type
  • Items sharing the same group value are rendered under a shared header row
  • Headers are purely visual and non-navigable (not items in the array)
  • Added DefaultGroupHeaderComponent (renders ── GroupName ── with dim styling)
  • Added groupHeaderComponent prop for custom header rendering
  • Exported DefaultGroupHeaderComponent and GroupHeaderProperties from package entry
  • Documented in README with usage examples, props table, and Item Shape

Test Coverage

  • 31 new tests covering:
    • All group rendering scenarios (horizontal, multi-select, disabled items, pagination, scroll indicators)
    • Edge cases: single item, limit=1, limit > items, empty items keyboard input
    • Multi-select: Home/End, navigation, toggle workflows
    • Horizontal orientation: Home/End, scroll indicators
    • Per-item indicator visibility toggling
    • Complex object value types with explicit keys
    • Items update scenarios (grow, shrink, replace)
    • onHighlight fires on mount
    • Callbacks not provided don't crash
  • Increased test delay default from 50ms → 100ms for stability under concurrent load

Testing

yarn test  # 106 tests passed

Closes #13

- Add group?: string field to Item<V> type
- Add DefaultGroupHeaderComponent and GroupHeaderProperties type
- Add groupHeaderComponent prop for custom header rendering
- Group headers are purely visual, non-navigable rows
- Export DefaultGroupHeaderComponent and GroupHeaderProperties
- Document groups in README with examples and props table
- Increase test delay from 50ms to 100ms for stability
- Add 31 new tests (75 → 106 total) covering:
  - All group rendering scenarios
  - Edge cases (single item, limit=1, empty items)
  - Multi-select with Home/End, navigation, groups
  - Horizontal orientation coverage
  - Per-item indicator visibility
  - Complex object value types
  - Items update scenarios (grow, shrink, replace)

Closes #13
@gfargo gfargo force-pushed the feat/item-groups-and-test-coverage branch from abadf0f to 9755149 Compare May 5, 2026 17:19
@gfargo gfargo merged commit 32b5e52 into main May 5, 2026
3 checks passed
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: support item groups with section header rendering

1 participant