Skip to content

Tap the active day preset again to clear the selection - #12

Merged
citoki merged 1 commit into
mainfrom
feat/preset-toggle
Nov 23, 2026
Merged

citoki merged 1 commit into
mainfrom
feat/preset-toggle

Conversation

@citoki

@citoki citoki commented Nov 23, 2026

Copy link
Copy Markdown
Owner

What

Tapping All, Mo–Fr or Sa–Su while it is already the active preset now clears the day selection. Before, it did nothing. This makes it easy to go from a preset to a single day: tap the preset again, then tap the day.

Tapping an inactive preset still selects its days, including when switching from another preset.

Changes

  • model/week.ts: togglePreset(selected, preset), with unit tests
  • Card: the preset buttons use togglePreset
  • docs/usage.md: one sentence in the day-selection section

With no days selected, the card shows the existing "no day selected" state, the same as when the last day chip is tapped off.

Testing

  • tsc --noEmit passes and vitest passes (357 tests)
  • Checked in the dev page (Sa–Su → Sa–Su clears, then a single day can be picked; same for All) and live in Home Assistant

Tapping All, Mo-Fr or Sa-Su while it is the active preset now deselects its
days instead of doing nothing, so a single day can be picked next. Tapping an
inactive preset selects its days as before.

Adds togglePreset() to the week model with tests and a note in the usage docs.
@citoki
citoki merged commit 9705cd3 into main Nov 23, 2026
3 checks passed
@citoki
citoki deleted the feat/preset-toggle branch November 23, 2026 20:37
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