16a80ff3a6
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.
54 lines
2.3 KiB
Plaintext
54 lines
2.3 KiB
Plaintext
<% @page_title = @filter.summary %>
|
|
|
|
<% turbo_refreshes_with method: :morph, scroll: :preserve %>
|
|
<%= render "filters/broadcasts", filter: @filter %>
|
|
|
|
<% content_for :header do %>
|
|
<nav class="align-start">
|
|
<% if bucket = @filter.buckets.first %>
|
|
<%= link_to edit_bucket_path(bucket), class: "btn borderless flex-item-justify-start" do %>
|
|
<%= image_tag "settings.svg", aria: { hidden: true }, size: 24 %>
|
|
<span class="for-screen-reader">Settings for <%= bucket.name %></span>
|
|
<% end %>
|
|
<% end %>
|
|
|
|
<header class="flex flex-column center">
|
|
<div class="flex align-center gap-half justify-center">
|
|
<%= link_to "Collections", root_path %>
|
|
<%= link_to "Activity", events_path %>
|
|
</div>
|
|
<%= render "bubbles/filters", filter: @filter %>
|
|
</header>
|
|
|
|
<% if bucket = @filter.buckets.first %>
|
|
<%= button_to bucket_bubbles_path(bucket), method: :post, class: "btn borderless", form_class: "flex-item-justify-end" do %>
|
|
<%= image_tag "add.svg", aria: { hidden: true }, size: 24 %>
|
|
<span class="for-screen-reader">Create a new bubble</span>
|
|
<% end %>
|
|
<% end %>
|
|
</nav>
|
|
<% end %>
|
|
|
|
<section class="bubbles flex-inline flex-wrap gap justify-center align-end" style="view-transition-name: bubbles_<%= @filter.id %>" data-controller="bubble-size" data-action="turbo:morph@window->bubble-size#resize">
|
|
<% if @bubbles.any? %>
|
|
<%= render partial: "bubbles/bubble", collection: @bubbles.limit(10), cached: true %>
|
|
<% else %>
|
|
<p><strong>Nothing here.</strong></p>
|
|
<% end %>
|
|
</section>
|
|
|
|
<section class="bubbles-list unpad-inline center margin-block-start">
|
|
<ul class="unpad margin-none flex flex-column txt-align-start center"
|
|
data-controller="divider"
|
|
data-divider-start-count-value="10"
|
|
data-divider-max-count-value="10"
|
|
data-divider-installed-class="bubbles-list__divider--installed"
|
|
data-divider-dragging-class="dragging"
|
|
data-action="turbo:morph@document->divider#install dragstart->divider#configureDrag dragenter->divider#acceptDrop dragover->divider#acceptDrop dragover->divider#moveDivider drop->divider#drop">
|
|
<%= render partial: "bubbles/list/bubble", collection: @bubbles, cached: true %>
|
|
<%= render "bubbles/list/divider", filter: @filter %>
|
|
</ul>
|
|
</section>
|
|
|
|
<%= render "notifications/tray" %>
|