Skip to content

Waysnx UI kit improvements - #6

Merged
waysnx-tech merged 2 commits into
mainfrom
waysnx-ui-kit-improvements
Oct 23, 2026
Merged

waysnx-tech merged 2 commits into
mainfrom
waysnx-ui-kit-improvements

Conversation

@krantighatpande

Copy link
Copy Markdown
Collaborator

Summary

Type

  • Bug fix
  • Accessibility
  • Security
  • Documentation
  • Performance
  • API change
  • Feature

Validation

  • Unit tests
  • Storybook
  • Playwright
  • Accessibility
  • Package/build

Documentation

  • README updated if needed
  • WDG metadata regenerated if needed

## Phase 1: Documentation + CSS Verification

Adds comprehensive documentation for WaysNX UI Kit design tokens and integration patterns.

### Added
- `docs/theming/TOKENS.md` - Complete design token reference (44 tokens, source-verified)
- `docs/integrations/EXISTING_APPS.md` - Integration strategies with technically accurate CSS guidance

### Changed
- `README.md` - Updated Design System section with accurate token count

### Verified
- ✅ All 44 token values source-verified against `packages/ui-core/src/styles/tokens.css`
- ✅ Token counts accurate (20 colors, 5 spacing, 8 typography, 4 radius, 5 shadows, 2 component)
- ✅ CSS visual inspection in Storybook (all colors correct, no inconsistencies)
- ✅ Storybook builds successfully
- ✅ P0 regression tests pass (no regressions introduced)
- ✅ Token inheritance verified in Button.css and Sidebar.css source

### Technical Accuracy
- CSS cascade layer documentation uses correct terminology (precedence, not specificity)
- Font-size table shows actual `var(--wx-accessibility-font-scale, 1)` formulas
- Integration guidance reflects actual build setup (tsup bundling)
- Verification claims limited to sampled components

### Scope
- Documentation only (no code changes)
- Phase 1 of incremental UI Kit improvements

### Review Notes
This PR is approved for PR review. Merging and publishing will follow normal final checks.
Establish comprehensive unit test infrastructure for WaysNX UI Kit component packages.

Phase 2: Test Infrastructure Setup (Steps 1 & 2)

Packages Configured:
- @waysnx/ui-core: Added vitest setup with Button test suite (9 tests)
- @waysnx/ui-navigation: Added vitest setup with Sidebar, Menu, and integration tests (68 tests)

Test Coverage:
- Total: 77 tests across 2 packages, 100% passing
- ui-core: Button component (variants, interactions, disabled state, styling)
- ui-navigation: Sidebar (collapse, persistence, SSR, accessibility)
- ui-navigation: Menu (expansion, interaction, permissions, accessibility)
- ui-navigation: Integration tests (Sidebar + Menu coordination)

Phase 3 Items Documented (11 tests):
Tests document current behavior and mark limitations for Phase 3 implementation:
- Keyboard navigation (ArrowDown, ArrowUp, Home, End, Escape) - 6 tests
- Controlled isCollapsed prop - 2 tests
- Inline style prop forwarding - 2 tests
- SSR localStorage safety - 1 test

Configuration:
- Vitest v3.2.4 (ui-core) / v3.2.7 (ui-navigation)
- @testing-library/react v16.0.0 for component testing
- Non-globals mode with explicit imports
- jsdom environment for React components

Test Quality:
- Menu expansion: Verified aria-expanded changes
- Permission filtering: Explicit negative assertions
- SSR test: Finally block for guaranteed cleanup
- Controlled state: Documented uncontrolled-only behavior
- Keyboard nav: Documented current limitations with Phase 3 markers

Files Changed:
- packages/ui-core/vitest.config.ts (new)
- packages/ui-core/tests/Button.test.tsx (new)
- packages/ui-core/package.json (added test deps + scripts)
- packages/ui-navigation/vitest.config.ts (new)
- packages/ui-navigation/tests/Sidebar.test.tsx (new)
- packages/ui-navigation/tests/Menu.test.tsx (new)
- packages/ui-navigation/tests/integration.test.tsx (new)
- packages/ui-navigation/package.json (added test deps + scripts)
- pnpm-lock.yaml (test dependency tree)
- PHASE2_STEP1_FINAL_REPORT.md (new)
- PHASE2_STEP2_FINAL_COMPLETION_REPORT.md (new)

Verification:
✓ All 77 tests passing (ui-core: 9/9, ui-navigation: 68/68)
✓ Builds successful for both packages
✓ No production code changes
✓ No regressions introduced

Part of Phase 2: Test Infrastructure Setup
@krantighatpande
krantighatpande requested a review from a team as a code owner October 23, 2026 10:03

@waysnx-tech waysnx-tech 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.

Reviewed the changes in this PR covering Phase 1 documentation and CSS verification, along with Phase 2 test infrastructure setup for @waysnx/ui-core and @waysnx/ui-navigation.

Review summary:

Design token documentation and integration guidance have been added, with token values verified against the source CSS.

Vitest infrastructure and component tests have been added for both packages.

All 77 reported tests are passing, and both package builds are successful.

Known component limitations are documented for Phase 3, including keyboard navigation, controlled Sidebar state, inline style forwarding, and SSR-safe localStorage access.

The changes are scoped to documentation, test infrastructure, configuration, and related dependencies, with no production component changes reported.

@waysnx-tech
waysnx-tech merged commit 4426e28 into main Oct 23, 2026
7 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.

2 participants