Users list: recent first, bootstrap counts as activity

Cycle v3/users_recent_first · One-shot · Plans

Debug mode: enabled

Effort study: railspike-effort / v3/users_recent_first; host ledger users_recent_first.md. Standing P2 enrollment. Extended estimates: disabled.

Cycle estimate: 0.10

Status: implemented, PR open; next permitted action: maintainer merge and a look at /users/ after the next approval.

Original request

"account bootstrap should count as account activity, and new approved users should appear near the top of the users list" (Ilya, 2026-11-28).

Authorization

The request authorizes a bounded one-shot through an open PR. Scope: the order of /users/ and the per-key activity shown on a person's Identities tab. Not authorized: changes to post or thread counts, to approval, or to the Forte users table's column sorts.

Problem

  • /users/ defaults to Activity, which orders members by thread count, then post count. The account bootstrap anchor is not counted as a post, so a member approved today with no posts yet sits at the very bottom (live: gribov42, approved 2026-11-28, last of 94).

  • The row's Active date already comes from the bootstrap anchor (it is a visible post with the key as author), but only by accident of the query; no test covers it.

  • On /user/<name>?tab=identities, a key with only its bootstrap anchor shows "No posts" and sorts after keys that posted, because the key's latest activity is taken from the visible post list, which leaves the anchor out.

Outcome and work type

Application change.

  • Bare /users/ (and any unknown ?sort=) orders by Last active: newest account activity first, the bootstrap anchor included. A newly approved member is therefore near the top. Last active becomes the menu's first option; Activity (counts) and Name stay, with their URLs unchanged.

  • The Identities tab counts each key's bootstrap anchor as its activity when it has no later visible post: "Active <time>" instead of "No posts", and the key sorts by that time.

Risks

  • The static /users/ page could go stale in a new way. It already shows each member's Active date, so it already depends on post times; no new dependency. Checked by reading the static route refresh, not changed.

  • The Activity label still means counts. Kept to avoid breaking links and the browser test; noted for the maintainer.

Reuse decisions

  • ProfilePageController::directory(), normalizeDirectorySort() and directorySortOptions(), changed in place; the existing Last active comparator becomes the default.

  • ProfileRepository::activityBoundsByUsernameToken() stays the one source of the directory's Active date; its comment now states that the bootstrap anchor counts.

  • ProfilePageController::identitiesByLatestPost() and templates/pages/username.php, extended with the anchor's time from the posts row named by profiles.bootstrap_post_id. No new component.

Completion conditions

./v3 test --smoke UsersDirectorySortTest passes with a bootstrap-only member at the top of the default order and an Identities-tab check. Feedback: no matching item in docs/feedback/items/. Concepts touched: none. PR open.

Starting revision and branch: 76349fba5, feat/users-recent-first. Planning commit: c01cedfde.

Study history

  • 2026-11-28 UTC, intake and entry: 0.10. Claude, single exposed rater. R1 not reverified this session.

  • 2026-11-28 UTC, closeout: retrospective 0.12 (the pre-existing browser-test failure added a fix). Same rater.

Execution history

  • 2026-11-28: confirmed on live data that the directory's Active date already includes the bootstrap anchor (gribov42: 0 threads, 0 posts, Active Nov 28, last row of 94). The default order was the only thing keeping new members at the bottom.

  • 2026-11-28: tests/browser/users_profile.mjs failed at "approve from Waiting" on 76349fba5 too: it still expected the approved row to disappear with an "Approved user …" line, which PF-20261128-F01 (5a47dddab, earlier today) replaced with an Approved chip in place. Fixed the test to match that behaviour (a correction to the test, not a behaviour change), per the rule that tests failing on the base commit get fixed in the work.

Outcome

  • /users/ with no ?sort= (and the static page) is ordered by Last active, which is now the menu's first option. A newly approved member is near the top; in the browser test only the approver, whose approval came a second later, is ahead. ?sort=activity keeps the thread/post-count order; ?sort=name is unchanged.

  • The Identities tab gives each key an active_at: its latest visible post, or its account bootstrap when that is later or the only one. A bootstrap-only key shows "Active <time>" and sorts by it, instead of "No posts" at the end.

  • New ProfileRepository::bootstrapTimesByIdentity(); the directory bounds query only gained a comment.

Verification

  • Passed: ./v3 test --smoke UsersDirectorySortTest (498/498), and ./v3 test --smoke PersonIdentityOrderTest RecentPostTest LocalAppSmokeTest UserAccessTest (505/505). UsersDirectorySortTest adds a bootstrap-only member: first by default and by Last active, last by Activity, "Active" on the Identities tab.

  • Passed: node tests/browser/users_profile.mjs (headless Chrome, 390px), with the new check that the approved member is in the top two of /users/ and ahead of older activity. Screenshot reviewed.

  • Not run: the full suite. Not verified: production.

Final review

Diff: ProfilePageController, ProfileRepository, templates/pages/username.php, UsersDirectorySortTest, users_profile.mjs, this record, the index, the ledger and the debug log. No schema, count, approval or Forte change. Open point for the maintainer: "Activity" still names the count order, beside the new default "Last active".

Claude Opus 5.5, 2026-11-28