From 8846d3357e85ff242a2b4d34bbdbf85ac61cd357 Mon Sep 17 00:00:00 2001 From: Jason Zimdars Date: Wed, 1 Oct 2025 16:50:57 -0500 Subject: [PATCH 01/21] Add UI for navigating to the column perma --- app/assets/images/external-link.svg | 7 +++++++ app/assets/stylesheets/icons.css | 1 + .../collections/show/menu/_column.html.erb | 18 +++++++++++++++--- 3 files changed, 23 insertions(+), 3 deletions(-) create mode 100644 app/assets/images/external-link.svg diff --git a/app/assets/images/external-link.svg b/app/assets/images/external-link.svg new file mode 100644 index 000000000..ed2483aa9 --- /dev/null +++ b/app/assets/images/external-link.svg @@ -0,0 +1,7 @@ + + + + + + + \ No newline at end of file diff --git a/app/assets/stylesheets/icons.css b/app/assets/stylesheets/icons.css index 0f2e8177a..3f4e25431 100644 --- a/app/assets/stylesheets/icons.css +++ b/app/assets/stylesheets/icons.css @@ -45,6 +45,7 @@ .icon--crown { --svg: url("crown.svg "); } .icon--email { --svg: url("email.svg "); } .icon--everyone { --svg: url("everyone.svg "); } + .icon--external-link { --svg: url("external-link.svg "); } .icon--gear { --svg: url("gear.svg "); } .icon--filter { --svg: url("filter.svg "); } .icon--globe { --svg: url("globe.svg "); } diff --git a/app/views/collections/show/menu/_column.html.erb b/app/views/collections/show/menu/_column.html.erb index 22d249126..4368cb5da 100644 --- a/app/views/collections/show/menu/_column.html.erb +++ b/app/views/collections/show/menu/_column.html.erb @@ -6,14 +6,26 @@ From 8e1243a283961b79b3f931403aa3c26d2b487285 Mon Sep 17 00:00:00 2001 From: Jason Zimdars Date: Wed, 1 Oct 2025 17:13:33 -0500 Subject: [PATCH 02/21] Add layout to show view --- .../collections/columns_controller.rb | 2 +- app/views/collections/columns/show.html.erb | 39 ++++++++++++++----- 2 files changed, 31 insertions(+), 10 deletions(-) diff --git a/app/controllers/collections/columns_controller.rb b/app/controllers/collections/columns_controller.rb index 41ab1a56a..6210a9556 100644 --- a/app/controllers/collections/columns_controller.rb +++ b/app/controllers/collections/columns_controller.rb @@ -1,5 +1,5 @@ class Collections::ColumnsController < ApplicationController - include ActionView::RecordIdentifier, CollectionScoped + include ActionView::RecordIdentifier, CollectionScoped, FilterScoped before_action :set_column, only: [ :show, :update, :destroy ] diff --git a/app/views/collections/columns/show.html.erb b/app/views/collections/columns/show.html.erb index 49724acc3..709c5221e 100644 --- a/app/views/collections/columns/show.html.erb +++ b/app/views/collections/columns/show.html.erb @@ -1,11 +1,32 @@ -<%= turbo_frame_tag dom_id(@column, :cards) do %> - <% if @page.used? %> - <%= with_manual_pagination dom_id(@column, :cards), @page do %> - <%= render "collections/columns/list", cards: @page.records, draggable: true %> +<% @page_title = "Column: #{ @column.name }" %> + +<% content_for :header do %> + <%= render "filters/menu", user_filtering: @user_filtering %> + +
+ <%= link_to @column.collection, class: "btn borderless txt-medium", data: { controller: "hotkey", action: "keydown.esc@document->hotkey#click" } do %> + + ← + <%= @column.collection.name %> + <% end %> - <% else %> -
-

Drag cards here

-
- <% end %> +
+ +

+ <%= @page_title %> +

<% end %> + +
+ <%= turbo_frame_tag dom_id(@column, :cards) do %> + <% if @page.used? %> + <%= with_manual_pagination dom_id(@column, :cards), @page do %> + <%= render "collections/columns/list", cards: @page.records, draggable: true %> + <% end %> + <% else %> +
+

Drag cards here

