feat: reusable filter handling #41

Merged
addison merged 9 commits from 004-004-reusable-filter-handling into main 2026-08-14 03:52:17 -04:00
Collaborator

Spec 4.4

Changes

  • Added useURLFilters hook to handle filters.
  • Added filter utils for job commisions and sales reports. and used reusable filter handling in job commisions and sales reports.

Testing

  • Make sure you have latest code running.
  • Navigate to job commissions and try applying different filters and see URL if both are synced and working fine.
  • Now with some filters open print screen. Same filters must be in URL and same results must be shown for print.
  • Repeat for sales reports.
# Spec 4.4 ## Changes - Added useURLFilters hook to handle filters. - Added filter utils for job commisions and sales reports. and used reusable filter handling in job commisions and sales reports. ## Testing - [x] Make sure you have latest code running. - [x] Navigate to job commissions and try applying different filters and see URL if both are synced and working fine. - [x] Now with some filters open print screen. Same filters must be in URL and same results must be shown for print. - [x] Repeat for sales reports.
Merge branch 'main' of https://git.kwila.cloud/kwila/office-extensions into 004-004-reusable-filter-handling
Some checks failed
CI / frontend (pull_request) Failing after 29s
CI / backend (pull_request) Has been skipped
Amp Review / review (pull_request) Successful in 3s
8876131382
talha requested review from addison 2026-08-11 13:46:55 -04:00
Owner

Please fix title

Please fix title
talha changed title from 004-004-reusable-filter-handling to feat: reusable filter handling 2026-08-12 09:17:40 -04:00
chore: merge main
All checks were successful
CI / frontend (pull_request) Successful in 33s
CI / backend (pull_request) Successful in 35s
Amp Review / review (pull_request) Successful in 1s
379c11af2b
Owner

Added a couple unit tests to cover edge cases in the code...

Added a couple unit tests to cover edge cases in the code...
Owner

Also I found a bug in test - the user can't type a date because the page uses the new (invalid) date too quickly to load data.

I'll try to add a unit test for this one.

Also I found a bug in test - the user can't type a date because the page uses the new (invalid) date too quickly to load data. I'll try to add a unit test for this one.
Amp-Thread-ID: https://ampcode.com/threads/T-019ff61f-c45c-721f-a12d-13a7454c1664
Co-authored-by: Addison Emig <[email protected]>
test(filters): inline hook test options
Some checks failed
CI / frontend (pull_request) Failing after 30s
CI / backend (pull_request) Has been skipped
09b8156d6a
Amp-Thread-ID: https://ampcode.com/threads/T-019ff61f-c45c-721f-a12d-13a7454c1664
Co-authored-by: Addison Emig <[email protected]>
test(filters): defer date refresh until blur
Some checks failed
CI / frontend (pull_request) Failing after 21s
CI / backend (pull_request) Has been skipped
4b7100ca4a
Amp-Thread-ID: https://ampcode.com/threads/T-019ff61f-c45c-721f-a12d-13a7454c1664
Co-authored-by: Addison Emig <[email protected]>
Merge branch 'main' into 004-004-reusable-filter-handling
Some checks failed
CI / frontend (pull_request) Failing after 27s
CI / backend (pull_request) Has been skipped
771645e7ef
addison requested changes 2026-08-13 04:12:47 -04:00
Dismissed
addison left a comment

See my above comments. I tried to add test cases for each edge case, but the test cases might need fixed too. The start date typing one is tricky.

See my above comments. I tried to add test cases for each edge case, but the test cases might need fixed too. The start date typing one is tricky.
feat(filters): enhance date handling to commit on change events
All checks were successful
CI / frontend (pull_request) Successful in 32s
CI / backend (pull_request) Successful in 36s
5b46c8ea9d
Author
Collaborator

@addison You might need to test again

@addison You might need to test again
talha requested review from addison 2026-08-13 13:26:58 -04:00
Owner

I still get early network request when I try to type "04 01 2026"

before I can fully type 2026, it does this:

image

I still get early network request when I try to type "04 01 2026" before I can fully type 2026, it does this: ![image](/attachments/d23fb575-5260-42f3-9693-ec0cc5e6c273)
Owner

Also, just typing a 0 in the start date input makes it do a network request 🤔

Also, just typing a `0` in the start date input makes it do a network request 🤔
Author
Collaborator

@addison wrote in #41 (comment):

I still get early network request when I try to type "04 01 2026"

before I can fully type 2026, it does this:

image

Let me check what's issue
it might be bad idea to send request on date change

@addison wrote in https://git.kwila.cloud/kwila/office-extensions/pulls/41#issuecomment-3904: > I still get early network request when I try to type "04 01 2026" > > before I can fully type 2026, it does this: > > [![image](/attachments/d23fb575-5260-42f3-9693-ec0cc5e6c273)](/kwila/office-extensions/attachments/d23fb575-5260-42f3-9693-ec0cc5e6c273) Let me check what's issue it might be bad idea to send request on date change
addison requested changes 2026-08-13 13:54:19 -04:00
Dismissed
addison left a comment

Please add more test coverage and fix the bugs with requests being sent too early.

Please add more test coverage and fix the bugs with requests being sent too early.
Owner

it might be bad idea to send request on date change

I want to send request only when "full" date is entered 😅

Maybe we should just have an extra "apply date range" button that is only shown when dates are changed? but then how to make that look good 🤔

> it might be bad idea to send request on date change I want to send request only when "full" date is entered 😅 Maybe we should just have an extra "apply date range" button that is only shown when dates are changed? but then how to make that look good 🤔
Author
Collaborator

@addison wrote in #41 (comment):

it might be bad idea to send request on date change

I want to send request only when "full" date is entered 😅

Maybe we should just have an extra "apply date range" button that is only shown when dates are changed? but then how to make that look good 🤔

Let me see, what are the possibilities

@addison wrote in https://git.kwila.cloud/kwila/office-extensions/pulls/41#issuecomment-3908: > > it might be bad idea to send request on date change > > I want to send request only when "full" date is entered :sweat_smile: > > Maybe we should just have an extra "apply date range" button that is only shown when dates are changed? but then how to make that look good :thinking: Let me see, what are the possibilities
feat(filters): implement reusable date input handling with debounce
All checks were successful
CI / frontend (pull_request) Successful in 33s
CI / backend (pull_request) Successful in 35s
2298f1a335
Author
Collaborator

@addison I have added debounce + validation from 1970 to now plus 10 years, tell me please if it makes sense

@addison I have added debounce + validation from 1970 to now plus 10 years, tell me please if it makes sense
Owner

Wow, it works great!

Wow, it works great!
addison approved these changes 2026-08-14 03:52:10 -04:00
addison deleted branch 004-004-reusable-filter-handling 2026-08-14 03:52:17 -04:00
addison referenced this pull request from a commit 2026-08-14 03:52:18 -04:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
3 participants
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
kwila/office-extensions!41
No description provided.