The previous implementation would delete all accesses if the bucket
was not all_access.
I think it's simpler to move the bucket workflow into a separate
Buckets::WorkflowsController, rather than deal with different sets of
params from different forms in the existing BucketsController.
- Rearrange the _tags and _tag partial, so they are properly nested concerns
- Add turbo frames for _tags and _tag
- Load _tag in a separate request, so it's not cached with the card
- Cache _tag using the bubble and the account
- New model behavior: touch Account when tags are added or removed
- New controller action: "new" for taggings toggles, which renders the _tag partial
- Updating taggings responds with a turbo stream response that updates the _tags frame
This is very much a parallel change to what was done with assignments
in #317.
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>
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.
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.
This test would fail when the two timezones is covers landed on
different days (like in the first few hours of UTC). So let's fix the
test to a particular moment in time.