+
+ <% end %> + <% end %> +
From 108d62c6d3b8474f122314fd96383173a6df9332 Mon Sep 17 00:00:00 2001 From: Jason Zimdars Date: Thu, 2 Oct 2025 16:59:19 -0500 Subject: [PATCH 03/21] Don't clip on the grid view --- app/assets/stylesheets/card-columns.css | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/assets/stylesheets/card-columns.css b/app/assets/stylesheets/card-columns.css index b6753394e..f4ff6ac05 100644 --- a/app/assets/stylesheets/card-columns.css +++ b/app/assets/stylesheets/card-columns.css @@ -73,7 +73,7 @@ z-index: 3; } - &:not(.cards--considering, .is-collapsed) { + &:not(.cards--considering, .is-collapsed, .cards--grid) { overflow: clip; } From d080773fa098e8761cb1099855f2ab92619015bd Mon Sep 17 00:00:00 2001 From: Jason Zimdars Date: Thu, 2 Oct 2025 16:59:46 -0500 Subject: [PATCH 04/21] Expand Closed and Not Now columns --- .../collections/columns/closeds_controller.rb | 2 +- .../columns/not_nows_controller.rb | 2 +- .../collections/columns/closeds/show.html.erb | 37 +++++++++++++----- .../columns/not_nows/show.html.erb | 39 ++++++++++++++----- app/views/collections/show/_closed.html.erb | 4 +- app/views/collections/show/_not_now.html.erb | 4 +- .../collections/show/menu/_expand.html.erb | 16 ++++++++ 7 files changed, 82 insertions(+), 22 deletions(-) create mode 100644 app/views/collections/show/menu/_expand.html.erb diff --git a/app/controllers/collections/columns/closeds_controller.rb b/app/controllers/collections/columns/closeds_controller.rb index 2ffd7c253..30d2cd2c7 100644 --- a/app/controllers/collections/columns/closeds_controller.rb +++ b/app/controllers/collections/columns/closeds_controller.rb @@ -1,5 +1,5 @@ class Collections::Columns::ClosedsController < ApplicationController - include CollectionScoped + include CollectionScoped, FilterScoped def show set_page_and_extract_portion_from @collection.cards.closed.recently_closed_first diff --git a/app/controllers/collections/columns/not_nows_controller.rb b/app/controllers/collections/columns/not_nows_controller.rb index 8b6b233b6..b5a311a57 100644 --- a/app/controllers/collections/columns/not_nows_controller.rb +++ b/app/controllers/collections/columns/not_nows_controller.rb @@ -1,5 +1,5 @@ class Collections::Columns::NotNowsController < ApplicationController - include CollectionScoped + include CollectionScoped, FilterScoped def show set_page_and_extract_portion_from @collection.cards.postponed.reverse_chronologically.with_golden_first diff --git a/app/views/collections/columns/closeds/show.html.erb b/app/views/collections/columns/closeds/show.html.erb index 160361ea8..9e6c16b73 100644 --- a/app/views/collections/columns/closeds/show.html.erb +++ b/app/views/collections/columns/closeds/show.html.erb @@ -1,11 +1,30 @@ -<%= turbo_frame_tag :closed_column do %> - <% if @page.used? %> - <%= with_manual_pagination :closed_column, @page do %> - <%= render "collections/columns/list", cards: @page.records, draggable: true %> +<% @page_title = "Column: Closed" %> + +<% content_for :header do %> + <%= render "filters/menu", user_filtering: @user_filtering %> + +
+ <%= link_to @collection, class: "btn borderless txt-medium", data: { controller: "hotkey", action: "keydown.esc@document->hotkey#click" } do %> + + ← + <%= @collection.name %> + <% end %> - <% else %> -
-

Drag cards here

-
- <% end %> +
+ +

+ <%= @page_title %> +

<% end %> + +
+ <%= turbo_frame_tag :closed_column do %> + <% if @page.used? %> + <%= with_manual_pagination :closed_column, @page do %> + <%= render "collections/columns/list", cards: @page.records, draggable: true %> + <% end %> + <% else %> +

Closed cards will appear here.

+ <% end %> + <% end %> +
diff --git a/app/views/collections/columns/not_nows/show.html.erb b/app/views/collections/columns/not_nows/show.html.erb index d50ed3371..506d164cf 100644 --- a/app/views/collections/columns/not_nows/show.html.erb +++ b/app/views/collections/columns/not_nows/show.html.erb @@ -1,11 +1,32 @@ -<%= turbo_frame_tag :not_now_column do %> - <% if @page.used? %> - <%= with_manual_pagination :not_now_column, @page do %> - <%= render "collections/columns/list", cards: @page.records, draggable: true %> +<% @page_title = "Column: Now now" %> + +<% content_for :header do %> + <%= render "filters/menu", user_filtering: @user_filtering %> + +
+ <%= link_to @collection, class: "btn borderless txt-medium", data: { controller: "hotkey", action: "keydown.esc@document->hotkey#click" } do %> + + ← + <%= @collection.name %> + <% end %> - <% else %> -
-

Drag cards here

-
- <% end %> +
+ +

+ <%= @page_title %> +

<% end %> + +
+ <%= turbo_frame_tag :not_now_column do %> + <% if @page.used? %> + <%= with_manual_pagination :not_now_column, @page do %> + <%= render "collections/columns/list", cards: @page.records, draggable: true %> + <% end %> + <% else %> +
+

Drag cards here

