Repository source: docs/plans/backlog/forte_activity_instant_loading_step4_implementation_summary.md
Forte Activity Instant Loading — Step 4: Implementation Summary
Stage 1 - Lightweight activity list contract
Changes:
Added
ActivityService::fetchActivityRows()for un-enriched list records andfetchActivityDetail()for one enriched item.Kept
fetchActivity()as the classic-compatible enriched wrapper over the lightweight query.Added coverage that confirms rows omit commit-manifest data until detail is requested.
Verification:
./v3 test LocalAppSmokeTest::testActivityRowsStayLightweightUntilDetailRequested— passed.php -l src/ForumRewrite/Activity/ActivityService.phpandphp -l tests/LocalAppSmokeTest.php— passed.
Notes:
No database changes; filter, sort, cursor, and enriched classic Activity contracts remain intact.
Stage 2 - Bounded server bootstrap and APIs
Changes:
Forte Activity now loads a 20-row selected-view batch; Commit rows load only when the Commit filter is initially requested.
Added row-only paging and
/api/forte_activity_detail, while preserving the existing enriched paging response by default.
Verification:
Local server smoke:
/forte/activity/returned 200 with a 128,688-byte initial page; row-only paging and activity-detail APIs returnedstatus: ok.PHP lint passed for
ActivityService,ForteActivityController, andApplication.
Notes:
The existing list/detail templates still render hidden articles; Stage 3 removes that presentation work.
Stage 3 - Minimal first-paint markup
Changes:
The Activity detail pane now renders only the selected item article instead of a hidden article for every initial row.
Verification:
Local server smoke:
/forte/activity/returned 20 rows and only three page articles (placeholder, selected detail, and existing dialog content), at 29,509 bytes.php -l templates/partials/paned_activity_detail_pane.phpandgit diff --check— passed.
Notes:
Selected detail remains server-rendered; subsequent selections receive their detail in Stage 4.
Stage 4 - On-selection Activity details
Changes:
Added Activity-detail loading, per-visit caching, loading/error states, and stale-response protection to the Activity reader.
Reused the existing selected article when present and retained the separate Commit-detail flow.
Verification:
node --check public/assets/paned_activity_reader.js,php -l src/ForumRewrite/Http/ForteActivityController.php, andgit diff --check— passed.Stage 2's local API smoke confirmed the Activity-detail endpoint returns a rendered detail article.
Notes:
A direct user selection updates row state before issuing the detail request, preventing a stale response from replacing a newer selection.
Stage 5 - Automatic complete row preload
Changes:
Added a post-paint, cursor-driven preload scheduler for every Activity and Commit filter.
Rows are fetched through the lightweight response, merged/deduplicated by item ID, and the scheduler yields between pages and invalidates after a sort-pane swap.
Verification:
node --check public/assets/paned_activity_reader.jsandgit diff --check— passed.Local API smoke verified
rows_only=1responses for All, Content, Identity, Bootstraps, Approvals, and Commits; each returnedstatus: okwith emptydetail_html.
Notes:
The Load more group is hidden while automatic preload owns cursor progression; API cursor behavior remains available and is exercised by the scheduler.
Stage 6 - Performance and regression proof
Changes:
Updated Forte Activity manifest coverage to request technical detail through the new on-selection API.
Verification:
Local-server initial
/forte/activity/: 200, 29,509 bytes, 20 rows, three articles, and 11.304 ms TTFB; Board, Users, classic Activity RSS, Backup, Content, and Commits routes all returned 200.Focused smoke suite passed: Activity lightweight rows, classic/Forte manifest detail, signature detail, and classic source-commit coverage (4/4).
PHP lint passed for changed PHP/templates;
node --check public/assets/paned_activity_reader.jsandgit diff --checkpassed.Full
./v3 test: 590 run, 584 passed. The six reported failures are outside this change: five are already recorded as long-standing; the remaining core-routes assertion expectsView: content, which is absent from the unchanged classic Activity template.
Notes:
The local warm-path measurement is well below the 500 ms target. The automatic preload remains intentionally asynchronous, so the initial response stays bounded as history grows.