From 3811088db357cce26a6e3a5ec190d713fd4831d9 Mon Sep 17 00:00:00 2001 From: Mike Dalessio Date: Tue, 25 Nov 2025 13:46:14 -0500 Subject: [PATCH] Prioritize current user and assigned users in assignment dropdown MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude --- app/controllers/cards/assignments_controller.rb | 3 ++- app/views/cards/assignments/_user.html.erb | 7 +++++++ app/views/cards/assignments/new.html.erb | 12 +++--------- 3 files changed, 12 insertions(+), 10 deletions(-) create mode 100644 app/views/cards/assignments/_user.html.erb diff --git a/app/controllers/cards/assignments_controller.rb b/app/controllers/cards/assignments_controller.rb index fdd2a86dc..886537fa1 100644 --- a/app/controllers/cards/assignments_controller.rb +++ b/app/controllers/cards/assignments_controller.rb @@ -2,7 +2,8 @@ class Cards::AssignmentsController < ApplicationController include CardScoped def new - @users = @board.users.active.alphabetically + @assigned_to = @card.assignees.active.alphabetically.where.not(id: Current.user) + @users = @board.users.active.alphabetically.where.not(id: @card.assignees).where.not(id: Current.user) fresh_when etag: [ @users, @card.assignees ] end diff --git a/app/views/cards/assignments/_user.html.erb b/app/views/cards/assignments/_user.html.erb new file mode 100644 index 000000000..4dad5a9f7 --- /dev/null +++ b/app/views/cards/assignments/_user.html.erb @@ -0,0 +1,7 @@ + diff --git a/app/views/cards/assignments/new.html.erb b/app/views/cards/assignments/new.html.erb index ee7f38c2d..cb690da23 100644 --- a/app/views/cards/assignments/new.html.erb +++ b/app/views/cards/assignments/new.html.erb @@ -15,15 +15,9 @@ type: "search", autocorrect: "off", autocomplete: "off", data: { "1p-ignore": "true", filter_target: "input", action: "input->filter#filter" } %> <% end %> <% end %>