+
+ <% end %> + <% end %> +
diff --git a/app/views/collections/show/_closed.html.erb b/app/views/collections/show/_closed.html.erb index 8d7f41a43..383bba6db 100644 --- a/app/views/collections/show/_closed.html.erb +++ b/app/views/collections/show/_closed.html.erb @@ -6,7 +6,9 @@ data-drag-and-drop-url="<%= columns_card_drops_closure_path("__id__") %>" > - <%= render "collections/show/expander", title: "Done", count: collection.cards.closed.count, column_id: "closed-cards" %> + <%= render "collections/show/expander", title: "Done", count: collection.cards.closed.count, column_id: "closed-cards" do %> + <%= render "collections/show/menu/expand", column_path: collection_columns_closed_path(collection) %> + <% end %> <%= column_frame_tag :closed_column, src: collection_columns_closed_path(collection) %> diff --git a/app/views/collections/show/_not_now.html.erb b/app/views/collections/show/_not_now.html.erb index b24999067..c99b9b3af 100644 --- a/app/views/collections/show/_not_now.html.erb +++ b/app/views/collections/show/_not_now.html.erb @@ -6,7 +6,9 @@ data-drag-and-drop-url="<%= columns_card_drops_not_now_path("__id__") %>" > - <%= render "collections/show/expander", title: "Not Now", count: collection.cards.postponed.count, column_id: "not-now" %> + <%= render "collections/show/expander", title: "Not Now", count: collection.cards.postponed.count, column_id: "not-now" do %> + <%= render "collections/show/menu/expand", column_path: collection_columns_not_now_path(collection) %> + <% end %> <%= column_frame_tag :not_now_column, src: collection_columns_not_now_path(collection) %> diff --git a/app/views/collections/show/menu/_expand.html.erb b/app/views/collections/show/menu/_expand.html.erb new file mode 100644 index 000000000..bf217954e --- /dev/null +++ b/app/views/collections/show/menu/_expand.html.erb @@ -0,0 +1,16 @@ +
+ + + + +
\ No newline at end of file From 610db7d20334251935394e203d27165b807e2bf3 Mon Sep 17 00:00:00 2001 From: Jason Zimdars Date: Thu, 2 Oct 2025 17:57:09 -0500 Subject: [PATCH 05/21] Make The Stream expandable --- .../collections/columns/streams_controller.rb | 2 +- .../collections/columns/streams/show.html.erb | 39 ++++++++++++++----- app/views/collections/show/_stream.html.erb | 4 ++ 3 files changed, 35 insertions(+), 10 deletions(-) diff --git a/app/controllers/collections/columns/streams_controller.rb b/app/controllers/collections/columns/streams_controller.rb index 16a2bf671..cc1fc2f67 100644 --- a/app/controllers/collections/columns/streams_controller.rb +++ b/app/controllers/collections/columns/streams_controller.rb @@ -1,5 +1,5 @@ class Collections::Columns::StreamsController < ApplicationController - include CollectionScoped + include CollectionScoped, FilterScoped def show set_page_and_extract_portion_from @collection.cards.awaiting_triage.reverse_chronologically.with_golden_first diff --git a/app/views/collections/columns/streams/show.html.erb b/app/views/collections/columns/streams/show.html.erb index 1eb93e74a..0758168a5 100644 --- a/app/views/collections/columns/streams/show.html.erb +++ b/app/views/collections/columns/streams/show.html.erb @@ -1,11 +1,32 @@ -<%= turbo_frame_tag :stream_column do %> - <% if @page.used? %> - <%= with_manual_pagination :stream_column, @page do %> - <%= render "collections/columns/list", cards: @page.records, draggable: true %> +<% @page_title = "Column: The Stream" %> + +<% content_for :header do %> + <%= render "filters/menu", user_filtering: @user_filtering %> + +
+ <%= link_to @collection, class: "btn borderless txt-medium", data: { controller: "hotkey", action: "keydown.esc@document->hotkey#click" } do %> + + ← + <%= @collection.name %> + <% end %> - <% else %> -
-

Drag cards here

-
- <% end %> +
+ +

+ <%= @page_title %> +

<% end %> + +
+ <%= turbo_frame_tag :stream_column do %> + <% if @page.used? %> + <%= with_manual_pagination :stream_column, @page do %> + <%= render "collections/columns/list", cards: @page.records, draggable: true %> + <% end %> + <% else %> +
+

Drag cards here

+
+ <% end %> + <% end %> +
\ No newline at end of file diff --git a/app/views/collections/show/_stream.html.erb b/app/views/collections/show/_stream.html.erb index b48c90bb7..544bd726e 100644 --- a/app/views/collections/show/_stream.html.erb +++ b/app/views/collections/show/_stream.html.erb @@ -5,6 +5,10 @@ data-drag-and-drop-url="<%= columns_card_drops_stream_path("__id__") %>">
+
+

The Stream

