fix(time): make the Billable checkbox toggle reliably (PMS-571) #381
Loading…
Reference in a new issue
No description provided.
Delete branch "fix/PMS-571-checkbox-toggle"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
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 (certifiedon 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
Checkboxcall sites (settings, SLA) which are not reported broken; happy to standardize those one.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
🤖 Generated with Claude Code