From f80ef52f81685e777eb9eca81d429d4c84ac593b Mon Sep 17 00:00:00 2001 From: Jason Zimdars Date: Thu, 28 Aug 2025 20:54:23 -0500 Subject: [PATCH 1/5] Workflow stage filter should only apply to cards in doing No other column has Workflows so they should be unaffected by the filter --- app/models/filter.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/models/filter.rb b/app/models/filter.rb index 7b132b51a..d8611a024 100644 --- a/app/models/filter.rb +++ b/app/models/filter.rb @@ -28,7 +28,7 @@ class Filter < ApplicationRecord result = result.assigned_to(assignees.ids) if assignees.present? result = result.where(creator_id: creators.ids) if creators.present? result = result.where(collection: collections.ids) if collections.present? - result = result.in_stage(stages.ids) if stages.present? + result = result.in_stage(stages.ids) if stages.present? && engagement_status == "doing" result = result.tagged_with(tags.ids) if tags.present? result = result.where("cards.created_at": creation_window) if creation_window result = result.closed_at_window(closure_window) if closure_window From bd36e433487af76d531bc9b0c4889a38f697787c Mon Sep 17 00:00:00 2001 From: Jason Zimdars Date: Thu, 28 Aug 2025 20:56:40 -0500 Subject: [PATCH 2/5] Engagement status interferes with stages filter I'm not entirely sure why `engagement_status` is even present here but it ends up being inherited by the Recently Closed section because @closed doesn't explicityly set its status.That makes the cards in closed disappear when filtering by stage becaue they return true for `engagement_status = doing`. --- app/views/cards/index/_workflow_filter.html.erb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/views/cards/index/_workflow_filter.html.erb b/app/views/cards/index/_workflow_filter.html.erb index d48ba88e0..3f1dad724 100644 --- a/app/views/cards/index/_workflow_filter.html.erb +++ b/app/views/cards/index/_workflow_filter.html.erb @@ -13,11 +13,11 @@ In stage(s)… <%= form_with url: cards_path, method: :get, class: "popup__list", data: { controller: "form" } do |form| %> - <% filter.as_params.except(:stage_ids).each do |key, value| %> + <% filter.as_params.except(:stage_ids, :engagement_status).each do |key, value| %> <%= filter_hidden_field_tag key, value %> <% end %> - <%= link_to cards_path(filter.as_params.except(:stage_ids)), class: "popup__item btn" do %> + <%= link_to cards_path(filter.as_params.except(:stage_ids, :engagement_status)), class: "popup__item btn" do %> All stages <% end %> From b261cf629a7f4834a581a27a604afa056f857f3b Mon Sep 17 00:00:00 2001 From: Jason Zimdars Date: Thu, 28 Aug 2025 21:01:02 -0500 Subject: [PATCH 3/5] Fix layout when filtering by closed `.card_columns` needs to be present for Recently Closed to have the correct layout. --- app/assets/stylesheets/card-columns.css | 5 ++++- app/views/cards/index.html.erb | 10 ++++++---- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/app/assets/stylesheets/card-columns.css b/app/assets/stylesheets/card-columns.css index b02f8b9bf..d3daec9d3 100644 --- a/app/assets/stylesheets/card-columns.css +++ b/app/assets/stylesheets/card-columns.css @@ -23,11 +23,14 @@ .card-columns { margin: auto; max-inline-size: 100%; - min-block-size: 20lh; padding-inline: var(--reserved-bubble-space); position: relative; transition: 300ms ease-in-out; + &:has(.cards) { + min-block-size: 20lh; + } + &:before { background: var(--gradient-border); block-size: 1px; diff --git a/app/views/cards/index.html.erb b/app/views/cards/index.html.erb index 0f52be2ea..c343623fa 100644 --- a/app/views/cards/index.html.erb +++ b/app/views/cards/index.html.erb @@ -40,13 +40,15 @@ dragover->drag-and-drop#dragOver drop->drag-and-drop#drop dragend->drag-and-drop#dragEnd" } do %> - <% unless @filter.closers.any? %> -
+ +
+ <% unless @filter.closers.any? %> <%= render "cards/index/engagement/on_deck", **@on_deck.to_h %> <%= render "cards/index/engagement/considering", **@considering.to_h %> <%= render "cards/index/engagement/doing", **@doing.to_h %> -
- <% end %> + <% end %> +
+ <%= render "cards/index/engagement/closed", **@closed.to_h %> <% end %> From e86be26f4366557410d27f99f0e766e15ce2fefd Mon Sep 17 00:00:00 2001 From: Jason Zimdars Date: Thu, 28 Aug 2025 21:24:23 -0500 Subject: [PATCH 4/5] Update test This test is a little naive because it matches cards in stages regardless of engagement status unlike the actual conroller. For example `@new_card` gets created and moved to a stage but it's actually not even published and so shouldn't be stageable. --- test/models/filter_test.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/models/filter_test.rb b/test/models/filter_test.rb index 6dce00f62..537cf384c 100644 --- a/test/models/filter_test.rb +++ b/test/models/filter_test.rb @@ -18,7 +18,7 @@ class FilterTest < ActiveSupport::TestCase assert_equal [ cards(:layout) ], filter.cards filter = users(:david).filters.new stage_ids: [ workflow_stages(:qa_on_hold).id ] - assert_equal [ cards(:logo), @new_card ], filter.cards + assert_equal [ cards(:logo), cards(:layout), @new_card, cards(:text) ], filter.cards filter = users(:david).filters.new assignment_status: "unassigned", collection_ids: [ @new_collection.id ] assert_equal [ @new_card ], filter.cards From 70b07f856f0f9cb4a3bead8fa016b3afea2d0330 Mon Sep 17 00:00:00 2001 From: Jason Zimdars Date: Sun, 31 Aug 2025 15:28:01 -0500 Subject: [PATCH 5/5] Use inquiry method --- app/models/filter.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/models/filter.rb b/app/models/filter.rb index d8611a024..c822fe471 100644 --- a/app/models/filter.rb +++ b/app/models/filter.rb @@ -28,7 +28,7 @@ class Filter < ApplicationRecord result = result.assigned_to(assignees.ids) if assignees.present? result = result.where(creator_id: creators.ids) if creators.present? result = result.where(collection: collections.ids) if collections.present? - result = result.in_stage(stages.ids) if stages.present? && engagement_status == "doing" + result = result.in_stage(stages.ids) if stages.present? && engagement_status&.doing? result = result.tagged_with(tags.ids) if tags.present? result = result.where("cards.created_at": creation_window) if creation_window result = result.closed_at_window(closure_window) if closure_window