Commit Graph

97 Commits

Author SHA1 Message Date
Kevin McConnell 4216b1123e Formatting 2025-03-18 17:53:32 +00:00
Kevin McConnell bc5e32e737 Only "published" notifies collection subscribers
The other notifications are only sent to the watchers of the bubble.
2025-03-18 17:46:57 +00:00
Jason Zimdars 28a569c49b Tickets 2025-03-17 21:24:08 -05:00
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 bb2a2c618b Don't lose formatting in draft comment
When displaying a bubble in the `creating` state, we were wrongly using
the plaintext version of the draft comment. This has the effect of
losing formatting whenever the page is saved and reloaded.
2025-02-28 12:43:22 +00:00
Kevin McConnell 55464f39a2 Don't duplicate notifications on publish
We're already sending everyone the "published" notification, and for
assignees that will include the assignment message. Tracking the event
again here would just duplicate that.
2025-02-27 16:37:53 +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 a238f504e4 Don't create initial watches
We have subscriptions instead now. Watches need only be created as
necessary to override the defaults.
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 694783e5f3 Allow toggling watch preference
We use a true/false preference so we can tell the difference between
disabling the watch vs never having the watch. This is so we can toggle
off and on the preferences for a container (like the bucket) without
losing any bubble-specific preferences.
2025-02-26 10:53:03 +00:00
Kevin McConnell 59144ad17a Add Watches to track notification preferences 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 e72c89781f Ensure auto_pop_at it set before saving 2025-02-12 13:36:57 +00:00
Kevin McConnell 2b7074f24d Clearer name 2025-02-12 13:28:47 +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 bb5c767111 Recover recently-deleted bubbles 2025-02-11 14:34:39 +00:00
Kevin McConnell 469dbd0ba5 Don't track assignment notifications until publishing 2025-02-11 14:34:39 +00:00
Kevin McConnell b347d77f4d Add a new "creating" state 2025-02-11 14:34:39 +00:00
Jason Zimdars 83d1c7055b Trim color palette 2025-01-31 09:59:05 -06:00
Jason Zimdars 5e9c65c4ff Merge branch 'main' into latest-activity
* main:
  Add a new, more cheerful default color
  Apparently Safari supports hyphens inside textareas
2025-01-27 17:19:42 -06:00
Jason Zimdars dd08991104 Add a new, more cheerful default color 2025-01-27 17:18:59 -06:00
Jason Zimdars 881e1d07fc Merge branch 'main' into latest-activity
* main: (27 commits)
  Leave some space for the tray
  Let's not assume it's a due date
  Avoid overlap
  Let's try without the big drag button, extend beyond the column a touch
  Tighten labels
  Match notification dot
  Spacing
  Add more context
  Avoid leaving the tray open
  This shouldn't be here
  Paginate the read notifications
  Add a test case
  Split up a big view
  Allow filtering by stage
  Send beacon request on disconnect as well
  Wire up notifications "Mark all as read" button
  Add unread dot
  Set state for when there are no new notifications
  Move to right side, smooth transition
  Open tray on click, stub mark-as-read button
  ...
2025-01-24 15:07:17 -06:00
Kevin McConnell 85d5f7d7d7 Allow filtering by stage 2025-01-24 10:28:12 +00:00
Kevin McConnell e6fe7f680d Associate Event with Bubble
It's kind of a long way to get from one to the other right now. Every
event belongs to a bubble, so let's link them directly.
2025-01-17 14:40:36 +00:00
Kevin McConnell 782259a678 Events should track published now
Previously when an item was `created`, we'd track the event, update the
summary text, and broadcast the notifications. But now that we have a
draft state, we shold do all of this when it's published instead.
2025-01-15 10:58:00 +00:00
Kevin McConnell cd1e6378d0 Add drafted and published states 2025-01-15 10:58:00 +00:00
Kevin McConnell 196575c0a2 Use a job to generate notifications 2025-01-13 14:21:47 +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 58d5ed07a5 Create notifications when tracking events 2025-01-13 14:21:47 +00:00
Kevin McConnell a082eb75f5 Track events for new comments too 2025-01-13 14:21:47 +00:00
Kevin McConnell 22be073a92 Sanitize search terms 2025-01-08 16:49:40 +00:00
Jason Zimdars 0b28a18c05 Rework boosts form so you can enter any integer 2024-12-13 16:54:11 -06:00
Jose Farias 3e1b2c74e4 Make one-way assignment and tagging methods private 2024-11-25 17:55:25 -06:00
Jose Farias a9f845ed47 Assigner is always Current.user 2024-11-25 17:51:20 -06:00
Jose Farias 5e09f5a9b9 Remove swapping 2024-11-25 16:17:44 -06:00
Jose Farias f266e46b57 Wire up comboboxes 2024-11-21 19:58:21 -06:00
Jose Farias e117f4e5af boost_count -> boosts_count
This aligns better with counter_cache conventions, in case we turn boosts into a model later
2024-11-19 14:22:51 -06:00
Jose Farias 9ac136bace Rescore bubble from Message, not Comment 2024-11-19 13:27:09 -06:00
Jose Farias f17b060906 Move rescoring concerns to bubble 2024-11-15 19:48:53 -06:00
Jose Farias b4e8adca47 Pre-calculate comment counts and activity scores 2024-11-15 18:17:42 -06:00
Jose Farias 458a6a1ac2 Wire up assigner filters 2024-11-13 13:34:51 -06:00
Jose Farias f2706d0f74 Unnest bubble filters 2024-11-05 13:04:05 -06:00
Jose Farias 2f7baaff29 create -> create! 2024-10-28 10:47:49 -06:00
Jose Farias 404755c9d9 Clean up Bubble#track_event 2024-10-28 10:20:39 -06:00