-
Notifications
You must be signed in to change notification settings - Fork 74
[LG-5532] feat(time-input): Segment state #3386
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: shaneeza/segment-logic-integration
Are you sure you want to change the base?
[LG-5532] feat(time-input): Segment state #3386
Conversation
…omponents with context integration
…tate handling in TimeInputInputs component
…segment rules and default values
… support 12/24 hour formats
…cale dependency and enhancing formatting logic
… format output with and without seconds
…meInputDisplayContext
…kMode and size, and add console log for debugging in TimeInputInputs
…omponent, covering rendering, value updates, and keyboard interactions
…omponent, covering rendering, value updates, and keyboard interactions
…12HourFormat prop, replacing TimeSegments with TimeSegment for improved clarity and consistency
…mponents with UTC conversion and logging for better time handling
…comparison logic in useSelectUnit hook
…logic for improved clarity
…alidation and date handling logic, including new utility functions for explicit segment checks
…n TimeInputInputs, removing unnecessary console logs and enhancing segment checks
…ime change checks for improved clarity and accuracy
… segment validation and date handling, enhancing utility functions for better clarity and performance
…d 24 hour formats, improving clarity on explicit value checks and segment validation
…across components, enhancing clarity and organization
…ate and segment updates, enhancing clarity in handling locale and timezone changes
…fygreen-ui into LG-5532/segments-display-values-state
…ting setSegment logic and cleaning up imports
…eparating date and segment change effects for improved clarity and functionality
…SegmentsAndSelectUnit for better clarity on date update logic
…es in useTimeSegmentsAndSelectUnit
… format handling in TimeInputInputs
… up imports in shouldSetValue
…ment handling and improving type safety
…TimeSegmentValidator for clarity and update its usage in isEverySegmentValueExplicit
…eExplicit tests for clarity and consistency
…ce getNewUTCDateFromSegments logic for better clarity
…and adjust related logic in TimeInputInputs and getFormattedDateTimeParts
…t handling and update getNewUTCDateFromSegments to utilize it
…ec for improved readability and consistency
…proving comments and consistency in date conversions
… by renaming timeZone variable for clarity
…rity across various utility tests
…and isSameUTCMonth.spec for better clarity and consistency
… across components
…imeSegmentAndSelectUnit.spec for improved clarity and consistency
… improve test descriptions for clarity
|
Coverage after merging LG-5532/segments-display-values-state into shaneeza/segment-logic-integration will be
Coverage Report for Changed Files
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||
| /** | ||
| * This useEffect is to check if the date has changed. | ||
| * If the date is different then we update the segments and call onUpdate. | ||
| */ | ||
| useEffect(() => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
all 3 of these effects have the same dependencies and have a lot of duplicatice code. Do we need 3 separate effects?
| selectUnit: findUnitOptionByDayPeriod( | ||
| dayPeriod as DayPeriod, | ||
| unitOptions, | ||
| ), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we're calling this twice. should abstract to a separate var
✍️ Proposed changes
🎟 Jira ticket: Name of ticket
This PR implements state management for time input segments and the AM/PM select unit. The changes introduce
useTimeSegmentsAndSelectUnit(open to improving this name) hook to manage time segment state, select unit state, and coordinate updates between them while handling timezone and locale changes.This PR is the fourth PR in a chain of PRs
🧪 How to test changes