Skip to content

JM: Load admin home badge counts in one request - #2847

Open
maebeale wants to merge 2 commits into
mainfrom
maebeale/admin-index-lazy-load
Open

maebeale wants to merge 2 commits into
mainfrom
maebeale/admin-index-lazy-load

Conversation

@maebeale

@maebeale maebeale commented Oct 25, 2026 •

Copy link
Copy Markdown
Collaborator

🤖 suggested review level: 3 Read 📖 small controller/view change to admin home badges

Clicks on admin home lagged until the action-button counts finished loading — now the counts load in one background request, so navigation stays snappy.

  • Cause — Puma runs 3 threads; the 3 lazy badge frames each took one.
    • The admin's next click queued behind them.
    • Author credit count is the slow one: it loads all content from 8 models into Ruby.
  • Fix — one badge_counts frame whose response updates all three badges with inline turbo streams.
    • Same pattern as admin/ahoy_activities/visit_results.
    • A failing count still leaves only its own badge empty.
  • Not done (possible follow-up) — caching the counts.
    • Would make repeat visits instant, but badges could go stale after a repair.

Features seed (optional)

  • Added a features seed (optional)

🤖 Generated with Claude Code

maebeale and others added 2 commits October 25, 2026 08:58
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Each badge was its own lazy frame, so opening admin home fired three slow
count requests at once. Puma runs three threads, so they filled every thread
and the admin's next click queued behind them until the counts finished.
One frame request holds a single thread and leaves the rest free for
navigation.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@maebeale
maebeale marked this pull request as ready for review October 25, 2026 13:09
@maebeale
maebeale requested a review from jmilljr24 October 25, 2026 14:15
@maebeale maebeale changed the title Load admin home badge counts in one request JM: Load admin home badge counts in one request Oct 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant