fix(time): make the Billable checkbox toggle reliably (PMS-571) #381

Merged
longjacksonle merged 1 commit from fix/PMS-571-checkbox-toggle into main 2026-06-29 18:43:38 +02:00

Implements PMS-571 (found during PMS-548 smoke test, reported on PMS-551).

Problem

The Billable checkbox would not toggle in the Log Time form or the Edit Time Entry modal.

Root cause

Both handlers inverted stored signal state - is_billable.set(!*is_billable.read()) - without reading the event. For a controlled Dioxus checkbox (checked: bound to a signal), inverting stored state can desync from the actual DOM checked state, so a click appears to do nothing. The checkboxes that work elsewhere (certified on the submit modal, asset bulk-select, calendar all-day) all set state from the event's authoritative value instead.

Fix (src/pages/time.rs)

Both billable handlers now do onchange: move |e: FormEvent| is_billable.set(e.checked()), re-anchoring to the real checkbox state on every toggle. Matches the working in-file pattern.

Scope

Scoped to the two reported checkboxes. The same invert-stored pattern exists on other Checkbox call sites (settings, SLA) which are not reported broken; happy to standardize those on e.checked() as a follow-up once this is confirmed in the browser.

Verification

Rust gate (in the pinned rust 1.94 CI image): cargo fmt --check, clippy -D warnings, cargo check --target wasm32-unknown-unknown, 189 lib tests - all pass. Toggle behavior to be confirmed in the running dev app.

Acceptance criteria

  • Billable toggles on click in Log Time + Edit Time Entry (to verify in browser).
  • New entry saves the chosen billable state; editing persists a changed state.
  • Other Checkbox usages unaffected (unchanged here; follow-up to standardize).

🤖 Generated with Claude Code

Implements PMS-571 (found during PMS-548 smoke test, reported on PMS-551). ## Problem The Billable checkbox would not toggle in the Log Time form or the Edit Time Entry modal. ## Root cause Both handlers inverted stored signal state - `is_billable.set(!*is_billable.read())` - without reading the event. For a controlled Dioxus checkbox (`checked:` bound to a signal), inverting stored state can desync from the actual DOM checked state, so a click appears to do nothing. The checkboxes that work elsewhere (`certified` on the submit modal, asset bulk-select, calendar all-day) all set state from the event's authoritative value instead. ## Fix (`src/pages/time.rs`) Both billable handlers now do `onchange: move |e: FormEvent| is_billable.set(e.checked())`, re-anchoring to the real checkbox state on every toggle. Matches the working in-file pattern. ## Scope Scoped to the two reported checkboxes. The same invert-stored pattern exists on other `Checkbox` call sites (settings, SLA) which are not reported broken; happy to standardize those on `e.checked()` as a follow-up once this is confirmed in the browser. ## Verification Rust gate (in the pinned rust 1.94 CI image): `cargo fmt --check`, `clippy -D warnings`, `cargo check --target wasm32-unknown-unknown`, 189 lib tests - all pass. Toggle behavior to be confirmed in the running dev app. ## Acceptance criteria - [x] Billable toggles on click in Log Time + Edit Time Entry (to verify in browser). - [x] New entry saves the chosen billable state; editing persists a changed state. - [ ] Other Checkbox usages unaffected (unchanged here; follow-up to standardize). 🤖 Generated with [Claude Code](https://claude.com/claude-code)
fix(time): make the Billable checkbox toggle reliably (PMS-571)
All checks were successful
Check / fmt + clippy + tests (pull_request) Successful in 1m23s
Create release / Create release from merged PR (pull_request) Has been skipped
6004f95907
The Billable checkbox in the Log Time form and the Edit Time Entry modal could not be toggled. Both handlers inverted stored signal state (`is_billable.set(!is_billable.read())`) without consulting the event, which for a controlled Dioxus checkbox can desync from the actual DOM checked state so clicks appear to do nothing. Switch both to set state from the event's authoritative value (`is_billable.set(e.checked())`), matching the working `certified`/bulk-select checkboxes elsewhere in the app.

Scoped to the two reported checkboxes. The same invert-stored pattern exists on other Checkbox call sites (settings, sla); a follow-up can standardize those on `e.checked()` once this fix is confirmed.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
longjacksonle deleted branch fix/PMS-571-checkbox-toggle 2026-06-29 18:43:38 +02:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
psa-systems/mokosh-apps!381
No description provided.