Add a 1×–4× batch control to the drink dialog#13
Open
Glitched wants to merge 2 commits into
Open
Conversation
A "1×" chip leads the dialog's chip row; tapping it expands an inline 1×-4× segmented pill, and picking a factor collapses it and scales every ingredient amount via a new scaleAmount() util (mixed fractions to the nearest eighth, ranges like "6-8 leaves" scale both ends, dash/barspoon pluralize, "to taste" passes through). The chip renders inverted when scaled so an active batch is obvious, and the factor resets each time a dialog opens so it never leaks across drinks. https://claude.ai/code/session_01GQs3cjdNbTtp8RZfMsw4SS
✅ Deploy Preview for thenightlatch ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
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.
Phone-friendly batching in the drink dialog, per the design discussed in chat.
Interaction
A 1× chip leads the dialog's existing chip row (before the ABV/NA chip). Tapping it expands an inline 1×–4× segmented pill in place — no popover, and the chip row already scrolls horizontally so it works on small screens. Picking a factor collapses the pill and scales every ingredient amount; the chip renders inverted (filled) when a batch is active so a 2× spec can't be mistaken for the standard one. Uses the multiplication sign
×, not the letter "x".State is per-opening: the factor resets to 1× every time a drink dialog opens, so it never leaks across drinks or repeat openings.
Scaling
New
scaleAmount()util (reuses the fraction parser fromdrinkStrength.ts):3/4 oz × 3 → 2 1/4 oz,1 1/2 oz × 2 → 3 oz6-8 leaves × 2 → 12-16 leaves1 dash × 3 → 3 dashesto tasteand unmeasured ingredients pass through unchangedThe ABV chip is unaffected (strength is proportional), and DUs stay per-serving.
Verified with
yarn buildplus a standalone test of the scaling math across every amount format used in the menu.https://claude.ai/code/session_01GQs3cjdNbTtp8RZfMsw4SS
Generated by Claude Code