casa icon indicating copy to clipboard operation
casa copied to clipboard

5847 surface common filters with helper

Open mononoken opened this issue 7 months ago β€’ 0 comments

Note: This is an alternative approach to #5871 Instead of persisting client state with sessionStorage, I scrapped the idea of using client state for the collapse logic. Instead, I am using the original method of having the menu shown or hidden based on the existence of the filter params. However, I have removed the "surfaced" params from this check, so that when you filter only by an option such as "Hide draft", it will not open the filter options menu.


What github issue is this PR for, if any?

Resolves #5847

What changed, and why?

  • Moved the Sorted by and Hide drafts filter options outside of the collapsable area of the form element, so that they display regardless of filter menu collapse status.
  • Fixed the positioning of the form select pseudo icons by refactoring the HTML syntax around the select elements
  • Changed the filter-card-body collapse class logic to, fix a bug where the "Expand / show" button did not respond to the first click after filtering. This change accounts for how Bootstrap implements its version of collapse.
  • Added helper expand_filters? to prevent filter menu from expanding when filtering only by "surfaced" filter options.

How is this tested? (please write tests!) πŸ’–πŸ’ͺ

I added tests for the new expanded_filters? helper method.

Screenshots please :)

SCR-20240629-swmf SCR-20240629-swrz

Feelings gif (optional)

Instead of a gif, I asked ChatGPT to write a haiku about Bootstrap. γƒ–γƒΌγƒˆγ‚Ήγƒˆγƒ©γƒƒγƒ— εˆΆη΄„γ‚’ζ„Ÿγ˜γ¦ θ‡ͺ由を求め

mononoken avatar Jul 04 '24 04:07 mononoken