From 151787a86496bc64545a754d6956ea40ac383fe6 Mon Sep 17 00:00:00 2001 From: Mike Dalessio Date: Thu, 9 Apr 2026 17:13:41 -0400 Subject: [PATCH 1/2] Remove dead Tag::Attachable code and tags prompt The tags prompt was added for the Fizzy Do command system, but became dead code when commands were removed in 89af9066. The commands_prompt was cleaned up but tags_prompt was missed. Remove the Tag::Attachable concern, Prompts::TagsController, its views and route, and the tags_prompt helper. Tag still includes ActionText::Attachable directly, which is needed by the data transfer system. --- app/controllers/prompts/tags_controller.rb | 9 --------- app/helpers/rich_text_helper.rb | 4 ---- app/models/tag.rb | 2 +- app/models/tag/attachable.rb | 11 ----------- app/views/prompts/tags/_tag.html.erb | 8 -------- app/views/prompts/tags/index.html.erb | 1 - config/routes.rb | 1 - test/controllers/prompts/tags_controller_test.rb | 12 ------------ 8 files changed, 1 insertion(+), 47 deletions(-) delete mode 100644 app/controllers/prompts/tags_controller.rb delete mode 100644 app/models/tag/attachable.rb delete mode 100644 app/views/prompts/tags/_tag.html.erb delete mode 100644 app/views/prompts/tags/index.html.erb delete mode 100644 test/controllers/prompts/tags_controller_test.rb diff --git a/app/controllers/prompts/tags_controller.rb b/app/controllers/prompts/tags_controller.rb deleted file mode 100644 index 3d32a071e..000000000 --- a/app/controllers/prompts/tags_controller.rb +++ /dev/null @@ -1,9 +0,0 @@ -class Prompts::TagsController < ApplicationController - def index - @tags = Current.account.tags.all.alphabetically - - if stale? etag: @tags - render layout: false - end - end -end diff --git a/app/helpers/rich_text_helper.rb b/app/helpers/rich_text_helper.rb index c580b4507..e40fb8138 100644 --- a/app/helpers/rich_text_helper.rb +++ b/app/helpers/rich_text_helper.rb @@ -7,10 +7,6 @@ module RichTextHelper content_tag "lexxy-prompt", "", trigger: "@", src: prompts_users_path, name: "mention" end - def tags_prompt - content_tag "lexxy-prompt", "", trigger: "#", src: prompts_tags_path, name: "tag" - end - def cards_prompt content_tag "lexxy-prompt", "", trigger: "#", src: prompts_cards_path, name: "card", "insert-editable-text": true, "remote-filtering": true, "supports-space-in-searches": true end diff --git a/app/models/tag.rb b/app/models/tag.rb index 192f0b86e..d40eeea7b 100644 --- a/app/models/tag.rb +++ b/app/models/tag.rb @@ -1,5 +1,5 @@ class Tag < ApplicationRecord - include Attachable, Filterable + include ActionText::Attachable, Filterable belongs_to :account, default: -> { Current.account } has_many :taggings, dependent: :destroy diff --git a/app/models/tag/attachable.rb b/app/models/tag/attachable.rb deleted file mode 100644 index 37d95b2dd..000000000 --- a/app/models/tag/attachable.rb +++ /dev/null @@ -1,11 +0,0 @@ -module Tag::Attachable - extend ActiveSupport::Concern - - included do - include ActionText::Attachable - - def attachable_plain_text_representation(...) - "##{title}" - end - end -end diff --git a/app/views/prompts/tags/_tag.html.erb b/app/views/prompts/tags/_tag.html.erb deleted file mode 100644 index 3be999a8e..000000000 --- a/app/views/prompts/tags/_tag.html.erb +++ /dev/null @@ -1,8 +0,0 @@ - - - - diff --git a/app/views/prompts/tags/index.html.erb b/app/views/prompts/tags/index.html.erb deleted file mode 100644 index 7ff9bbb1f..000000000 --- a/app/views/prompts/tags/index.html.erb +++ /dev/null @@ -1 +0,0 @@ -<%= render partial: "prompts/tags/tag", collection: @tags %> diff --git a/config/routes.rb b/config/routes.rb index 55262e78e..d228d9001 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -190,7 +190,6 @@ Rails.application.routes.draw do namespace :prompts do resources :cards - resources :tags resources :users resources :boards do diff --git a/test/controllers/prompts/tags_controller_test.rb b/test/controllers/prompts/tags_controller_test.rb deleted file mode 100644 index 9ddea6fae..000000000 --- a/test/controllers/prompts/tags_controller_test.rb +++ /dev/null @@ -1,12 +0,0 @@ -require "test_helper" - -class Prompts::TagsControllerTest < ActionDispatch::IntegrationTest - setup do - sign_in_as :kevin - end - - test "index" do - get prompts_tags_path - assert_response :success - end -end From 975b8998ef6fc432ce553b43dab3cdb7efe3f6ff Mon Sep 17 00:00:00 2001 From: Mike Dalessio Date: Thu, 9 Apr 2026 17:17:29 -0400 Subject: [PATCH 2/2] Remove ActionText::Attachable from Tag MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Tag was never actually embedded as an action-text-attachment in persisted rich text. It was only used in the Fizzy Do command prompt input which was not stored. The data transfer tests happened to use Tag as a convenient fixture — switch them to User, which is genuinely attachable via mentions. --- app/models/tag.rb | 2 +- .../action_text/rich_text_record_set_test.rb | 14 +++++++------- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/app/models/tag.rb b/app/models/tag.rb index d40eeea7b..14d73b4c4 100644 --- a/app/models/tag.rb +++ b/app/models/tag.rb @@ -1,5 +1,5 @@ class Tag < ApplicationRecord - include ActionText::Attachable, Filterable + include Filterable belongs_to :account, default: -> { Current.account } has_many :taggings, dependent: :destroy diff --git a/test/models/account/data_transfer/action_text/rich_text_record_set_test.rb b/test/models/account/data_transfer/action_text/rich_text_record_set_test.rb index 2fe2c4b93..3bc4ee001 100644 --- a/test/models/account/data_transfer/action_text/rich_text_record_set_test.rb +++ b/test/models/account/data_transfer/action_text/rich_text_record_set_test.rb @@ -44,11 +44,11 @@ class Account::DataTransfer::ActionText::RichTextRecordSetTest < ActiveSupport:: end test "transform_body_for_import skips GIDs belonging to another account" do - victim_tag = tags(:web) + victim_user = users(:david) attacker_account = accounts(:initech) - assert_not_equal attacker_account.id, victim_tag.account_id + assert_not_equal attacker_account.id, victim_user.account_id - cross_tenant_gid = victim_tag.to_global_id.to_s + cross_tenant_gid = victim_user.to_global_id.to_s html = %() record_set = Account::DataTransfer::ActionText::RichTextRecordSet.new(attacker_account) @@ -59,11 +59,11 @@ class Account::DataTransfer::ActionText::RichTextRecordSetTest < ActiveSupport:: end test "transform_body_for_import converts GIDs belonging to the same account" do - own_tag = tags(:web) + own_user = users(:david) own_account = accounts(:"37s") - assert_equal own_account.id, own_tag.account_id + assert_equal own_account.id, own_user.account_id - same_account_gid = own_tag.to_global_id.to_s + same_account_gid = own_user.to_global_id.to_s html = %() record_set = Account::DataTransfer::ActionText::RichTextRecordSet.new(own_account) @@ -74,7 +74,7 @@ class Account::DataTransfer::ActionText::RichTextRecordSetTest < ActiveSupport:: end test "transform_body_for_import handles non-existent record GIDs gracefully" do - nonexistent_gid = "gid://fizzy/Tag/00000000000000000000000000" + nonexistent_gid = "gid://fizzy/User/00000000000000000000000000" html = %() record_set = Account::DataTransfer::ActionText::RichTextRecordSet.new(accounts(:"37s"))