Skip to content

Add weather checkboxes to live drive completion form - #17

Merged
ahernsean merged 4 commits into
mainfrom
claude/weather-checkboxes-drive-details-eki384
Aug 4, 2026
Merged

ahernsean merged 4 commits into
mainfrom
claude/weather-checkboxes-drive-details-eki384

Conversation

@ahernsean

Copy link
Copy Markdown
Owner

Summary

  • On the live-drive completion screen (shown after ending a drive), add checkboxes for the common weather values already used in the database: clear, cloudy, rainy, foggy.
  • Checking/unchecking a box adds/removes just that word from the comma-separated weather notes field, without disturbing any other text (checkbox-driven or manually typed) already in the field.
  • The field stays freely editable, so uncommon conditions (e.g. "windy") can still be typed in alongside the checkbox-driven values.

Test plan

  • ruff check .
  • ruff format --check .
  • mypy
  • pytest -m "not browser" --cov --cov-fail-under=95 (88 passed, 95.63% coverage)
  • pytest -m browser via the project's local-chromium fallback (WebKit unavailable in this environment) — confirms no horizontal overflow on a 320px mobile viewport
  • Manual Playwright walkthrough of the exact interaction: check clear+cloudy → "clear, cloudy"; uncheck clear → "cloudy"; re-check clear → "clear, cloudy"; type ", windy" → "clear, cloudy, windy"

Generated by Claude Code

claude added 2 commits August 3, 2026 19:21
Checking a common weather type (rainy, cloudy, sunny, snowy, windy,
icy) appends it to the weather notes field; unchecking removes it.
The field stays freely editable so uncommon conditions can still be
typed in alongside the checkbox-driven ones.
These match the values already common in the database, replacing
sunny/snowy/windy/icy which don't occur as often.
@ahernsean

Copy link
Copy Markdown
Owner Author

The weather notes text field should display within the "Weather" panel along with the boxes.

The boxes don't interact with typed text well. For instance, if I type "Foggy" then immediate check "rainy", the weather text turns into "rainy", losing what I typed. I think the biggest problem is if I type one of the words the checkboxes themselves insert, they get confused. I'm not sure if capitalization is considered. If I type one of the words from the checkboxes, the checkbox corresponding to that word ought to check itself, correctly indicating that the weather is in the note.

Move the weather notes input inside the Weather fieldset so it
renders in the same panel as the checkboxes. Sync checkboxes from
the typed text (case-insensitively) as well as text from checkboxes,
so typing a common word like "Foggy" checks its box and survives
later checkbox toggles instead of being silently dropped.

Copy link
Copy Markdown
Owner Author

Pushed a fix for both issues in 8669c7b:

  • The weather notes field now lives inside the Weather fieldset, so it renders in the same panel as the checkboxes.
  • Typing a word now checks the matching checkbox (case-insensitively), and checkboxes/text stay in sync both ways. So typing "Foggy" then checking "rainy" now gives "rainy, foggy" instead of dropping "foggy".

Verified with a Playwright walkthrough of exactly the scenario you described, plus a case-insensitivity check (typing "CLOUDY" checks the cloudy box), and reran the full CI suite (lint, mypy, pytest w/ coverage, browser test) — all passing.


Generated by Claude Code

Extract the weather checkbox/text markup into _weather_picker.html so
the live-drive completion form and the add/edit drive form (used when
editing a past drive) render the same picker instead of drifting apart.

Match checkbox labels by prefix instead of exact string, so typing
"rain" checks "rainy" (and unchecking removes the "rain" text) rather
than requiring the full word. Run an initial sync on load so editing a
drive with existing weather text pre-checks the right boxes.

Also drop the card-like background/border/radius from the drive
history "N drives · duration" totals summary, which made it look like
a drive-row card instead of a lightweight summary line.

Copy link
Copy Markdown
Owner Author

Pushed ea08883 addressing all three:

1. "rain" auto-checks "rainy", uncheck removes "rain"
Checkbox matching is now prefix-based instead of exact-match: a typed word checks a box if it's a prefix of that box's label ("rain" → "rainy", "cloud" → "cloudy", etc.), and the original typed word is what stays in the field — unchecking removes exactly that word rather than a canonical form. Directly clicking a checkbox (with no matching text already present) still inserts the canonical label, same as before.

2. Checkboxes missing on the past-drive edit screen
Good catch — the live-drive-finish screen (live.html) and the add/edit-drive screen (drive_form.html) are two separate templates that each render their own form, and only the first one had gotten the picker. I pulled the picker markup into a shared partial (_weather_picker.html) that both templates now include, so they can't drift apart again. Editing a past drive now pre-checks boxes based on its saved weather text.

3. "totals" summary looked like a drive card
Removed the shared card background/border/rounded-corner styling from .filtered-totals — it now reads as a plain summary line instead of looking like another drive row.

Verified all three with a Playwright walkthrough (typing "rain", editing a drive with saved "rain, cloudy" weather, and checking the computed style of the totals bar has no border/radius), plus reran the full CI suite (lint, mypy, pytest w/ coverage, browser test) — all passing.


Generated by Claude Code

@ahernsean
ahernsean merged commit f298e42 into main Aug 4, 2026
5 checks passed
@ahernsean
ahernsean deleted the claude/weather-checkboxes-drive-details-eki384 branch August 4, 2026 03:15
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.

2 participants