Skip to content

feat: v2 hardening — event validation fix, DX warnings, playground & tooling#72

Merged
Jaganath-MSJ merged 16 commits into
devfrom
version_2
May 23, 2026
Merged

feat: v2 hardening — event validation fix, DX warnings, playground & tooling#72
Jaganath-MSJ merged 16 commits into
devfrom
version_2

Conversation

@Jaganath-MSJ

@Jaganath-MSJ Jaganath-MSJ commented May 23, 2026

Copy link
Copy Markdown
Owner

Pull Request Checklist

  • My code follows the code guidelines of this project
  • I have updated the documentation accordingly (if applicable)
  • Tests and builds pass locally

Description

This PR bundles event-validation hardening, new developer-facing warnings, a
public type export, and a full playground/tooling refresh.

Library fixes & DX

  • TC3 filter bypass (fix): Calendar now passes the validated validEvents
    into the context config, so negative-duration events (endDate before
    startDate) are filtered out in every view — previously the raw events
    array leaked through the context config. Added a regression test in
    Calendar.test.tsx.
  • K-03 warning: useEvents now emits a console.warn in dev when
    eventsAreSorted=true but the array is not actually sorted by startDate
    ascending.
  • K-05 warning: useEvents now warns when enableEnrichedEvents=true but
    enrichedEventsByDate is not supplied, and accepts enrichedEventsByDate as
    a companion argument.
  • Public API: export CalendarClassNames from src/index.ts.
  • Minor safety/cleanup: optional chaining on onSlotClick/anchorEl.focus,
    and simplified CalendarProvider config default.

Tooling

  • Type-aware ESLint enabled; lint script now surfaces tsc errors.
  • Bundle visualizer gated behind an ANALYZE env flag.
  • Dependency updates.

Playground & QA

  • Playground redesigned to a single calendar with full prop control
    (ControlPanel, TestFixtures), including a classNames control.
  • Added a /playwright slash-command playbook with cross-browser sessions.
  • Storybook stories now default to the light color scheme.

Docs

  • Expanded TEST_CASES.md with a known-issues section and updated JSDoc for
    the new warning behavior.

Fixes # (issue)

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation update
  • This change requires a documentation update

How Has This Been Tested?

  • Tested via Storybook

  • Tested via local playground application

  • Verified build bundle (npm run build)

  • Added unit tests: TC3 negative-duration regression (Calendar.test.tsx) and
    K-03/K-05 warning coverage (useEvents.test.ts); refactored the
    useResizeObserver resize test to use a synchronous act.

  • Exercised prop combinations via the redesigned playground ControlPanel.

  • Validated cross-browser behavior with the new /playwright playbook.

Jaganath-MSJ and others added 16 commits May 9, 2026 10:46
feat!: v2 — compound components, RTL, dark mode, a11y, responsive, i18n, loading states, slot creation, and breaking refactors
- @actions/core 3.0.0 → 3.0.1
- @actions/http-client 4.0.0 → 4.0.1
- undici 6.24.1 → 6.25.0
- Additional transitive dependency updates
- Replace two-calendar layout with a single focused Calendar instance
- Rename kebab-case files to PascalCase (App, ControlPanel, TestFixtures)
- Rebuild ControlPanel with collapsible sections and modified-count badges
- Add per-section and global Reset buttons
- Add theme colour pickers and localeMessages label overrides
- Replace checkboxes with CSS toggle switches for boolean props
- Add Result + Notes columns to all test matrices (A–L) with current run data
- Merge 286 PASS, 4 FAIL, 19 N/A results from 2026-05-07 test session
- Update "Results file" reference to point to this file instead of TEST_REPORT.md
- Add TEST_REPORT.md to .gitignore (local-only artifact)
- Document G-12, K-03, K-05, TC3 failures and cross-cutting findings

PLAYWRIGHT_TEST_PLAN.md is now the single source of truth for both test spec and results.
Previously the bundle visualizer ran on every build, opening
dist/stats.html in the browser unconditionally. Wrap it in a
process.env.ANALYZE guard so it only activates when needed.

- visualizer now skipped unless ANALYZE=1 is set
- run with: $env:ANALYZE=1; npm run build
…script

- Switch from recommendedTypeChecked (was: recommended) in eslint.config.js;
  add parserOptions.project to enable type-aware rules
- Chain tsc --noEmit before eslint in lint and lint:fix scripts so all
  TypeScript compiler errors appear when running npm run lint
- Fix type-safety issues uncovered by stricter checking: replace non-null
  assertion with optional chaining in DayColumn, remove unnecessary HTMLElement
  cast in Popover, simplify config fallback cast in CalendarContext
- Fix useResizeObserver test: convert dynamic act import to static top-level
  import and move assertion outside the async callback
