Commit Graph

124 Commits

Author SHA1 Message Date
Kevin McConnell e9ae2772e4 Add tests to validate notification recipients 2025-03-18 17:46:57 +00:00
Mike Dalessio 2c87c2fb15 Update schema files and fix some trivial test failures. 2025-03-18 09:14:16 -04:00
Jason Zimdars 28a569c49b Tickets 2025-03-17 21:24:08 -05:00
Mike Dalessio 3e374f4661 fix: Send assignment notifications only to the assignee(s)
ref: https://37s.fizzy.37signals.com/buckets/693169850/bubbles/999008619
2025-03-13 12:16:47 -04: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 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 f54119f477 Add missing test 2025-02-26 10:58:56 +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 d29e999552 Make Buckets subscribable 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 2d0c9d309b All notifiers use same recipients 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
Jason Zimdars f8209a15e3 Update test 2025-02-20 16:13:27 -06:00
Kevin McConnell 88f295eee2 Provide accessor for the draft comment 2025-02-13 14:36:34 +00:00
Jason Zimdars 08fb92b526 We only need to mention buckets if scoped 2025-02-12 16:18:08 -06:00
Kevin McConnell 6f1f819ad7 Suppress notifications for system-generated events 2025-02-12 17:40:29 +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 485a056ba2 Add a "system" role & specific user 2025-02-12 13:19:53 +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 39c0a95e1a We'll handle this at the event level 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 346ecc34af Projects -> Collections 2025-02-06 16:24:05 -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 2370bd0053 Add a test case 2025-01-24 10:43:46 +00: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
Jose Farias 4441dc7cd8 Test passing params in different order 2025-01-15 16:55:57 -06:00
Jose Farias 19874dcc2a Test creating an equivalent filter with a different user 2025-01-15 16:41:25 -06:00
Jose Farias e9a085f848 Simplify filters 2025-01-15 16:27:33 -06:00
Kevin McConnell 056d853cc8 Don't notify while bubbles are still drafted 2025-01-15 11:42:35 +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 9ddb7b260b Remove empty test 2025-01-14 14:07:21 +00:00
Kevin McConnell df260840ab Simplify test 2025-01-14 13:29:39 +00:00
Kevin McConnell 78b7fe0f3d Fix tests 2025-01-14 13:21:20 +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 e67ac372d3 Fix test 2025-01-13 14:21:47 +00:00
Kevin McConnell dc53a39b93 Update notification body 2025-01-13 14:21:47 +00:00
Kevin McConnell 5a56c16029 Add a factory for creating notifications 2025-01-13 14:21:47 +00:00
Kevin McConnell d0ae5b4bdc Add notification model 2025-01-13 14:21:47 +00:00
Kevin McConnell 22be073a92 Sanitize search terms 2025-01-08 16:49:40 +00:00
Jason Zimdars 0a6b5571c0 Merge pull request #167 from basecamp/users
Account users
2024-12-19 11:11:41 -06:00
Jose Farias 5b83d0b5b2 Filter#persist! -> Filter#remember 2024-12-18 18:34:47 -06:00