Merge pull request #1441 from basecamp/events-daily-cut-off

Ensure there is a limit of 100 events per column per day
This commit is contained in:
David Heinemeier Hansson
2025-11-02 08:24:34 +01:00
committed by GitHub
4 changed files with 21 additions and 8 deletions
+12 -6
View File
@@ -3,24 +3,30 @@ module EventsHelper
case event_type
when "added"
events = day_timeline.events.where(action: [ "card_published", "card_reopened" ])
full_events_count = events.count
{
title: event_column_title("Added", events.count, day_timeline.day),
title: event_column_title("Added", full_events_count, day_timeline.day),
index: 1,
events: events
events: events.limit(100).load,
full_events_count: full_events_count
}
when "closed"
events = day_timeline.events.where(action: "card_closed")
full_events_count = events.count
{
title: event_column_title("Closed", events.count, day_timeline.day),
title: event_column_title("Closed", full_events_count, day_timeline.day),
index: 3,
events: events
events: events.limit(100).load,
full_events_count: full_events_count
}
else
events = day_timeline.events.where.not(action: [ "card_published", "card_closed", "card_reopened" ])
full_events_count = events.count
{
title: event_column_title("Updated", events.count, day_timeline.day),
title: event_column_title("Updated", full_events_count, day_timeline.day),
index: 2,
events: events
events: events.limit(100).load,
full_events_count: full_events_count
}
end
end
@@ -8,4 +8,8 @@
<%= local_datetime_tag events.first.created_at, class: "event__timestamp txt-small translucent" %>
<% end %>
<% end %>
<% if column[:events].count < column[:full_events_count] %>
<div class="pad-inline pad-block-half margin-block-end-half fill-highlight txt-x-small margin-inline-half border-radius">Showing the first 100 items (<%= column[:full_events_count] - column[:events].count %> are hidden)</div
<% end %>
</div>
+3
View File
@@ -62,6 +62,9 @@ if which pacman >/dev/null 2>&1; then
fi
fi
# Ensure gh-signoff is installed and up to date
step "Set up gh-signoff" bash -c "gh extension install basecamp/gh-signoff || gh extension upgrade basecamp/gh-signoff"
bundle config set --local auto_install true
step "Installing RubyGems" bundle install
+2 -2
View File
@@ -61,8 +61,8 @@ class SmokeTest < ApplicationSystemTestCase
def assert_image_figure_attachment(content_type: "image/png", caption:)
assert_figure_attachment(content_type: content_type) do
assert_selector("img[src*='/rails/active_storage']")
assert_selector "figcaption input[placeholder='#{caption}']"
assert_selector "img[src*='/rails/active_storage']", wait: 5
assert_selector "figcaption input[placeholder='#{caption}']", wait: 5
end
end
end