From 9f561188b81d99b2a5092208389ed88ad848a912 Mon Sep 17 00:00:00 2001 From: Dhamari Trice-Hanson <39872667+dhamariT@users.noreply.github.com> Date: Thu, 25 Jun 2026 12:18:49 -0400 Subject: [PATCH 1/2] Add a Hackpad filter to the funding review queue MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Reviewers can now narrow the funding queue to Hackpad projects — those whose current (active) mission is the Hackpad mission. Adds a 'Project' filter select (All projects / Hackpad) alongside the existing status/sort/date filters, wired to scope funding requests by the project's active hackpad mission attachment. --- .../certification/funding_requests_controller.rb | 12 ++++++++++++ .../certification/funding_requests/index.html.erb | 7 +++++++ 2 files changed, 19 insertions(+) diff --git a/app/controllers/admin/certification/funding_requests_controller.rb b/app/controllers/admin/certification/funding_requests_controller.rb index 441a42dd6..f7f1b2c2c 100644 --- a/app/controllers/admin/certification/funding_requests_controller.rb +++ b/app/controllers/admin/certification/funding_requests_controller.rb @@ -10,6 +10,7 @@ def index @status = params[:status].presence_in(%w[pending approved returned all]) || "pending" @sort = params[:sort] == "newest" ? "newest" : "oldest" @search = params[:search].to_s.strip + @project_kind = params[:project_kind].presence_in(%w[all hackpad]) || "all" @from = parse_date(params[:from]) @to = parse_date(params[:to]) @@ -19,6 +20,7 @@ def index scope = scope.where("certification_funding_requests.created_at >= ?", @from.beginning_of_day) if @from scope = scope.where("certification_funding_requests.created_at <= ?", @to.end_of_day) if @to scope = apply_search(scope) if @search.present? + scope = scope.where(project_id: hackpad_project_ids) if @project_kind == "hackpad" @pagy, @funding_requests = pagy(:offset, scope.order(created_at: @sort == "newest" ? :desc : :asc), @@ -77,6 +79,16 @@ def set_funding_request @funding_request = ::Certification::FundingRequest.find(params[:id]) end + # Project ids whose current (active, non-detached) mission is the Hackpad + # mission — i.e. "hackpad projects" (mirrors Project#current_mission, which a + # project has at most one of). Used to filter the funding queue. + def hackpad_project_ids + Project::MissionAttachment.active + .joins(:mission) + .where(missions: { slug: "hackpad" }) + .select(:project_id) + end + # Both fetches below fan out to live HTTP (per Hackatime key / Lookout session) # on every render, including the re-render after a failed verdict submit. The # provider URLs only expire after ~1h, so a short cache keyed by project kills diff --git a/app/views/admin/certification/funding_requests/index.html.erb b/app/views/admin/certification/funding_requests/index.html.erb index 19b9360ef..984ba0dfe 100644 --- a/app/views/admin/certification/funding_requests/index.html.erb +++ b/app/views/admin/certification/funding_requests/index.html.erb @@ -147,6 +147,13 @@ id: "filter-status", class: "ship-queue__select", data: { action: "change->certification--queue#submit" } %> +
+ + <%= select_tag :project_kind, + options_for_select([["All projects", "all"], ["Hackpad", "hackpad"]], @project_kind), + id: "filter-project-kind", class: "ship-queue__select", + data: { action: "change->certification--queue#submit" } %> +
<%= select_tag :sort, From 228e53fae6a734c13fe922c56b1a6887234eb326 Mon Sep 17 00:00:00 2001 From: Dhamari Trice-Hanson <39872667+dhamariT@users.noreply.github.com> Date: Thu, 25 Jun 2026 12:32:31 -0400 Subject: [PATCH 2/2] Flag Hackpad projects with a pill in the funding queue rows Shows a 'Hackpad' pill next to the project title in the funding queue (table and mobile card) for projects whose current mission is Hackpad. The displayed rows' hackpad project ids are loaded in one query to avoid an N+1. --- .../pages/certification/ships/_index.scss | 16 ++++++++++++++++ .../certification/funding_requests_controller.rb | 7 +++++++ .../funding_requests/index.html.erb | 10 +++++++++- 3 files changed, 32 insertions(+), 1 deletion(-) diff --git a/app/assets/stylesheets/pages/certification/ships/_index.scss b/app/assets/stylesheets/pages/certification/ships/_index.scss index 8b892b8ed..f6cf6ef24 100644 --- a/app/assets/stylesheets/pages/certification/ships/_index.scss +++ b/app/assets/stylesheets/pages/certification/ships/_index.scss @@ -507,6 +507,22 @@ gap: var(--space-xs); } + // Category tag on a queue row (e.g. Hackpad) — a pill, not a status. + &__tag { + display: inline-flex; + align-items: center; + padding: 1px 8px; + border-radius: 999px; + font-size: 0.72rem; + font-weight: 700; + white-space: nowrap; + + &--hackpad { + background: rgba(235, 183, 255, 0.18); + color: var(--color-brand-lilac); + } + } + // Submitter, relative age, and the claim flag all share one meta line under // the project title — keeps the table to three columns with no dead space. &__project-meta { diff --git a/app/controllers/admin/certification/funding_requests_controller.rb b/app/controllers/admin/certification/funding_requests_controller.rb index f7f1b2c2c..3e781b9a6 100644 --- a/app/controllers/admin/certification/funding_requests_controller.rb +++ b/app/controllers/admin/certification/funding_requests_controller.rb @@ -26,6 +26,13 @@ def index scope.order(created_at: @sort == "newest" ? :desc : :asc), limit: 25) + # Which of the displayed rows are Hackpad projects (one query, so the view + # can flag them without an N+1 of Project#current_mission per row). + @hackpad_project_ids = hackpad_project_ids + .where(project_id: @funding_requests.map(&:project_id)) + .pluck(:project_id) + .to_set + @stats = ::Certification::FundingRequest.dashboard_stats @lb_period = params[:lb].presence_in(%w[daily weekly alltime]) || "daily" @leaderboards = { diff --git a/app/views/admin/certification/funding_requests/index.html.erb b/app/views/admin/certification/funding_requests/index.html.erb index 984ba0dfe..633547afe 100644 --- a/app/views/admin/certification/funding_requests/index.html.erb +++ b/app/views/admin/certification/funding_requests/index.html.erb @@ -205,6 +205,9 @@
<%= link_to fr.project.title, admin_certification_funding_request_path(fr), class: "ship-queue__project-title" %> #<%= fr.id %> + <% if @hackpad_project_ids.include?(fr.project_id) %> + Hackpad + <% end %>
by <%= owner&.display_name || "—" %> @@ -235,7 +238,12 @@ <% owner = fr.project.memberships.find(&:owner?)&.user %> <%= link_to admin_certification_funding_request_path(fr), class: "ship-queue__card" do %>
- <%= fr.project.title %> + + <%= fr.project.title %> + <% if @hackpad_project_ids.include?(fr.project_id) %> + Hackpad + <% end %> + <%= fr.status.capitalize %>