Skip to content

feat: two_months works in single mode - #697

Merged
nhobes merged 1 commit into
mainfrom
feat/single-mode-two-months
Aug 25, 2026
Merged

feat: two_months works in single mode#697
nhobes merged 1 commit into
mainfrom
feat/single-mode-two-months

Conversation

@nhobes

@nhobes nhobes commented Aug 25, 2026

Copy link
Copy Markdown
Contributor

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.

  • Attr doc rewritten - no longer claims range-only.
  • Playground dial passes the flag through in both modes (dev.exs's mode == "range" && coupling removed).
  • New test pins single-mode + two_months: both panes render with 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.

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-apps

greptile-apps Bot commented Aug 25, 2026

Copy link
Copy Markdown

Greptile Summary

The PR enables the playground’s two-month date-picker layout in single mode and updates the public attribute documentation accordingly.

  • Removes the playground-only range-mode gate from two_months.
  • Documents that the two-pane layout supports both range and single modes.
  • Adds rendering coverage for two single-mode calendar panes, their mode attributes, and second-pane navigation behavior.

Confidence Score: 5/5

The 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.

Important Files Changed

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
nhobes merged commit 1bdb182 into main Aug 25, 2026
3 checks passed
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)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant