Commit Graph

19 Commits

Author SHA1 Message Date
Mike Dalessio e0fa376d4f Update scoreable to return a large positive number when score==0 (#290)
Avoid infinite activity score orders

Items with a zero activity score were getting an activity sorting score
of -infinity, because we base the value on log2(score). Adjusting the
calculation avoids this edge case, by always basing the sorting score on
a non-zero number.

---------

Co-authored-by: Kevin McConnell <kevin@37signals.com>
2025-03-11 07:39:17 -04:00
Kevin McConnell 16a80ff3a6 More dynamic activity scores
This introduces a more dynamic system of activity scoring, to improve
the way bubbles "bubble up" due to their activity. There are a few
different parts we can tune here, and it's likely we'll need to make
adjustments once we get a feel for how this works in practice.

The basic idea here is:

- We assign points for certain types of event that happen on a bubble. A
  boost gets 1 point, a comment gets 10 points, and so on.
- These points decay over time, at a rate of 50% per day. So old
  activity is worth much less than new activity. Bubbles should rise up
  quickly when acted upon, bit will float back down if left idle.
- Some comments can score higher than others: the first comment from
  each person on a bubble is worth more (20) because it signals that
  more people are getting involved; and comments that follow a comment
  by a different author are also worth more (15) because that signals
  there's ongoing conversation between people, not just a series of
  notes being left by one individual.

In terms of implementation, we persist the score on the bubble
whenever it changes, but we handle the decay on the client side. That
allows us to cache the bubble representation without having to
continually change it while its activity decays.

We also keep a separate `activity_score_order` attribute on the model.
This can be used to sort the bubbles in order of "most active", without
having to think about the decay.
2025-03-05 17:16:31 +00:00
Kevin McConnell eaf4903afc Formatting 2025-02-28 11:48:29 +00:00
Kevin McConnell 93474002b7 Add test for watchers_and_subscribers 2025-02-27 16:27:12 +00:00
Kevin McConnell 84d06c7f0b Creators watch their own bubble by default 2025-02-26 10:53:03 +00:00
Kevin McConnell f22742c431 watched_by? should reflect subscriptions too 2025-02-26 10:53:03 +00:00
Kevin McConnell 6157d8b4bd Start watching when participating on a bubble
If you're added as an assignee, or if you comment, then your watching
preference will be toggled on.
2025-02-26 10:53:03 +00:00
Kevin McConnell 88f295eee2 Provide accessor for the draft comment 2025-02-13 14:36:34 +00:00
Kevin McConnell a88cbf0c41 Add test 2025-02-12 15:36:48 +00:00
Kevin McConnell dac2611c57 Auto-pop bubbles 2025-02-12 13:20:05 +00:00
Kevin McConnell bd4e475d44 Remove old abandoned bubble creations via cron 2025-02-11 14:34:39 +00:00
Kevin McConnell fd1556b298 Decision can belong to subsequently created bubble 2025-02-11 14:34:39 +00:00
Kevin McConnell 6832ba8f37 It's not just about drafts now 2025-02-11 14:34:39 +00:00
Kevin McConnell b347d77f4d Add a new "creating" state 2025-02-11 14:34:39 +00:00
Kevin McConnell cd1e6378d0 Add drafted and published states 2025-01-15 10:58:00 +00:00
Kevin McConnell 66d0f29d45 Notify on pop as well
And DRY up some duplication.
2025-01-13 14:21:47 +00:00
Kevin McConnell 22be073a92 Sanitize search terms 2025-01-08 16:49:40 +00:00
Jose Farias cf22fb454a not_popped -> active 2024-10-23 18:32:27 -06:00
Kevin McConnell e50144d97f Add modelling for "popped" bubbles 2024-10-03 12:54:13 +01:00