Commit 2c9fc66
authored
Updated ActivityPub to use dynamic topics and recommendations from API (#25646)
ref
https://linear.app/ghost/issue/BER-3098/hide-discovery-feeds-tabs-for-self-hosters
ref
https://linear.app/ghost/issue/BER-3041/point-activitypub-explore-to-ghost-explore-axis-for-self-hosters
ref
https://linear.app/ghost/issue/BER-3025/update-sidebar-in-feed-recommendations-to-use-new-explore-data
- Added API methods for fetching topics and recommendations from new
endpoints
- Updated topic filter to use `/topics` endpoint instead of hardcoded
list
- Conditionally hide topics and recommendations UI when endpoints return
empty
- Link Explore to external discovery page when no topics available
- Updated suggested profiles to use `/recommendations` endpoint with
server-side randomization
<!-- CURSOR_SUMMARY -->
---
> [!NOTE]
> Use new API endpoints for topics and recommendations, update hooks and
UI to load dynamically, and conditionally show/hide Explore/topic UI
(with external link fallback).
>
> - **API**:
> - Add `getTopics()` and `getRecommendations(limit?)` to
`ActivityPubAPI` with types (`TopicData`, `GetTopicsResponse`,
`GetRecommendationsResponse`).
> - **Data hooks**:
> - Add `QUERY_KEYS.topics` and `useTopicsForUser()`.
> - Update `useSuggestedProfilesForUser()` to fetch from
`getRecommendations()` and cache accounts.
> - Remove legacy JSON-based explore/suggestions logic.
> - **UI/UX**:
> - Topic chips now dynamic: `TopicFilter` reads from `/topics` (type
`Topic = string`; uses `slug`/`name`).
> - Conditionally render topic filter and suggested profiles only when
data exists.
> - Sidebar "Explore": internal link when topics exist; otherwise
external link to `https://explore.ghost.org/social-web`.
> - Inbox empty state CTA mirrors the above internal/external behavior.
> - Layout/Header border logic and Onboarding Step3 navigation depend on
presence of topics.
> - **Version**:
> - Bump `@tryghost/activitypub` to `3.0.0`.
>
> <sup>Written by [Cursor
Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit
086cb83. This will update automatically
on new commits. Configure
[here](https://cursor.com/dashboard?tab=bugbot).</sup>
<!-- /CURSOR_SUMMARY -->1 parent 2ace1fa commit 2c9fc66
File tree
11 files changed
+153
-311
lines changed- apps/activitypub
- src
- api
- components
- global
- layout
- Onboarding
- Sidebar
- modals
- hooks
- views
- Feed/components
- Inbox/components
11 files changed
+153
-311
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | | - | |
| 3 | + | |
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
40 | 40 | | |
41 | 41 | | |
42 | 42 | | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
43 | 56 | | |
44 | 57 | | |
45 | 58 | | |
| |||
477 | 490 | | |
478 | 491 | | |
479 | 492 | | |
| 493 | + | |
| 494 | + | |
| 495 | + | |
| 496 | + | |
| 497 | + | |
| 498 | + | |
| 499 | + | |
| 500 | + | |
| 501 | + | |
| 502 | + | |
| 503 | + | |
| 504 | + | |
| 505 | + | |
| 506 | + | |
| 507 | + | |
| 508 | + | |
| 509 | + | |
| 510 | + | |
| 511 | + | |
480 | 512 | | |
481 | 513 | | |
482 | 514 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
| 3 | + | |
3 | 4 | | |
4 | | - | |
5 | | - | |
6 | | - | |
7 | | - | |
8 | | - | |
9 | | - | |
10 | | - | |
11 | | - | |
12 | | - | |
13 | | - | |
14 | | - | |
15 | | - | |
16 | | - | |
17 | | - | |
18 | | - | |
19 | | - | |
20 | | - | |
21 | | - | |
22 | | - | |
23 | | - | |
24 | | - | |
25 | | - | |
26 | | - | |
27 | | - | |
28 | | - | |
29 | | - | |
30 | | - | |
31 | | - | |
32 | | - | |
33 | | - | |
| 5 | + | |
34 | 6 | | |
35 | 7 | | |
36 | 8 | | |
| |||
39 | 11 | | |
40 | 12 | | |
41 | 13 | | |
42 | | - | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
43 | 23 | | |
44 | 24 | | |
45 | 25 | | |
| |||
66 | 46 | | |
67 | 47 | | |
68 | 48 | | |
69 | | - | |
| 49 | + | |
70 | 50 | | |
71 | | - | |
72 | | - | |
| 51 | + | |
| 52 | + | |
73 | 53 | | |
74 | | - | |
75 | | - | |
| 54 | + | |
| 55 | + | |
76 | 56 | | |
77 | | - | |
| 57 | + | |
78 | 58 | | |
79 | 59 | | |
80 | 60 | | |
| |||
Lines changed: 6 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
19 | 19 | | |
20 | 20 | | |
21 | 21 | | |
22 | | - | |
23 | | - | |
| 22 | + | |
24 | 23 | | |
25 | 24 | | |
26 | 25 | | |
27 | 26 | | |
28 | 27 | | |
29 | | - | |
30 | | - | |
| 28 | + | |
31 | 29 | | |
32 | 30 | | |
33 | 31 | | |
| |||
81 | 79 | | |
82 | 80 | | |
83 | 81 | | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
84 | 86 | | |
85 | 87 | | |
86 | 88 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
| 11 | + | |
11 | 12 | | |
12 | 13 | | |
13 | 14 | | |
| |||
16 | 17 | | |
17 | 18 | | |
18 | 19 | | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
19 | 23 | | |
20 | 24 | | |
21 | 25 | | |
| |||
44 | 48 | | |
45 | 49 | | |
46 | 50 | | |
47 | | - | |
| 51 | + | |
48 | 52 | | |
49 | 53 | | |
50 | 54 | | |
| |||
Lines changed: 5 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
19 | | - | |
| 19 | + | |
20 | 20 | | |
21 | 21 | | |
22 | 22 | | |
| |||
302 | 302 | | |
303 | 303 | | |
304 | 304 | | |
| 305 | + | |
| 306 | + | |
| 307 | + | |
305 | 308 | | |
306 | 309 | | |
307 | 310 | | |
| |||
317 | 320 | | |
318 | 321 | | |
319 | 322 | | |
320 | | - | |
| 323 | + | |
321 | 324 | | |
322 | 325 | | |
323 | 326 | | |
| |||
Lines changed: 22 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
13 | | - | |
| 13 | + | |
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
| |||
26 | 26 | | |
27 | 27 | | |
28 | 28 | | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
29 | 32 | | |
30 | 33 | | |
31 | 34 | | |
| |||
73 | 76 | | |
74 | 77 | | |
75 | 78 | | |
76 | | - | |
77 | | - | |
78 | | - | |
79 | | - | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
80 | 97 | | |
81 | 98 | | |
82 | 99 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
9 | | - | |
| 9 | + | |
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
| |||
127 | 127 | | |
128 | 128 | | |
129 | 129 | | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
130 | 133 | | |
131 | 134 | | |
132 | 135 | | |
| |||
184 | 187 | | |
185 | 188 | | |
186 | 189 | | |
187 | | - | |
| 190 | + | |
188 | 191 | | |
189 | 192 | | |
190 | 193 | | |
| |||
0 commit comments