feat: two_months works in single mode - #697
Merged
Merged
Conversation
The attr doc said range-only and the playground dial enforced it with a mode check, but the component itself never gated the second pane on mode - and a single-date picker earns two months the same way flight searches do. The doc now says so, the dial passes the flag through in both modes, and a test pins both panes rendering with data-mode single (second pane still defers its nav to the first).
Greptile SummaryThe PR enables the playground’s two-month date-picker layout in single mode and updates the public attribute documentation accordingly.
Confidence Score: 5/5The PR appears safe to merge with no actionable defects identified. The playground state always supplies a valid boolean, and the existing date-picker interaction path handles dates from either pane without depending on range mode.
|
| Filename | Overview |
|---|---|
| dev.exs | Passes the boolean two_months playground setting through in both picker modes. |
| lib/petal_components/date_picker.ex | Updates the public attribute documentation to describe supported single-mode behavior. |
| test/petal/date_picker_test.exs | Adds focused rendering assertions for the two-pane single-date configuration. |
Reviews (1): Last reviewed commit: "feat: two_months works in single mode" | Re-trigger Greptile
nhobes
added a commit
that referenced
this pull request
Aug 25, 2026
nhobes
added a commit
that referenced
this pull request
Aug 25, 2026
* fix: button icon size contract + context menu touch selection Button spinner/icon sizing moves to the doubled-selector + !important icon contract. The parent-scoped rules sat in the components layer, so consumers whose heroicons plugin emits into the utilities layer (the standard Phoenix setup, including petal.build) saw the mask's own w-6 width beat them regardless of specificity - md button icons rendered 24px wide instead of 20px. Context menu triggers suppress user-select under (pointer: coarse) so an iOS long press reads as the menu gesture instead of also starting text selection. Desktop selection inside the region is untouched. * fix: guard touch selection suppression with hover:none Greptile's catch: bare pointer:coarse also matches touch-primary hybrids currently driving a mouse. hover:none + pointer:coarse is the same true-touch guard the data table's mobile font sizing already uses. * chore: stage 4.15.3 4.15.2 published without this branch's two CSS fixes, so they move to their own 4.15.3 section and the version bumps to match. The avatar showcase refresh that did make 4.15.2 gets its changelog line. * fix: dropdown panel attributes render in a stable order The panel's dynamic attributes came from a map, and Erlang's small-map iteration order is a compile-time property of the literal pool - a clean rebuild reorders them on its own, exactly as the old comment warned. CI's fresh build rendered phx-hook before style and the pinned legacy-default test went red on an untouched tree (the failure predates this branch: main went red at cc86b35, a version-bump-only commit). Keyword lists render in the order written, so the panel's HTML is now byte-stable across builds and the pin holds by construction. * docs: changelog bullet for two_months in single mode (#697)
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.
Nic's find: selecting "two months" on the playground dials in single mode did nothing. The choice was honor-it or disable-the-dial, and honoring it wins: a single-date picker earns the second pane the same way flight one-way searches do, the component never actually gated the pane on mode (only the attr doc and the playground dial claimed it was range-only), and a greyed-out toggle just invites the question.
dev.exs'smode == "range" &&coupling removed).data-mode="single", second pane defers nav to the first.Verified live on the playground: single + two months renders August/September side by side, and clicking a date in the second pane commits it to the input ("10 Sep 2026") and closes the panel. 1814 tests, 0 failures.