Repository navigation
feat(water): "My water" in Settings, picked like a preset in recipes - #65
Merged
Merged
Conversation
The brewer's own water lived inside each recipe's water chemistry, behind a
"Save as default" button next to the moneaudebrassage.fr loader: hard to
find, and editing it meant opening a recipe. On the web build the saved
default never reached new recipes: settings load asynchronously, and the
recipe form had already captured an all-zero water as its initial state.
- Settings: new "My water" section (six ions + moneaudebrassage.fr loader,
desktop only as before). Same storage key, so an existing default carries
over.
- Recipe water chemistry: the source selector lists "My water" first
("not set yet" and disabled until configured), "This recipe's water" when
the BeerJSON carries one, then the city presets. Ions stay editable.
"Save as default" and the loaders are replaced by a hint with a link to
Settings.
- A recipe whose water was never touched stores `source: null` and follows
My water, including later changes; picking "My water" goes back to that.
- Shared pieces moved out of WaterChemistrySection: data/home-water.ts,
components/water/IonFields.tsx and MabLoader.tsx.
Tests: sourceSelection unit tests; e2e sets My water in Settings, checks a
recipe picks it up, switches to a preset and back, and follows the link.
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.
Why
The brewer's own water lived inside each recipe's water chemistry, behind a "Save as default" button: hard to find, and editing it meant opening a recipe. On the web build the saved default never reached new recipes (settings load asynchronously; the recipe form had already captured an all-zero water).
What
local.prefs.water), so an existing default carries over.source: nulland follows My water, including later changes; picking My water goes back to that.WaterChemistrySection:data/home-water.ts,components/water/IonFields.tsx,components/water/MabLoader.tsx.Tests
sourceSelection(home / recipe / unset / custom).