Skip to content

Commit 760cbb6

Browse files
committed
Drop boosts
Killed by design.
1 parent 1b732c4 commit 760cbb6

27 files changed

+23
-299
lines changed

app/assets/stylesheets/cards.css

Lines changed: 0 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -471,37 +471,6 @@
471471
}
472472
}
473473

474-
.input.boost__input {
475-
--hover-size: 0;
476-
--input-border-radius: 0;
477-
--input-border-size: 0;
478-
--input-padding: 0;
479-
--outline-size: 0;
480-
481-
color: inherit;
482-
font-size: inherit;
483-
font-weight: inherit;
484-
inline-size: min-content;
485-
max-inline-size: 3ch;
486-
min-inline-size: 1ch;
487-
outline: none;
488-
489-
@supports (field-sizing: content) {
490-
field-sizing: content;
491-
max-inline-size: unset;
492-
}
493-
494-
&:focus {
495-
background-color: var(--color-highlight);
496-
}
497-
498-
&::-webkit-outer-spin-button,
499-
&::-webkit-inner-spin-button {
500-
-webkit-appearance: none;
501-
margin: 0;
502-
}
503-
}
504-
505474
.card__closed {
506475
align-items: center;
507476
aspect-ratio: 7/4;

app/controllers/cards/boosts_controller.rb

Lines changed: 0 additions & 12 deletions
This file was deleted.

app/controllers/concerns/events_timeline.rb

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -19,13 +19,9 @@ def set_activity_day
1919
end
2020

2121
def events_for_activity_day
22-
user_events.where(created_at: @activity_day.all_day).
23-
group_by { |event| [ event.created_at.hour, helpers.event_column(event) ] }.
24-
map { |hour_col, events|
25-
[ hour_col,
26-
events.uniq { |e| e.action == "boosted" ? [ e.creator_id, e.card_id ] : e.id }
27-
]
28-
}
22+
user_events.where(created_at: @activity_day.all_day)
23+
.group_by { |event| [ event.created_at.hour, helpers.event_column(event) ] }
24+
.map { |hour_col, events| [ hour_col, events.uniq { |e| e.id } ] }
2925
end
3026

3127
def latest_event_before_activity_day
@@ -38,7 +34,7 @@ def user_events
3834

3935
def user_cards
4036
Current.user.accessible_cards
41-
.published_or_drafted_by(Current.user)
42-
.where(collection_id: collection_filter)
37+
.published_or_drafted_by(Current.user)
38+
.where(collection_id: collection_filter)
4339
end
4440
end

app/helpers/events_helper.rb

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -72,8 +72,6 @@ def event_action_sentence(event)
7272
end
7373
when "unassigned"
7474
"#{ event.creator == Current.user ? "You" : event.creator.name } unassigned #{ event.assignees.include?(Current.user) ? "yourself" : event.assignees.pluck(:name).to_sentence } from <span style='color: var(--card-color)'>#{ card_title(event.card) }</span>".html_safe
75-
when "boosted"
76-
"#{ event.creator == Current.user ? "You" : event.creator.name } boosted <span style='color: var(--card-color)'>#{ card_title(event.card) }</span>".html_safe
7775
when "commented"
7876
"#{ event.creator == Current.user ? "You" : event.creator.name } commented on <span style='color: var(--card-color)'>#{ card_title(event.card) }</span>".html_safe
7977
when "published"
@@ -99,8 +97,6 @@ def event_action_icon(event)
9997
case event.action
10098
when "assigned"
10199
"assigned"
102-
when "boosted"
103-
"thumb-up"
104100
when "staged"
105101
"bolt"
106102
when "unstaged"

app/models/card.rb

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
class Card < ApplicationRecord
2-
include Assignable, Boostable, Colored, DraftCommenting, Engageable, Eventable, Golden,
2+
include Assignable, Colored, DraftCommenting, Engageable, Eventable, Golden,
33
Messages, Notifiable, Pinnable, Closeable, Scorable, Searchable, Staged,
44
Statuses, Taggable, Watchable
55

@@ -22,7 +22,6 @@ class Card < ApplicationRecord
2222
scope :indexed_by, ->(index) do
2323
case index
2424
when "most_active" then ordered_by_activity
25-
when "most_boosted" then ordered_by_boosts
2625
when "newest" then reverse_chronologically
2726
when "oldest" then chronologically
2827
when "latest" then latest

app/models/card/boostable.rb

Lines changed: 0 additions & 18 deletions
This file was deleted.

app/models/card/scorable.rb

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,6 @@ def event_score(event)
3636

3737
def event_weight(event)
3838
case
39-
when event.boosted? then 1
4039
when event.comment&.first_by_author_on_card? then 20
4140
when event.comment&.follows_comment_by_another_author? then 15
4241
when event.commented? then 10
@@ -60,6 +59,6 @@ def last_scorable_activity_at
6059
end
6160

6261
def scorable_events
63-
events.where(action: [ :commented, :boosted ])
62+
events.where(action: :commented)
6463
end
6564
end

app/models/event.rb

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,15 +9,9 @@ class Event < ApplicationRecord
99
has_one :comment, through: :message, source: :messageable, source_type: "Comment"
1010

1111
scope :chronologically, -> { order created_at: :asc, id: :desc }
12-
scope :non_boosts, -> { where.not action: :boosted }
13-
scope :boosts, -> { where action: :boosted }
1412

1513
after_create -> { card.touch_last_active_at }
1614

17-
def boosted?
18-
action == "boosted"
19-
end
20-
2115
def commented?
2216
action == "commented"
2317
end

app/models/event_summary.rb

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -5,16 +5,12 @@ class EventSummary < ApplicationRecord
55

66
# FIXME: Consider persisting the body and compute at write time.
77
def body
8-
"#{main_summary} #{boosts_summary}".squish
8+
events.map { |event| summarize(event) }.join(" ")
99
end
1010

1111
private
1212
delegate :time_ago_in_words, to: "ApplicationController.helpers"
1313

14-
def main_summary
15-
events.non_boosts.map { |event| summarize(event) }.join(" ")
16-
end
17-
1814
def summarize(event)
1915
case event.action
2016
when "published"
@@ -39,12 +35,4 @@ def summarize(event)
3935
"#{event.creator.name} changed title from '#{event.particulars.dig('particulars', 'old_title')}' to '#{event.particulars.dig('particulars', 'new_title')}'."
4036
end
4137
end
42-
43-
def boosts_summary
44-
if tally = events.boosts.group(:creator).count.presence
45-
tally.map do |creator, count|
46-
"#{creator.name} +#{count}"
47-
end.to_sentence + "."
48-
end
49-
end
5038
end

app/models/filter/fields.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
module Filter::Fields
22
extend ActiveSupport::Concern
33

4-
INDEXES = %w[ most_boosted newest oldest latest stalled ]
4+
INDEXES = %w[ newest oldest latest stalled ]
55

66
delegate :default_value?, to: :class
77

0 commit comments

Comments
 (0)