diff --git a/app/assets/stylesheets/events.css b/app/assets/stylesheets/events.css index 6a52349fe..1d7f2264c 100644 --- a/app/assets/stylesheets/events.css +++ b/app/assets/stylesheets/events.css @@ -122,10 +122,6 @@ text-align: center; } - .events__popup { - margin-block-start: var(--block-space-half); - } - /* Event /* ------------------------------------------------------------------------ */ diff --git a/app/assets/stylesheets/filters.css b/app/assets/stylesheets/filters.css index 7701e72c9..45be28002 100644 --- a/app/assets/stylesheets/filters.css +++ b/app/assets/stylesheets/filters.css @@ -1,8 +1,11 @@ @layer components { .filters { + view-transition-name: "filters"; + z-index: var(--z-popup); + #header:has(&) { position: relative; - z-index: 1; + z-index: var(--z-popup); } .btn { @@ -94,19 +97,8 @@ } } - .panel:is(.filter__popup) { - --panel-size: 100ch; - --panel-padding: var(--block-space); - - inline-size: auto !important; - min-inline-size: var(--panel-size); - max-block-size: calc(90dvh - (2 * var(--block-space-double))); - max-inline-size: calc(100dvw - (2 * var(--block-space-double))); - z-index: 1; - } - .quick-filter { - &:has(input:not(.default-value):checked) { + &:not(.default-value):has(.checked) { .input--select { --input-background: var(--color-selected); } diff --git a/app/assets/stylesheets/popup.css b/app/assets/stylesheets/popup.css index 0d1c27807..addd87f2d 100644 --- a/app/assets/stylesheets/popup.css +++ b/app/assets/stylesheets/popup.css @@ -94,7 +94,7 @@ } &:has(input:checked) { - --btn-background: var(--color-ink-lightest); + --btn-background: transparent; --btn-color: var(--color-ink); .icon { diff --git a/app/controllers/concerns/filter_scoped.rb b/app/controllers/concerns/filter_scoped.rb index 074dd967b..3d5f1fc91 100644 --- a/app/controllers/concerns/filter_scoped.rb +++ b/app/controllers/concerns/filter_scoped.rb @@ -9,6 +9,11 @@ module FilterScoped DEFAULT_PARAMS = { indexed_by: "latest" } def set_filter - @filter = Current.user.filters.from_params params.reverse_merge(**DEFAULT_PARAMS).permit(*Filter::PERMITTED_PARAMS) + @expand_all = params[:expand_all] + if params[:filter_id].present? + @filter = Current.user.filters.find(params[:filter_id]) + else + @filter = Current.user.filters.from_params params.reverse_merge(**DEFAULT_PARAMS).permit(*Filter::PERMITTED_PARAMS) + end end end diff --git a/app/controllers/filters_controller.rb b/app/controllers/filters_controller.rb index ba34c1622..cbb44963b 100644 --- a/app/controllers/filters_controller.rb +++ b/app/controllers/filters_controller.rb @@ -3,16 +3,17 @@ class FiltersController < ApplicationController def create @filter = Current.user.filters.remember filter_params - redirect_to cards_path(@filter.as_params) + redirect_to cards_path(filter_id: @filter.id) end def destroy + filter_params = @filter.as_params @filter.destroy! if request.referer == root_url redirect_to root_path else - redirect_to cards_path(@filter.as_params) + redirect_to cards_path(filter_params) end end diff --git a/app/helpers/filters_helper.rb b/app/helpers/filters_helper.rb index 7b5f5e51f..5d512218d 100644 --- a/app/helpers/filters_helper.rb +++ b/app/helpers/filters_helper.rb @@ -21,6 +21,14 @@ module FiltersHelper hidden_field_tag name, value, id: nil end + def filter_selected_collections_sentence(filter) + if filter.collections.any? + filter.collections.collect { "#{it.name}" }.uniq.sort.to_sentence + else + tag.strong "All collections" + end + end + def filter_selected_collections_label(filter) selected_collections = if filter.collections.any? filter.collections.collect { "#{it.name}" }.uniq.sort.to_sentence diff --git a/app/models/filter/summarized.rb b/app/models/filter/summarized.rb index c08607f32..e56a2dd10 100644 --- a/app/models/filter/summarized.rb +++ b/app/models/filter/summarized.rb @@ -1,16 +1,18 @@ module Filter::Summarized def summary - [ index_summary, tag_summary, assignee_summary, creator_summary, stage_summary, terms_summary ].compact.to_sentence + " #{collection_summary}" + [ index_summary, tag_summary, assignee_summary, creator_summary, stage_summary, terms_summary ].compact.to_sentence end private def index_summary - indexed_by.humanize + unless indexed_by.latest? + indexed_by.humanize + end end def tag_summary if tags.any? - "tagged #{tags.map(&:hashtag).to_choice_sentence}" + "#{tags.map(&:hashtag).to_choice_sentence}" end end @@ -28,12 +30,6 @@ module Filter::Summarized end end - def collection_summary - if collections.any? - "in #{collections.pluck(:name).to_choice_sentence}" - end - end - def terms_summary if terms.any? "matching #{terms.map { |term| %Q("#{term}") }.to_sentence}" diff --git a/app/views/cards/index/_closure_filter.html.erb b/app/views/cards/index/_closure_filter.html.erb index 258e20d4a..da5b5bf22 100644 --- a/app/views/cards/index/_closure_filter.html.erb +++ b/app/views/cards/index/_closure_filter.html.erb @@ -3,7 +3,7 @@ Recently closed - Closed with reason… diff --git a/app/views/cards/index/_workflow_filter.html.erb b/app/views/cards/index/_workflow_filter.html.erb index 49f2cc31b..d453917d5 100644 --- a/app/views/cards/index/_workflow_filter.html.erb +++ b/app/views/cards/index/_workflow_filter.html.erb @@ -7,7 +7,7 @@ <% end %> - In stage(s)… diff --git a/app/views/events/_filter.html.erb b/app/views/events/_filter.html.erb index 6a916d170..71fdecb0c 100644 --- a/app/views/events/_filter.html.erb +++ b/app/views/events/_filter.html.erb @@ -20,7 +20,7 @@ Fizzy <% end %> - <%= tag.dialog class: "fizzy-dialog filter events__popup popup popup--animated panel flex-column align-start fill-white", + <%= tag.dialog class: "fizzy-dialog filter margin-block-start-half popup popup--animated panel flex-column align-start fill-white", data: { action: "turbo:before-cache@document->dialog#close keydown->navigable-list#navigate filter:changed->navigable-list#reset toggle->filter#filter", controller: "filter navigable-list", @@ -32,12 +32,12 @@ <%= render "events/filter/header" %> - Collections <%= form_with url: events_path, method: :get, class: "popup__list", data: { controller: "form" } do |form| %> <% if Current.user.collections.many? %> diff --git a/app/views/events/filter/_custom_collections.html.erb b/app/views/events/filter/_custom_collections.html.erb index 26dad7da2..0ee1af1df 100644 --- a/app/views/events/filter/_custom_collections.html.erb +++ b/app/views/events/filter/_custom_collections.html.erb @@ -1,11 +1,22 @@ -