Release v2.6.3#85
Merged
Merged
Conversation
Fix: hourLimit greying logic for PM hours and cross-midnight ranges in 12-hour picker
Encapsulates the inclusive `[min, max]` membership check, with support for wraparound ranges where `max < min` (e.g. `min: 20, max: 5` covers 8 PM through 5 AM next day). Used by the hour picker for cross-midnight `hourLimit` ranges in the next commit. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
PR #84 introduced cross-midnight `hourLimit` support by treating values >= 24 as next-day hours (e.g. `max: 29` for 5 AM next day). That leaked the implementation detail into `onDurationChange` — picking "01 AM" returned `25` instead of `1`. Switch to a `max < min` wraparound convention: `{ min: 20, max: 5 }` selects 8 PM through 5 AM. Hours stay in their natural 0-23 range everywhere, including the value reported to consumers, and selectable hours visibly match the returned value. - `getAdjustedLimit` re-clamps `max` to `maxValue` and lets `max < min` through as meaningful (no longer treated as invalid input). - `PickerItem` drops the `+= 24` cross-midnight remap and uses `isWithinLimit` for the disabled-style check. - `DurationScroll` snaps out-of-range scrolls to the nearer of `min` / `max` (UX upgrade — previously always snapped to `min`). - New `PickerItem` rendering tests cover greying + selection across normal, wraparound, and non-12h pickers. - README documents the wraparound convention with example. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
…t example
- Bump Expo to 55, React Native to 0.83.6, React to 19.2.0.
- Add react-native-worklets, upgrade react-native-audio-api.
- Enable React Compiler experiment; drop manual useCallback/useMemo
wrappers in App.tsx.
- Drop deprecated app.json fields (newArchEnabled, edgeToEdgeEnabled)
now defaulted by the SDK.
- Remove unused babel.config.js.
- Add a test page exercising the new wraparound `hourLimit`
({ min: 20, max: 5 }) with a live readout of the reported hour value.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
hourLimitfix) by replacing the extended-range API (max: 29for 5 AM next day) with a wraparound convention ({ min: 20, max: 5 }). Hours stay in the natural 0-23 range, so picking "01 AM" now reports1toonDurationChangerather than25.isWithinLimitutility that encapsulates wraparound-aware membership checks; used by bothPickerItem(greying) andDurationScroll(snap-back).DurationScrollnow snaps out-of-range scrolls to the nearer ofmin/max(UX upgrade — previously always snapped tomin).Math.minclamp ongetAdjustedLimit'smaxand reinterpretsmax < minas a meaningful wraparound range rather than invalid input.PickerItemrendering tests covering greying + selection across normal, wraparound, and non-12h pickers.example-expoto Expo SDK 55 / RN 0.83.6 / React 19.2.0, enables the React Compiler experiment (drops manualuseCallback/useMemo), and adds a test page exercising the new wraparoundhourLimitwith a live readout of the reported hour value.