From 97f2f677d600e8661c560409a156f464469cba85 Mon Sep 17 00:00:00 2001 From: Adrien Maston Date: Thu, 19 Feb 2026 14:04:14 +0100 Subject: [PATCH] Don't render empty state instead of hiding it --- app/assets/stylesheets/search.css | 5 ----- app/controllers/searches_controller.rb | 4 ++-- app/views/searches/_results.html.erb | 2 +- app/views/searches/show.html.erb | 6 +++--- 4 files changed, 6 insertions(+), 11 deletions(-) diff --git a/app/assets/stylesheets/search.css b/app/assets/stylesheets/search.css index 32dec66b3..5691ac5e5 100644 --- a/app/assets/stylesheets/search.css +++ b/app/assets/stylesheets/search.css @@ -129,9 +129,4 @@ summary { padding-inline: 0; } } - .search-perma--empty { - .search { - display: none; - } - } } diff --git a/app/controllers/searches_controller.rb b/app/controllers/searches_controller.rb index e968edbc3..b849f04f1 100644 --- a/app/controllers/searches_controller.rb +++ b/app/controllers/searches_controller.rb @@ -3,10 +3,10 @@ class SearchesController < ApplicationController def show @query = params[:q].blank? ? nil : params[:q] - if card = Current.user.accessible_cards.find_by_id(params[:q]) + if card = Current.user.accessible_cards.find_by_id(@query) @card = card else - set_page_and_extract_portion_from Current.user.search(params[:q]) + set_page_and_extract_portion_from Current.user.search(@query) @recent_search_queries = Current.user.search_queries.order(updated_at: :desc).limit(10) end end diff --git a/app/views/searches/_results.html.erb b/app/views/searches/_results.html.erb index 0b622e95d..573d20397 100644 --- a/app/views/searches/_results.html.erb +++ b/app/views/searches/_results.html.erb @@ -1,6 +1,6 @@