From 3199c9b76d9a8adf2db3d608b04a0f66169fe563 Mon Sep 17 00:00:00 2001 From: Copilot <198982749+Copilot@users.noreply.github.com> Date: Sun, 19 Apr 2026 18:40:50 +0200 Subject: [PATCH] Prevent long category labels from overflowing or crowding adjacent controls (#1498) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Initial plan * Fix category delete dialog dropdown overflow Agent-Logs-Url: https://github.com/we-promise/sure/sessions/200da7a4-fd59-4ae4-a709-f631ccf21e8c Co-authored-by: jjmata <187772+jjmata@users.noreply.github.com> * Tighten category deletion regression test Agent-Logs-Url: https://github.com/we-promise/sure/sessions/200da7a4-fd59-4ae4-a709-f631ccf21e8c Co-authored-by: jjmata <187772+jjmata@users.noreply.github.com> * Fix deletion button text overflow Agent-Logs-Url: https://github.com/we-promise/sure/sessions/e802e01f-079e-4322-ba03-b222ab5d4b84 Co-authored-by: jjmata <187772+jjmata@users.noreply.github.com> * Preserve category menu spacing on mobile Agent-Logs-Url: https://github.com/we-promise/sure/sessions/74b5dd1e-7935-4356-806a-759bff911930 Co-authored-by: jjmata <187772+jjmata@users.noreply.github.com> * Prevent account activity label overlap on mobile Agent-Logs-Url: https://github.com/we-promise/sure/sessions/e94027d6-e230-44c8-99a1-6e5645bec82b Co-authored-by: jjmata <187772+jjmata@users.noreply.github.com> * Fix wide account activity category overflow Agent-Logs-Url: https://github.com/we-promise/sure/sessions/4ad79894-2935-47a3-8d37-037e2bd14376 Co-authored-by: jjmata <187772+jjmata@users.noreply.github.com> * Linter * Fix flaky system tests in CI Agent-Logs-Url: https://github.com/we-promise/sure/sessions/3507447f-363f-4759-807c-c62a2858d270 Co-authored-by: jjmata <187772+jjmata@users.noreply.github.com> * Reset system test viewport between tests Agent-Logs-Url: https://github.com/we-promise/sure/sessions/357a43b1-11c5-49be-972d-0592a37d97b1 Co-authored-by: jjmata <187772+jjmata@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: jjmata <187772+jjmata@users.noreply.github.com> Co-authored-by: Juan José Mata --- app/components/DS/button.html.erb | 2 +- app/views/categories/_badge.html.erb | 10 ++- app/views/categories/_category.html.erb | 6 +- .../categories/_category_name_mobile.html.erb | 2 +- app/views/categories/_menu.html.erb | 4 +- app/views/transactions/_transaction.html.erb | 6 +- .../_transaction_category.html.erb | 2 +- test/application_system_test_case.rb | 14 ++++ test/controllers/accounts_controller_test.rb | 25 ++++++ .../controllers/categories_controller_test.rb | 4 + .../category/deletions_controller_test.rb | 3 + .../coinstats_items_controller_test.rb | 4 +- test/system/account_activity_test.rb | 77 ++++++++++++++++++- test/system/categories_test.rb | 19 +++++ test/system/property_test.rb | 6 +- test/test_helper.rb | 6 ++ 16 files changed, 166 insertions(+), 24 deletions(-) diff --git a/app/components/DS/button.html.erb b/app/components/DS/button.html.erb index 0b69c4649..557db0bd9 100644 --- a/app/components/DS/button.html.erb +++ b/app/components/DS/button.html.erb @@ -4,7 +4,7 @@ <% end %> <% unless icon_only? %> - <%= text %> + <%= text %> <% end %> <% if icon && icon_position == :right %> diff --git a/app/views/categories/_badge.html.erb b/app/views/categories/_badge.html.erb index 10135c251..5570f2c70 100644 --- a/app/views/categories/_badge.html.erb +++ b/app/views/categories/_badge.html.erb @@ -1,15 +1,17 @@ <%# locals: (category:) %> <% category ||= Category.uncategorized %> -
- + <% if category.lucide_icon.present? %> - <%= icon category.lucide_icon, size: "sm", color: "current" %> + + <%= icon category.lucide_icon, size: "sm", color: "current" %> + <% end %> - <%= category.name %> + <%= category.name %>
diff --git a/app/views/categories/_category.html.erb b/app/views/categories/_category.html.erb index dbc9b80fe..1460fe5d6 100644 --- a/app/views/categories/_category.html.erb +++ b/app/views/categories/_category.html.erb @@ -1,7 +1,7 @@ <%# locals: (category:) %> -
<%= "pb-4" unless category.subcategories.any? %> bg-container"> -
+
<%= "pb-4" unless category.subcategories.any? %> bg-container"> +
<% if category.subcategory? %> <%= icon "corner-down-right", size: "sm", color: "current", class: "ml-2" %> @@ -11,7 +11,7 @@ <%= render partial: "categories/badge", locals: { category: category } %>
-
+
<%= render DS::Menu.new do |menu| %> <% menu.with_item(variant: "link", text: t(".edit"), icon: "pencil", href: edit_category_path(category), data: { turbo_frame: :modal }) %> diff --git a/app/views/categories/_category_name_mobile.html.erb b/app/views/categories/_category_name_mobile.html.erb index 2f9bd07cb..36c13021c 100644 --- a/app/views/categories/_category_name_mobile.html.erb +++ b/app/views/categories/_category_name_mobile.html.erb @@ -1,4 +1,4 @@ - + <% if transaction.transfer&.categorizable? || transaction.transfer.nil? %> <%= transaction.category&.name || Category.uncategorized.name %> <% else %> diff --git a/app/views/categories/_menu.html.erb b/app/views/categories/_menu.html.erb index ad7dc4f5c..6af5a8ce8 100644 --- a/app/views/categories/_menu.html.erb +++ b/app/views/categories/_menu.html.erb @@ -1,8 +1,8 @@ <%# locals: (transaction:) %> <%= render DS::Menu.new(variant: "button") do |menu| %> - <% menu.with_button do %> -