Activity log loads as you scroll

The activity log stopped at 200 events. It now loads 50 at a time, the
next page coming in a lazy frame as it scrolls into view (as Oil & Fuel
does), keeping the category filter.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
rickyandClaude Opus 5.5 committed 2026-11-15 13:15:33 -05:00
1 parent e4c27c6ff7
commit 2e8d789975
5 files changed
+60 -3

No files matched your search

+13
View File
@@ -0,0 +1,13 @@
<%# One page of the activity log, in its own frame; a lazy frame after it
loads the next page when it scrolls into view. Links open in the whole page. %>
<%= turbo_frame_tag "events-#{page}", target: "_top", class: ["block", ("border-t border-slate-100" if page > 1)] do %>
<%= render "events/list", events: events, full: true %>
<% if more %>
<% next_page = aircraft_events_path(@aircraft, category: category, page: page + 1) %>
<%= turbo_frame_tag "events-#{page + 1}", src: next_page, loading: :lazy, target: "_top", class: "block border-t border-slate-100" do %>
<p class="px-4 py-4 text-center text-sm text-slate-500">
<%= t(".loading_earlier_activity_html", link: (link_to t(".load_more"), next_page, class: "link", data: { turbo_frame: "events-#{page + 1}" })) %>
</p>
<% end %>
<% end %>
<% end %>
+1 -1
View File
@@ -10,5 +10,5 @@
<% end %>
</div>
</div>
<%= render "events/list", events: @events, full: true %>
<%= render "events/page", events: @events, page: @page, more: @more, category: @category %>
</section>