From 3a1de72efe9fcfeb5b112688f45b06f4138ff814 Mon Sep 17 00:00:00 2001 From: Christoph Haas Date: Sun, 23 Aug 2026 11:20:36 +0200 Subject: [PATCH] Add temporary show=libs inspection view Lets you browse exactly the packages that the libs section blacklist would remove on the next import, to review them visually before running it. --- app/controllers/packages_controller.rb | 4 ++++ test/controllers/packages_controller_test.rb | 10 ++++++++++ 2 files changed, 14 insertions(+) diff --git a/app/controllers/packages_controller.rb b/app/controllers/packages_controller.rb index eec639d..3be3c49 100644 --- a/app/controllers/packages_controller.rb +++ b/app/controllers/packages_controller.rb @@ -381,6 +381,10 @@ class PackagesController < ApplicationController when 'without' packages = packages.without_screenshots logger.debug 'Limiting packages to those without screenshots' + when 'libs' + # Temporary inspection view: exactly the packages that the libs + # section blacklist would remove on the next import + packages = packages.where("section ~* '/?(old)?libs$'") end packages diff --git a/test/controllers/packages_controller_test.rb b/test/controllers/packages_controller_test.rb index d72ad95..d18e81f 100644 --- a/test/controllers/packages_controller_test.rb +++ b/test/controllers/packages_controller_test.rb @@ -134,6 +134,16 @@ class PackagesControllerTest < ActionController::TestCase end end + test 'show=libs lists exactly the section-blacklist candidates' do + packages(:firefox).update_column(:section, 'libs') + packages(:vim).update_column(:section, 'editors') + + get :grid, params: { show: 'libs' } + assert_response :success + assert_select 'div', text: 'firefox', count: 1 + assert_select 'div', text: 'vim', count: 0 + end + # test 'should get thumbnail for a package and a desired version' do # # get '/thumbnail-with-version/package-5/0.1' # get thumbnail_with_version_url('package-5', '0.1')