fix(ssr): require Apply for all date-range filters #13

Merged
notid merged 1 commits from integreat-fix-other-dates into staging 2026-06-02 22:42:50 -07:00
Owner

Summary

Date-range filters on most grid pages auto-submitted on every change event, which fired mid-typing and re-rendered the date inputs out from under you — breaking manual date entry. Invoices and ledgers already gated date submission behind an explicit Apply button. This brings the other ten pages in line so every date filter uses Apply.

Changes

  • date-range component (shared by every caller):
    • Added @change.stop to the date-inputs' container <div> so a typed or picked date's change event is stopped before it bubbles to the form (existing codebase idiom — typeahead- already uses "@change.stop" ""). The All/Week/Month/Year presets live in a sibling div and keep auto-applying.
    • The Apply button now renders unconditionally, so every filter page gets it. Dates submit only via the button's datesApplied event.
  • Ten filter forms — added datesApplied to the hx-trigger: payments, invoice import, transactions, import batches, sales summaries, expected deposits, cash drawer shifts, refunds, tenders, sales orders.

All other controls (typeaheads, radio-cards, selects, money/text inputs) keep their existing auto-apply behavior — only date submission moves behind Apply.

Verification

  • lein cljfmt check — all files formatted correctly
  • clj-kondo — 0 errors (only pre-existing unused-require warnings)
  • REPL render check: with no apply-button? key the component renders exactly one Apply button plus the @change.stop guard and datesApplied dispatch

🤖 Generated with Claude Code

## Summary Date-range filters on most grid pages auto-submitted on every `change` event, which fired mid-typing and re-rendered the date inputs out from under you — breaking manual date entry. Invoices and ledgers already gated date submission behind an explicit **Apply** button. This brings the other ten pages in line so every date filter uses Apply. ## Changes - **`date-range` component** (shared by every caller): - Added `@change.stop` to the date-inputs' container `<div>` so a typed or picked date's `change` event is stopped before it bubbles to the form (existing codebase idiom — `typeahead-` already uses `"@change.stop" ""`). The All/Week/Month/Year presets live in a sibling div and keep auto-applying. - The **Apply** button now renders unconditionally, so every filter page gets it. Dates submit only via the button's `datesApplied` event. - **Ten filter forms** — added `datesApplied` to the `hx-trigger`: payments, invoice import, transactions, import batches, sales summaries, expected deposits, cash drawer shifts, refunds, tenders, sales orders. All other controls (typeaheads, radio-cards, selects, money/text inputs) keep their existing auto-apply behavior — only date submission moves behind Apply. ## Verification - `lein cljfmt check` — all files formatted correctly - `clj-kondo` — 0 errors (only pre-existing unused-require warnings) - REPL render check: with no `apply-button?` key the component renders exactly one Apply button plus the `@change.stop` guard and `datesApplied` dispatch 🤖 Generated with [Claude Code](https://claude.com/claude-code)
notid added 1 commit 2026-06-02 22:42:23 -07:00
Most grid pages auto-submitted their date-range filter on every change
event, which fired mid-typing and re-rendered the date inputs, breaking
manual date entry. Invoices and ledgers already gated date submission
behind an explicit Apply button; this brings the other ten pages in line.

- date-range component: stop `change` from the date inputs bubbling to
  the form (@change.stop) and always render the Apply button, so typed or
  picked dates submit only via the Apply button's `datesApplied` event.
  The All/Week/Month/Year presets and all other filters are unaffected.
- payments, invoice import, transactions, import batches, sales
  summaries, expected deposits, cash drawer shifts, refunds, tenders,
  sales orders: add `datesApplied` to the form hx-trigger.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
notid force-pushed integreat-fix-other-dates from a4fde446fc to 3759258ebe 2026-06-02 22:42:23 -07:00 Compare
notid merged commit 8215e6376d into staging 2026-06-02 22:42:50 -07:00
Sign in to join this conversation.
No Reviewers
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: notid/integreat#13