[1.x] feat: add Followers page to user profiles#49
Merged
Conversation
…ization adjustments
- Fix FollowersPage and FollowingPage to load the user from the route
username param via show() override, instead of hardcoding
app.session.user — pages now work correctly for any user profile
when visited directly by URL
- Show "Followers" nav link on any user profile (public info);
keep "Following" nav link restricted to own profile (contains
follow-level controls). Guard against null this.user in navItems.
- Remove actor.followedBy from ShowForumController includes to avoid
eagerly loading the full followers list on every page load
- Remove followedBy from CurrentUserSerializer (not needed in boot
payload) and from ListUsersController includes
- Remove redundant $data->load('followedBy') from LoadRelations.php;
the addInclude extender on ShowUserController already handles this
- Move followers_link locale key from profile_page to forum top-level,
consistent with profile_link
- Add integration tests for followedBy: included on ShowUserController,
not included in forum boot response
- Rebase onto 1.x
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
6 tasks
imorland
added a commit
that referenced
this pull request
Feb 21, 2026
Closes #46 (2.x port of #49). **New features** - New `/u/:username/followers` route showing who follows a given user - "Followers" nav link appears on any user's profile (public information) - "Following" nav link remains restricted to the logged-in user's own profile **Bug fixes** - `FollowingPage` (formerly `ProfilePage`) now correctly loads the user via `loadUser(m.route.param('username'))` + `show()` override, instead of hardcoding `app.session.user` — the page now works when visited directly by URL for any user - Added null guard on `this.user` in `navItems` extend **Performance** - Removed `followedBy` from `Index` endpoint default includes — was loading the full followers list for every user in search/list results **Refactoring** - `ProfilePage` renamed to `FollowingPage` for clarity - `FollowedUserListItem` renamed to `UserListItem` (now shared between both FollowingPage and FollowersPage) **Locale** - Added `followers_link` key to `forum` top-level (consistent with existing `profile_link`) - Added `profile_page.no_followers` placeholder string **Tests** - Added `FollowedByTest` with 3 integration tests: - `followedBy` relation is included when viewing another user's profile - `followedBy` relation is included when viewing own profile - `followedBy` is NOT included in the forum boot response (regression guard for the perf fix) Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
imorland
added a commit
that referenced
this pull request
Feb 21, 2026
* feat: add Followers page to user profiles Closes #46 (2.x port of #49). **New features** - New `/u/:username/followers` route showing who follows a given user - "Followers" nav link appears on any user's profile (public information) - "Following" nav link remains restricted to the logged-in user's own profile **Bug fixes** - `FollowingPage` (formerly `ProfilePage`) now correctly loads the user via `loadUser(m.route.param('username'))` + `show()` override, instead of hardcoding `app.session.user` — the page now works when visited directly by URL for any user - Added null guard on `this.user` in `navItems` extend **Performance** - Removed `followedBy` from `Index` endpoint default includes — was loading the full followers list for every user in search/list results **Refactoring** - `ProfilePage` renamed to `FollowingPage` for clarity - `FollowedUserListItem` renamed to `UserListItem` (now shared between both FollowingPage and FollowersPage) **Locale** - Added `followers_link` key to `forum` top-level (consistent with existing `profile_link`) - Added `profile_page.no_followers` placeholder string **Tests** - Added `FollowedByTest` with 3 integration tests: - `followedBy` relation is included when viewing another user's profile - `followedBy` relation is included when viewing own profile - `followedBy` is NOT included in the forum boot response (regression guard for the perf fix) Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> * fix: add followedBy to User type shims --------- Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #46.
This supersedes #46 (originally authored by @BHZoon), rebased onto
1.xwith the following fixes applied during review:Changes from original PR
Bug fixes
FollowersPageandFollowingPagenow correctly load the user from the route:usernameparam via ashow()override, instead of hardcodingapp.session.user— pages work for any user profile when visited directly by URLthis.userinnavItemsextendBehaviour
Performance
actor.followedByfromShowForumControllerincludes — was loading the full followers list on every single page loadfollowedByfromCurrentUserSerializer(not needed in the boot payload)followedByfromListUsersControllerincludes (unused there)$data->load('followedBy')fromLoadRelations.php; theaddIncludeextender onShowUserControlleralready handles thisLocale
followers_linkkey fromprofile_pagetoforumtop-level, consistent with the existingprofile_linkkeyTests
FollowedByTestwith 3 integration tests:followedByrelation is included when viewing another user's profilefollowedByrelation is included when viewing own profilefollowedByis not included in the forum boot response (regression guard for the perf fix)Test results
All 11 tests pass.
🤖 Generated with Claude Code