Skip to content

Commit 7524bf1

Browse files
imorlandclaude
andcommitted
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>
1 parent a37dc58 commit 7524bf1

File tree

16 files changed

+225
-29
lines changed

16 files changed

+225
-29
lines changed

extend.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@
6060
(new Extend\ApiResource(Resource\UserResource::class))
6161
->fields(Api\UserResourceFields::class)
6262
->endpoint(Endpoint\Index::class, function (Endpoint\Index $endpoint) {
63-
return $endpoint->addDefaultInclude(['followedUsers', 'followedBy']);
63+
return $endpoint->addDefaultInclude(['followedUsers']);
6464
})
6565
->endpoint(Endpoint\Show::class, function (Endpoint\Show $endpoint) {
6666
return $endpoint->addDefaultInclude(['followedUsers', 'followedBy']);

js/dist/forum.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

js/dist/forum.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

js/dist/forum/components/FollowersPage.js

Lines changed: 2 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

js/dist/forum/components/FollowersPage.js.map

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

js/dist/forum/components/FollowingPage.js

Lines changed: 2 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

js/dist/forum/components/FollowingPage.js.map

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

js/dist/forum/components/ProfilePage.js

Lines changed: 0 additions & 2 deletions
This file was deleted.

0 commit comments

Comments
 (0)