refactor(weekly-time-slots): switch placement, overlays, dynamic time format#3307
Open
MdAsifHossainNadim wants to merge 3 commits into
Open
Conversation
Introduce a reusable weekly time-slot schedule editor exported from the
Dokan components library so both Lite (store open-close) and Pro
(delivery-time) can share one implementation.
- WeeklyTimeSlots supports single (one range/day) and multiple (N ranges
with add/remove) modes with pluggable validation and messages.
- TimeDropdown renders a preset list ("Full Day" + step increments) and
stores canonical `g:i a` values; display localizes via dateI18n so it
honours WP 12/24-hour format and translated meridiem.
- Extract DokanSwitch into its own Switch.tsx so the barrel can export
WeeklyTimeSlots without a circular import.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
… format - Place the day toggle beside the time pickers, aligned in a fixed column. - Keep disabled days' pickers visible under an opacity overlay instead of hiding them; disabling a day that is in error resets it to valid default times (no stale error, no empty placeholders). - Show the Full Day static closing field overlayed (dimmed, white background) and read-only; only the opening stays editable. - Nest the validation message directly under the day name (desktop + mobile). - Render times with the exact WP time format (Settings -> General), so presets and custom formats all display faithfully. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Contributor
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Base automatically changed from
feat/weekly-time-slots-component
to
refactor/simplify-settings-to-flat-array
July 7, 2026 11:04
…e-slots-ui-refinements
Resolve add/add conflicts in src/components/WeeklyTimeSlots/{TimeDropdown,index,utils}
by keeping the refinements branch's versions. The base absorbed the #3305 component
(pre-refinement); ours is that same component plus the switch-placement, read-only
overlay, and dynamic time-format refinements — a strict superset, so nothing from
base is lost.
Co-Authored-By: Claude Opus 4.8 (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
Refines the shared
WeeklyTimeSlotscomponent (introduced in #3305) based on a design review of the admin Delivery Days schedule. UI/UX polish and time-format correctness — no public API changes.Changes
Opens at / Closed atplaceholders.text-sm, red.g:i a,g:i A,H:i) and custom formats all display faithfully and localize the meridiem (verified in Bengali).Files
src/components/WeeklyTimeSlots/index.tsxsrc/components/WeeklyTimeSlots/TimeDropdown.tsx— newreadOnlypropsrc/components/WeeklyTimeSlots/utils.tsTesting
Related
feat/weekly-time-slots-component). Consumed at runtime by the Pro delivery-time module viawindow.dokan.components.🤖 Generated with Claude Code