5
11
Fork
You've already forked tomato
1

Persist the shift occurrence filter between weeks #127

Merged
edwardloveall merged 1 commit from el-occ-filter-persist into main 2026年03月24日 15:31:13 +01:00

Users reported that it's annoying to keep applying the shift occurrence filter
if they switch between weeks. You have to apply the filter, look a the data, go
to the next week, re-apply the same filter, repeat. Especially if they're
flipping back and forth between weeks.

I'm using ActiveModel::Attributes here to ensure we have a attributes method
we can call. It returns a hash that we can plug right into the next/prev week
url params.

Users reported that it's annoying to keep applying the shift occurrence filter if they switch between weeks. You have to apply the filter, look a the data, go to the next week, re-apply the same filter, repeat. Especially if they're flipping back and forth between weeks. I'm using ActiveModel::Attributes here to ensure we have a `attributes` method we can call. It returns a hash that we can plug right into the next/prev week url params.
jsilasbailey left a comment
Copy link

👍

👍
@ -16,0 +16,4 @@
@organization,
{
starts_at: (@starts_at - 7.days).iso8601,
shift_occurrence_filter: (@filter.attributes if @filter.filtering?)
First-time contributor
Copy link

nit: if @filter has a method on it that works as a proxy for this then the view doesn't have to care about knowing it need to check filtering?. What do you think about @filter.params?

nit: if `@filter` has a method on it that works as a proxy for this then the view doesn't have to care about knowing it need to check `filtering?`. What do you think about `@filter.params`?
Author
Owner
Copy link

Oh, I did not know it would remove the key if the value was blank like that. Yeah, that's much better.

Oh, I did not know it would remove the key if the value was blank like that. Yeah, that's much better.
@ -107,1 +118,3 @@
include_blank: " ".html_safe,
# this empty string is here because `true` creates a poorly sized
# <option> in Firefox browsers.
include_blank: "",
First-time contributor
Copy link

Interesting, did the rendering change to where the empty string works now?

Interesting, did the rendering change to where the empty string works now?
Author
Owner
Copy link

I don't think it changes, I think I just found a better solution. Probably picked up the nbsp from a stack overflow post and moved on, but I've been using the herb linter and it was complaining about html_safe which motivated me to try a bit more.

I don't think it changes, I think I just found a better solution. Probably picked up the `nbsp` from a stack overflow post and moved on, but I've been using the herb linter and it was complaining about [html_safe](https://herb-tools.dev/linter/rules/erb-no-unsafe-raw) which motivated me to try a bit more.
edwardloveall force-pushed el-occ-filter-persist from f36ac0799e
All checks were successful
ci/woodpecker/pr/ci Pipeline was successful
to 99ef9e5283
Some checks failed
ci/woodpecker/pr/ci Pipeline failed
2026年03月24日 14:53:19 +01:00
Compare
edwardloveall changed target branch from el-fix-task-log-crash to main 2026年03月24日 15:30:15 +01:00
Author
Owner
Copy link

Same flaky test

Same flaky test
edwardloveall deleted branch el-occ-filter-persist 2026年03月24日 15:31:14 +01:00
Sign in to join this conversation.
No reviewers
Milestone
Clear milestone
No items
No milestone
Projects
Clear projects
No items
No project
Assignees
Clear assignees
No assignees
2 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
rootable/tomato!127
Reference in a new issue
rootable/tomato
No description provided.
Delete branch "el-occ-filter-persist"

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?