Skip to content

feat(water): "My water" in Settings, picked like a preset in recipes - #65

Merged
ndreno merged 1 commit into
mainfrom
feat/my-water-settings
Nov 3, 2026
Merged

ndreno merged 1 commit into
mainfrom
feat/my-water-settings

Conversation

@ndreno

@ndreno ndreno commented Nov 3, 2026

Copy link
Copy Markdown
Contributor

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

  • Settings → My water: six ions + the moneaudebrassage.fr loader (desktop only, as before). Same storage key (local.prefs.water), 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 for one-off tweaks (selector shows Custom). Save as default and the loaders are replaced by a hint with a link to Settings.
  • Follow My water: 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, components/water/MabLoader.tsx.

Tests

  • Unit: sourceSelection (home / recipe / unset / custom).
  • e2e: set My water in Settings → a recipe picks it up → preset and back → the link opens Settings. Full suite 32/32 locally, lint clean.

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.
@ndreno
ndreno merged commit f971e9d into main Nov 3, 2026
1 check passed
@ndreno
ndreno deleted the feat/my-water-settings branch November 3, 2026 17:44
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