Skip to content

feat!: MonthView out-of-range navigation + rename overflowBehavior → outOfRangeBehavior#22

Merged
dogmar merged 4 commits into
mainfrom
fix/m5-overflow-behavior
Jun 15, 2026
Merged

feat!: MonthView out-of-range navigation + rename overflowBehavior → outOfRangeBehavior#22
dogmar merged 4 commits into
mainfrom
fix/m5-overflow-behavior

Conversation

@dogmar

@dogmar dogmar commented Jun 15, 2026

Copy link
Copy Markdown
Collaborator

Summary

Two changes to the navigation-bounding prop, bundled because the rename must be atomic across the library and the docs site.

1. MonthView outOfRangeBehavior now actually works (audit M5)

The prop was inert on MonthView — prev/next buttons ignored it and never disabled at min/max. It's now wired into useNavButton:

  • "unbounded" (default) — paging is never restricted by min/max; out-of-range days still render disabled.
  • "stop" — prev/next disable once the destination month crosses the boundary.

2. Rename overflowBehavioroutOfRangeBehavior

overflowBehavior didn't convey that it bounds the view, not selection. Renamed for discoverability (no users yet, so the break is cheap):

Before After
prop overflowBehavior prop outOfRangeBehavior
type OverflowBehavior type OutOfRangeBehavior
type MonthOverflowBehavior type MonthOutOfRangeBehavior

Accepted values are unchanged ("unbounded" \| "stop" \| "stop-shrink" \| "snap" \| "snap-shrink"). Internal helpers (overflow.ts, applyOverflow, canShift) keep their names — they describe the windowing mechanism, not the public knob.

TSDoc on the prop and both types is expanded to spell out the view-vs-selection distinction, each value, and the precise condition under which snap and snap-shrink diverge.

Scope

Library source + types + tests, the generated formats/* subpath re-exports (regenerated), and the docs-site consumers (demo page + styled examples).

Note

BREAKING. Major version bump via semantic-release.

Verification

  • vp fmt clean · vp lint 0/0
  • Package tests 441/441
  • Package build OK — attw clean (no 💀)
  • Website build OK

🤖 Generated with Claude Code

dogmar and others added 3 commits June 15, 2026 11:39
…havior → outOfRangeBehavior

MonthView's `overflowBehavior` prop was inert — the prev/next buttons
ignored it and never disabled at the `min`/`max` bounds. Wire it into
`useNavButton`: `"stop"` disables navigation once the destination month
crosses the boundary, while `"unbounded"` (default) leaves paging
unrestricted (out-of-range days still render disabled).

Also rename the prop and its types for discoverability — `overflowBehavior`
didn't convey that it bounds the *view*, not selection:

- prop `overflowBehavior` → `outOfRangeBehavior` (MonthView + WeeksView)
- type `OverflowBehavior` → `OutOfRangeBehavior`
- type `MonthOverflowBehavior` → `MonthOutOfRangeBehavior`

TSDoc on the prop and types is expanded to explain the view-vs-selection
distinction and each value (including when `snap`/`snap-shrink` diverge).

BREAKING CHANGE: `overflowBehavior` is renamed to `outOfRangeBehavior`, and
the exported `OverflowBehavior`/`MonthOverflowBehavior` types become
`OutOfRangeBehavior`/`MonthOutOfRangeBehavior`. Accepted values are unchanged.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@netlify

netlify Bot commented Jun 15, 2026

Copy link
Copy Markdown

Deploy Preview for colander-cal ready!

Name Link
🔨 Latest commit 51e325c
🔍 Latest deploy log https://app.netlify.com/projects/colander-cal/deploys/6a3088ac1e0942d3c6539a43
😎 Deploy Preview https://deploy-preview-22--colander-cal.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

…fRangeBehavior

The public prop and types were renamed to `outOfRangeBehavior` /
`OutOfRangeBehavior` / `MonthOutOfRangeBehavior`, but the internal mechanism
still used "overflow" naming. Align it:

- overflow.ts → out-of-range.ts (+ overflow.test.ts → out-of-range.test.ts)
- applyOverflow → applyOutOfRange
- ApplyOverflowInput → ApplyOutOfRangeInput
- overflowResult → outOfRangeResult
- update imports + behavior-referring comments; regenerate format subpaths

Temporal's `{ overflow: "constrain" }` option (PlainDate.from etc.) is
unrelated and left as-is.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@dogmar dogmar merged commit 58db452 into main Jun 15, 2026
7 checks passed
@dogmar dogmar deleted the fix/m5-overflow-behavior branch June 15, 2026 23:40
@github-actions

Copy link
Copy Markdown
Contributor

🎉 This PR is included in version 3.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