+ <%= render "collections/show/menu/expand", column_path: collection_columns_stream_path(collection) %> +
<%= render "columns/show/add_card_button", collection: collection %> <% if page.used? %> From 3d253309b0729ad6c6a1ba4edfca6a3b1da0c705 Mon Sep 17 00:00:00 2001 From: Jason Zimdars Date: Thu, 2 Oct 2025 19:51:42 -0500 Subject: [PATCH 06/21] Add a dedicated expand button --- app/assets/stylesheets/card-columns.css | 25 ++++++++++++++++--- app/views/collections/show/_column.html.erb | 5 ++++ app/views/collections/show/_stream.html.erb | 5 +++- .../collections/show/menu/_column.html.erb | 12 +++------ .../collections/show/menu/_expand.html.erb | 20 +++------------ 5 files changed, 38 insertions(+), 29 deletions(-) diff --git a/app/assets/stylesheets/card-columns.css b/app/assets/stylesheets/card-columns.css index 1a50f110f..839d541cc 100644 --- a/app/assets/stylesheets/card-columns.css +++ b/app/assets/stylesheets/card-columns.css @@ -200,6 +200,25 @@ } } + .btn.cards__expander-button { + --btn-background: transparent; + + block-size: var(--column-width-collapsed); + inline-size: var(--column-width-collapsed); + inset: 0 0 auto auto; + position: absolute; + translate: calc(var(--column-gap) * -2); + z-index: var(--z-popup); + + .cards--considering & { + translate: none; + } + + .cards.is-collapsed & { + display: none; + } + } + .cards__expander-count { line-height: var(--column-width-collapsed); inline-size: var(--column-width-collapsed); @@ -226,9 +245,9 @@ } .cards__expander-menu { - inset: 0 0 auto auto; + inset: 0 auto auto 0; position: absolute; - translate: calc(var(--column-gap) * -2); + translate: calc(var(--column-gap) * 2); z-index: var(--z-popup); .btn--circle { @@ -416,7 +435,7 @@ .cards__decoration { --gradient-opacity: 30%; - --size: 4.25em; + --size: 1.125em; background-color: var(--color-canvas); background-image: radial-gradient(ellipse at bottom, diff --git a/app/views/collections/show/_column.html.erb b/app/views/collections/show/_column.html.erb index cc7ac0697..617fadda0 100644 --- a/app/views/collections/show/_column.html.erb +++ b/app/views/collections/show/_column.html.erb @@ -11,5 +11,10 @@ <%= render "collections/show/menu/column", column: column %> <% end %> + <%= link_to collection_column_path(column.collection, column), class: "btn btn--circle txt-x-small borderless cards__expander-button", data: { turbo_frame: "_top" } do %> + <%= icon_tag "external-link" %> + Expand column + <% end %> + <%= column_frame_tag dom_id(column, :cards), src: collection_column_path(column.collection, column) %> diff --git a/app/views/collections/show/_stream.html.erb b/app/views/collections/show/_stream.html.erb index 544bd726e..91d5ec0ff 100644 --- a/app/views/collections/show/_stream.html.erb +++ b/app/views/collections/show/_stream.html.erb @@ -7,7 +7,10 @@

The Stream

- <%= render "collections/show/menu/expand", column_path: collection_columns_stream_path(collection) %> + <%= link_to collection_columns_stream_path(collection), class: "btn btn--circle txt-x-small borderless cards__expander-button", data: { turbo_frame: "_top" } do %> + <%= icon_tag "external-link" %> + Expand column + <% end %>
<%= render "columns/show/add_card_button", collection: collection %> diff --git a/app/views/collections/show/menu/_column.html.erb b/app/views/collections/show/menu/_column.html.erb index d53bdddb8..156642b31 100644 --- a/app/views/collections/show/menu/_column.html.erb +++ b/app/views/collections/show/menu/_column.html.erb @@ -5,26 +5,20 @@ diff --git a/app/views/collections/show/menu/_expand.html.erb b/app/views/collections/show/menu/_expand.html.erb index bf217954e..f6df66318 100644 --- a/app/views/collections/show/menu/_expand.html.erb +++ b/app/views/collections/show/menu/_expand.html.erb @@ -1,16 +1,4 @@ -
- - - - -
\ No newline at end of file +<%= link_to column_path, class: "btn btn--circle txt-x-small borderless cards__expander-button", data: { turbo_frame: "_top" } do %> + <%= icon_tag "external-link" %> + Expand column +<% end %> \ No newline at end of file From b31df02ff8be4b46c7fc0964236e47cedb55f207 Mon Sep 17 00:00:00 2001 From: Jason Zimdars Date: Thu, 2 Oct 2025 19:57:31 -0500 Subject: [PATCH 07/21] No longer used --- app/assets/stylesheets/card-columns.css | 8 -------- 1 file changed, 8 deletions(-) diff --git a/app/assets/stylesheets/card-columns.css b/app/assets/stylesheets/card-columns.css index 839d541cc..7ef2d65fc 100644 --- a/app/assets/stylesheets/card-columns.css +++ b/app/assets/stylesheets/card-columns.css @@ -591,11 +591,3 @@ z-index: 1; } } - - /* Closed - /* ------------------------------------------------------------------------ */ - - .cards--closed { - --column-color: var(--color-ink-lighter); - } -} From 4184138702a84ea934508fb2344cf2ba3ea59970 Mon Sep 17 00:00:00 2001 From: Jason Zimdars Date: Thu, 2 Oct 2025 20:07:32 -0500 Subject: [PATCH 08/21] Allow gradient for closed and not now after all --- app/assets/stylesheets/card-columns.css | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/app/assets/stylesheets/card-columns.css b/app/assets/stylesheets/card-columns.css index 7ef2d65fc..d041f0749 100644 --- a/app/assets/stylesheets/card-columns.css +++ b/app/assets/stylesheets/card-columns.css @@ -551,18 +551,12 @@ /* ------------------------------------------------------------------------ */ .cards--on-deck { - --column-color: var(--color-ink-lighter); + --card-color: var(--color-ink-light) !important; .card { --card-color: var(--color-card-complete) !important; } - &.cards.is-collapsed { - .cards__expander:after { - background: var(--column-color); - } - } - .bubble { display: none !important; } @@ -591,3 +585,4 @@ z-index: 1; } } +} From 299ce6252f9d26d7b3ff75d2486c491a2a8129cd Mon Sep 17 00:00:00 2001 From: Jason Zimdars Date: Thu, 2 Oct 2025 20:18:37 -0500 Subject: [PATCH 09/21] Not now cards should be grey, too --- app/assets/stylesheets/cards.css | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/app/assets/stylesheets/cards.css b/app/assets/stylesheets/cards.css index de83b807c..573a5405b 100644 --- a/app/assets/stylesheets/cards.css +++ b/app/assets/stylesheets/cards.css @@ -322,8 +322,10 @@ transform-origin: top right; } - .card:has(.card__closed), - .card-perma:has(.card__closed) { + .card:is(.card__closed), + .card:is(.card--postponed), + .card-perma:has(.card__closed), + .card-perma:has(.card--postponed) { --card-color: var(--color-card-complete) !important; } From 02d96473bb6237ea1b292fdd4eccb44a78f42327 Mon Sep 17 00:00:00 2001 From: Jason Zimdars Date: Thu, 2 Oct 2025 20:36:21 -0500 Subject: [PATCH 10/21] Actually, it needs to be like this for closed cards which don't get a specific class --- app/assets/stylesheets/cards.css | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/assets/stylesheets/cards.css b/app/assets/stylesheets/cards.css index 573a5405b..7a1002206 100644 --- a/app/assets/stylesheets/cards.css +++ b/app/assets/stylesheets/cards.css @@ -322,7 +322,7 @@ transform-origin: top right; } - .card:is(.card__closed), + .card:has(.card__closed), .card:is(.card--postponed), .card-perma:has(.card__closed), .card-perma:has(.card--postponed) { From 55e4fec01fcfa15d96a856efa5f087f7cda61857 Mon Sep 17 00:00:00 2001 From: Jason Zimdars Date: Thu, 2 Oct 2025 20:37:34 -0500 Subject: [PATCH 11/21] Don't display bubbles for closed or not now cards --- app/assets/stylesheets/cards.css | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/app/assets/stylesheets/cards.css b/app/assets/stylesheets/cards.css index 7a1002206..24db77061 100644 --- a/app/assets/stylesheets/cards.css +++ b/app/assets/stylesheets/cards.css @@ -327,6 +327,10 @@ .card-perma:has(.card__closed), .card-perma:has(.card--postponed) { --card-color: var(--color-card-complete) !important; + + .bubble { + display: none; + } } .card__closed-title { From 4527dcbeda97a575b072dd27a30e379546fcd6f5 Mon Sep 17 00:00:00 2001 From: Jorge Manrubia Date: Fri, 3 Oct 2025 10:56:34 +0200 Subject: [PATCH 12/21] Remove unnecessary filtering code After removing collections from the filtering menu, there was quite a good cleanup here pending --- .../account/settings_controller.rb | 2 -- app/controllers/cards_controller.rb | 2 -- .../collections/columns/closeds_controller.rb | 2 +- .../columns/not_nows_controller.rb | 2 +- .../collections/columns/streams_controller.rb | 2 +- .../collections/columns_controller.rb | 2 +- app/controllers/concerns/filter_scoped.rb | 26 ------------------- app/controllers/events_controller.rb | 2 -- app/controllers/my/menus_controller.rb | 7 ----- .../notifications/settings_controller.rb | 1 - app/controllers/notifications_controller.rb | 2 -- app/controllers/webhooks_controller.rb | 2 -- app/models/user/filtering.rb | 18 +------------ app/views/account/settings/show.html.erb | 2 +- app/views/cards/index.html.erb | 2 +- app/views/cards/show.html.erb | 2 +- .../collections/columns/closeds/show.html.erb | 2 +- .../columns/not_nows/show.html.erb | 2 +- app/views/collections/columns/show.html.erb | 2 +- .../collections/columns/streams/show.html.erb | 2 +- app/views/collections/edit.html.erb | 2 +- app/views/collections/new.html.erb | 2 +- app/views/collections/show.html.erb | 2 +- app/views/events/index.html.erb | 2 +- app/views/filters/_menu.html.erb | 2 +- app/views/filters/menu/_collections.html.erb | 11 +++----- .../menu/collections/_all_option.html.erb | 2 -- app/views/notifications/index.html.erb | 2 +- .../notifications/settings/show.html.erb | 2 +- app/views/users/edit.html.erb | 2 +- app/views/users/show.html.erb | 2 +- app/views/webhooks/edit.html.erb | 2 +- app/views/webhooks/index.html.erb | 2 +- app/views/webhooks/new.html.erb | 2 +- app/views/webhooks/show.html.erb | 2 +- 35 files changed, 29 insertions(+), 94 deletions(-) diff --git a/app/controllers/account/settings_controller.rb b/app/controllers/account/settings_controller.rb index 585e87400..6b08abba2 100644 --- a/app/controllers/account/settings_controller.rb +++ b/app/controllers/account/settings_controller.rb @@ -1,6 +1,4 @@ class Account::SettingsController < ApplicationController - include FilterScoped - def show @account = Account.sole @users = User.active.alphabetically diff --git a/app/controllers/cards_controller.rb b/app/controllers/cards_controller.rb index 526806879..9a0d5d19c 100644 --- a/app/controllers/cards_controller.rb +++ b/app/controllers/cards_controller.rb @@ -6,8 +6,6 @@ class CardsController < ApplicationController before_action :set_collection, only: %i[ create ] before_action :set_card, only: %i[ show edit update destroy ] - enable_collection_filtering only: :index - PAGE_SIZE = 25 def index diff --git a/app/controllers/collections/columns/closeds_controller.rb b/app/controllers/collections/columns/closeds_controller.rb index 30d2cd2c7..2ffd7c253 100644 --- a/app/controllers/collections/columns/closeds_controller.rb +++ b/app/controllers/collections/columns/closeds_controller.rb @@ -1,5 +1,5 @@ class Collections::Columns::ClosedsController < ApplicationController - include CollectionScoped, FilterScoped + include CollectionScoped def show set_page_and_extract_portion_from @collection.cards.closed.recently_closed_first diff --git a/app/controllers/collections/columns/not_nows_controller.rb b/app/controllers/collections/columns/not_nows_controller.rb index b5a311a57..8b6b233b6 100644 --- a/app/controllers/collections/columns/not_nows_controller.rb +++ b/app/controllers/collections/columns/not_nows_controller.rb @@ -1,5 +1,5 @@ class Collections::Columns::NotNowsController < ApplicationController - include CollectionScoped, FilterScoped + include CollectionScoped def show set_page_and_extract_portion_from @collection.cards.postponed.reverse_chronologically.with_golden_first diff --git a/app/controllers/collections/columns/streams_controller.rb b/app/controllers/collections/columns/streams_controller.rb index cc1fc2f67..16a2bf671 100644 --- a/app/controllers/collections/columns/streams_controller.rb +++ b/app/controllers/collections/columns/streams_controller.rb @@ -1,5 +1,5 @@ class Collections::Columns::StreamsController < ApplicationController - include CollectionScoped, FilterScoped + include CollectionScoped def show set_page_and_extract_portion_from @collection.cards.awaiting_triage.reverse_chronologically.with_golden_first diff --git a/app/controllers/collections/columns_controller.rb b/app/controllers/collections/columns_controller.rb index 6210a9556..41ab1a56a 100644 --- a/app/controllers/collections/columns_controller.rb +++ b/app/controllers/collections/columns_controller.rb @@ -1,5 +1,5 @@ class Collections::ColumnsController < ApplicationController - include ActionView::RecordIdentifier, CollectionScoped, FilterScoped + include ActionView::RecordIdentifier, CollectionScoped before_action :set_column, only: [ :show, :update, :destroy ] diff --git a/app/controllers/concerns/filter_scoped.rb b/app/controllers/concerns/filter_scoped.rb index 2c422be2a..a9341f604 100644 --- a/app/controllers/concerns/filter_scoped.rb +++ b/app/controllers/concerns/filter_scoped.rb @@ -6,12 +6,6 @@ module FilterScoped before_action :set_user_filtering end - class_methods do - def enable_collection_filtering(**options) - before_action :enable_collection_filtering, **options - end - end - private def set_filter if params[:filter_id].present? @@ -32,24 +26,4 @@ module FilterScoped def expanded_param ActiveRecord::Type::Boolean.new.cast(params[:expand_all]) end - - def enable_collection_filtering - # We pass a block so that we don't have to pass around the script_name and host - # to the model to make +url_for+ invocable - @user_filtering.enable_collection_filtering do |**options| - url_for(options) - end - end - - def enable_referral_collection_filtering - @user_filtering.enable_collection_filtering do |**options| - if request.referer.present? - uri = URI.parse(request.referer) - uri.query = Rack::Utils.build_query(options) - uri.to_s - else - url_for(options) - end - end - end end diff --git a/app/controllers/events_controller.rb b/app/controllers/events_controller.rb index 744a7f925..5b52b02fa 100644 --- a/app/controllers/events_controller.rb +++ b/app/controllers/events_controller.rb @@ -1,8 +1,6 @@ class EventsController < ApplicationController include DayTimelinesScoped - enable_collection_filtering only: :index - def index fresh_when @day_timeline end diff --git a/app/controllers/my/menus_controller.rb b/app/controllers/my/menus_controller.rb index 1a8316957..a81705df3 100644 --- a/app/controllers/my/menus_controller.rb +++ b/app/controllers/my/menus_controller.rb @@ -1,14 +1,7 @@ class My::MenusController < ApplicationController include FilterScoped - before_action :enable_referral_collection_filtering, if: :collection_filtering_enabled? - def show fresh_when @user_filtering end - - private - def collection_filtering_enabled? - params[:enable_collection_filtering].present? - end end diff --git a/app/controllers/notifications/settings_controller.rb b/app/controllers/notifications/settings_controller.rb index 4323ed3c8..42608b558 100644 --- a/app/controllers/notifications/settings_controller.rb +++ b/app/controllers/notifications/settings_controller.rb @@ -1,5 +1,4 @@ class Notifications::SettingsController < ApplicationController - include FilterScoped before_action :set_settings def show diff --git a/app/controllers/notifications_controller.rb b/app/controllers/notifications_controller.rb index 41446b2fb..d188e3a1e 100644 --- a/app/controllers/notifications_controller.rb +++ b/app/controllers/notifications_controller.rb @@ -1,6 +1,4 @@ class NotificationsController < ApplicationController - include FilterScoped - def index @unread = Current.user.notifications.unread.ordered unless current_page_param set_page_and_extract_portion_from Current.user.notifications.read.ordered diff --git a/app/controllers/webhooks_controller.rb b/app/controllers/webhooks_controller.rb index fceb37c5c..8f8315186 100644 --- a/app/controllers/webhooks_controller.rb +++ b/app/controllers/webhooks_controller.rb @@ -1,6 +1,4 @@ class WebhooksController < ApplicationController - include FilterScoped - before_action :ensure_can_administer before_action :set_collection before_action :set_webhook, except: %i[ index new create ] diff --git a/app/models/user/filtering.rb b/app/models/user/filtering.rb index 6e00ecbc1..c9f049ab3 100644 --- a/app/models/user/filtering.rb +++ b/app/models/user/filtering.rb @@ -71,28 +71,12 @@ class User::Filtering filter.collections.any? end - def enable_collection_filtering(&block) - @collection_filtering_route_resolver = block - end - - def self_filter_path(...) - if supports_collection_filtering? - @collection_filtering_route_resolver.call(...) - else - cards_path(...) - end - end - def single_collection_or_first # Default to the first selected or, when no selection, to the first one filter.collections.first || collections.first end def cache_key - ActiveSupport::Cache.expand_cache_key([ user, filter, expanded?, collections, tags, users, filters, supports_collection_filtering? ], "user-filtering") - end - - def supports_collection_filtering? - @collection_filtering_route_resolver.present? + ActiveSupport::Cache.expand_cache_key([ user, filter, expanded?, collections, tags, users, filters ], "user-filtering") end end diff --git a/app/views/account/settings/show.html.erb b/app/views/account/settings/show.html.erb index 72bca26cb..732c49abc 100644 --- a/app/views/account/settings/show.html.erb +++ b/app/views/account/settings/show.html.erb @@ -1,7 +1,7 @@ <% @page_title = "Account Settings" %> <% content_for :header do %> - <%= render "filters/menu", user_filtering: @user_filtering %> + <%= render "filters/menu" %>

<%= @page_title %>

<% end %> diff --git a/app/views/cards/index.html.erb b/app/views/cards/index.html.erb index 47d15dcb8..99121d028 100644 --- a/app/views/cards/index.html.erb +++ b/app/views/cards/index.html.erb @@ -10,7 +10,7 @@ <% end %> <% content_for :header do %> - <%= render "filters/menu", user_filtering: @user_filtering %> + <%= render "filters/menu" %>

<%= @user_filtering.selected_collections_label %> diff --git a/app/views/cards/show.html.erb b/app/views/cards/show.html.erb index 9b35b9b1e..36371cbb1 100644 --- a/app/views/cards/show.html.erb +++ b/app/views/cards/show.html.erb @@ -10,7 +10,7 @@ <% end %> <% content_for :header do %> - <%= render "filters/menu", user_filtering: @user_filtering %> + <%= render "filters/menu" %> <%= link_to collection_url(@card.collection), class: "header__title btn borderless txt-large", style: "--btn-padding: 0.25ch 1ch 0.25ch 0.75ch; view-transistion-name: card-collection-title;", diff --git a/app/views/collections/columns/closeds/show.html.erb b/app/views/collections/columns/closeds/show.html.erb index 9e6c16b73..a30152ac7 100644 --- a/app/views/collections/columns/closeds/show.html.erb +++ b/app/views/collections/columns/closeds/show.html.erb @@ -1,7 +1,7 @@ <% @page_title = "Column: Closed" %> <% content_for :header do %> - <%= render "filters/menu", user_filtering: @user_filtering %> + <%= render "filters/menu" %>
<%= link_to @collection, class: "btn borderless txt-medium", data: { controller: "hotkey", action: "keydown.esc@document->hotkey#click" } do %> diff --git a/app/views/collections/columns/not_nows/show.html.erb b/app/views/collections/columns/not_nows/show.html.erb index 506d164cf..b9e0cfba2 100644 --- a/app/views/collections/columns/not_nows/show.html.erb +++ b/app/views/collections/columns/not_nows/show.html.erb @@ -1,7 +1,7 @@ <% @page_title = "Column: Now now" %> <% content_for :header do %> - <%= render "filters/menu", user_filtering: @user_filtering %> + <%= render "filters/menu" %>
<%= link_to @collection, class: "btn borderless txt-medium", data: { controller: "hotkey", action: "keydown.esc@document->hotkey#click" } do %> diff --git a/app/views/collections/columns/show.html.erb b/app/views/collections/columns/show.html.erb index 709c5221e..39090bdd0 100644 --- a/app/views/collections/columns/show.html.erb +++ b/app/views/collections/columns/show.html.erb @@ -1,7 +1,7 @@ <% @page_title = "Column: #{ @column.name }" %> <% content_for :header do %> - <%= render "filters/menu", user_filtering: @user_filtering %> + <%= render "filters/menu" %>
<%= link_to @column.collection, class: "btn borderless txt-medium", data: { controller: "hotkey", action: "keydown.esc@document->hotkey#click" } do %> diff --git a/app/views/collections/columns/streams/show.html.erb b/app/views/collections/columns/streams/show.html.erb index 0758168a5..f56aeb048 100644 --- a/app/views/collections/columns/streams/show.html.erb +++ b/app/views/collections/columns/streams/show.html.erb @@ -1,7 +1,7 @@ <% @page_title = "Column: The Stream" %> <% content_for :header do %> - <%= render "filters/menu", user_filtering: @user_filtering %> + <%= render "filters/menu" %>
<%= link_to @collection, class: "btn borderless txt-medium", data: { controller: "hotkey", action: "keydown.esc@document->hotkey#click" } do %> diff --git a/app/views/collections/edit.html.erb b/app/views/collections/edit.html.erb index f565cc972..df0d6dc79 100644 --- a/app/views/collections/edit.html.erb +++ b/app/views/collections/edit.html.erb @@ -1,7 +1,7 @@ <% @page_title = "Collection Settings" %> <% content_for :header do %> - <%= render "filters/menu", user_filtering: @user_filtering %> + <%= render "filters/menu" %>
<%= link_to @collection, class: "btn borderless txt-medium", data: { controller: "hotkey", action: "keydown.esc@document->hotkey#click" } do %> diff --git a/app/views/collections/new.html.erb b/app/views/collections/new.html.erb index 39ca1937f..ba9f1151f 100644 --- a/app/views/collections/new.html.erb +++ b/app/views/collections/new.html.erb @@ -1,7 +1,7 @@ <% @page_title = "Create a new collection" %> <% content_for :header do %> - <%= render "filters/menu", user_filtering: @user_filtering %> + <%= render "filters/menu" %> <% end %>
diff --git a/app/views/collections/show.html.erb b/app/views/collections/show.html.erb index 96392f1d2..c89e70976 100644 --- a/app/views/collections/show.html.erb +++ b/app/views/collections/show.html.erb @@ -10,7 +10,7 @@ <% end %> <% content_for :header do %> - <%= render "filters/menu", user_filtering: @user_filtering %> + <%= render "filters/menu" %>
<%= render "cards/webhooks", collection: @collection if Current.user.admin? %> diff --git a/app/views/events/index.html.erb b/app/views/events/index.html.erb index 8acc92214..d6a777d40 100644 --- a/app/views/events/index.html.erb +++ b/app/views/events/index.html.erb @@ -4,7 +4,7 @@ <%= render "filters/broadcasts", filter: @filter %> <% content_for :header do %> - <%= render "filters/menu", user_filtering: @user_filtering %> + <%= render "filters/menu" %> <%= render "events/index/add_card_button", user_filtering: @user_filtering %>

diff --git a/app/views/filters/_menu.html.erb b/app/views/filters/_menu.html.erb index a117bdfa7..ae4a3443b 100644 --- a/app/views/filters/_menu.html.erb +++ b/app/views/filters/_menu.html.erb @@ -8,6 +8,6 @@ dialog_target: "dialog", navigable_list_focus_on_selection_value: false, navigable_list_actionable_items_value: true } do %> - <%= turbo_frame_tag "my_menu", src: my_menu_path(enable_collection_filtering: user_filtering.supports_collection_filtering?, **user_filtering.filter.as_params), target: "_top" %> + <%= turbo_frame_tag "my_menu", src: my_menu_path, target: "_top" %> <% end %> diff --git a/app/views/filters/menu/_collections.html.erb b/app/views/filters/menu/_collections.html.erb index c9298093e..f6dfad1ec 100644 --- a/app/views/filters/menu/_collections.html.erb +++ b/app/views/filters/menu/_collections.html.erb @@ -1,10 +1,7 @@ <% # Using method: :get inside Turbo frame triggers some special Turbo handling where the script_name is lost %> -<%= form_with url: user_filtering.self_filter_path(script_name: Account.sole.slug), method: :get, class: "display-contents", - data: { controller: "form" } do |form| %> - <% if user_filtering.collections.any? %> - <%= collapsible_nav_section "Collections" do %> - <%= render "filters/menu/collections/all_option", form: form, user_filtering: user_filtering %> - <%= render partial: "filters/menu/collections/collection", collection: user_filtering.collections, as: :collection, locals: { form: form, user_filtering: user_filtering } %> - <% end %> +<% if user_filtering.collections.any? %> + <%= collapsible_nav_section "Collections" do %> + <%= render "filters/menu/collections/all_option", user_filtering: user_filtering %> + <%= render partial: "filters/menu/collections/collection", collection: user_filtering.collections, as: :collection %> <% end %> <% end %> diff --git a/app/views/filters/menu/collections/_all_option.html.erb b/app/views/filters/menu/collections/_all_option.html.erb index 8ee95a795..e5a682b9b 100644 --- a/app/views/filters/menu/collections/_all_option.html.erb +++ b/app/views/filters/menu/collections/_all_option.html.erb @@ -1,5 +1,3 @@ -<% clear_url_path = user_filtering.self_filter_path(user_filtering.as_params.except(:collection_ids), script_name: request.script_name) %> - <% if Current.user.collections.many? %>