- Exclude eslint.config.js and vite.config.ts from type-aware linting as
  they are not part of tsconfig.json
- Add §1.2 Loading States (skeleton/overlay modes, RTL, console hygiene)
- Add §1.12–1.16: Color Scheme, i18n/RTL, Responsive Layout, Accessibility, Compound API
- Add §2.6–2.8: DST boundaries, year/month spanning, Unicode/XSS edge cases
- Add §3 Known Issues table tracking confirmed bugs (G-12, K-03, K-05, TC3)
- Expand §1.6 with creatable prop, testId, and popover focus/viewport tests
- Expand §1.7 with AllDayBanner expand/collapse toggle tests
- Renumber §1.2–1.10 → §1.3–1.11 to accommodate new Loading States section
- Clarify dayType prop: controls day-name format, not time bounds
…er bypass

useEvents() correctly filtered negative-duration events, but CalendarProvider
received the unfiltered allProps.events in its config prop. All sub-views read
events from that config via useCalendarProps(), bypassing the filter entirely.
Passing validEvents into the config spread closes the bypass for every view,
including compound-component children. Adds a regression test (TC3).
Consolidates the Playwright MCP test playbook into a Claude Code
slash command at .claude/commands/playwright.md. Captures the 310-case
test matrix (sweeps A-L), session init protocol, fixture/prop catalogs,
common selectors, and per-run result log.

- 12 sweeps x 309 executed cases with PASS/FAIL/N/A results
- TC3 negative-duration filter regression tracked through full
  discovery -> fix (commit 7e5714b) -> verified-closed lifecycle
- Known Issues and Open Follow-up Items tables updated through the
  2026-05-17 retest (only K-03 and K-05 remain as OPEN library FAILs)
- Run Log preserves 2026-05-07 / 05-16 / 05-17 (initial) / 05-17 (retest)
- Emit console.warn (K-03) when eventsAreSorted=true but the array is
  unsorted — surfaces silent render-order bugs at development time
- Emit console.warn (K-05) when enableEnrichedEvents=true but
  enrichedEventsByDate is absent — prevents silent multi-day fallback
- Thread enrichedEventsByDate into useEvents call in Calendar.tsx
- Add warnSpy guards to existing tests affected by the new warnings
- Add 6 new tests covering warn/no-warn branches for K-03 and K-05
Update TEST_CASES.md known-issues table to reflect that K-03 and K-05
are now resolved — both misuse patterns emit a console.warn instead of
failing silently.

Update JSDoc on enrichedEventsByDate, enableEnrichedEvents, and
eventsAreSorted props to document the console.warn contract so
consumers are aware at authoring time.
- Export CalendarClassNames from src/index.ts (was missing from public API)
- Add 20 cn* fields to PanelState, DEFAULTS, and SECTION_KEYS
- Assemble classNames object in toCalendarProps (undefined when all empty)
- Add "Class Names" section in JSX with text inputs grouped by view area
  (Global, Month, Events, Week/Day, Schedule) -- enables E-13--E-18 interactive re-run
Call onChange outside the setState updater in patch and resetSection so
the parent setState no longer fires during React's render phase, fixing
the "Cannot update a component while rendering" warning.

Change the Section header from a <button> to a div with role="button"
(tabIndex, onKeyDown, aria-expanded) so the reset control can be a real
nested button without invalid <button>-in-<button> markup.
Document Firefox/WebKit cross-browser testing and bring the playbook in
line with the 2026-05-19 and 2026-05-21 runs.

- Add `--browser=firefox|webkit` parsing, a Cross-Browser Sessions
  section (tool namespaces, 29-case CB subset, CB Known Issues), and a
  Browser column on the Test Run Log
- Record CB results: full parity across Firefox/WebKit/Chromium; D-17
  verified PASS via a scrollTo spy (headless Firefox no-ops smooth
  scroll); note the browser-independent "1280pxpx" preset quirk
- Close K-03/K-05 and follow-up items 3-10; mark all 20 VIS screenshots
  captured; refresh the Known Issues and Open Follow-up tables
Add a global `colorScheme: "light"` arg in the Storybook preview config so
every story renders light by default instead of following the OS
`prefers-color-scheme` (the library's `auto` default). Also exclude the
`.storybook` directory from typed ESLint linting, matching how `src/stories`
and `vite.config.ts` are handled, so the pre-commit hook stops failing on
`.storybook/preview.ts`.

- Applies the light default to all current and future stories from one point
- Explicit dark/auto demo stories override via their own args, so unaffected
- Adds `.storybook` to eslint.config.js ignores to fix typed-lint parse errors
@Jaganath-MSJ Jaganath-MSJ merged commit 1388c4a into dev May 23, 2026
5 checks passed
@github-actions

Copy link
Copy Markdown

🎉 This PR is included in version 2.0.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant