Barazo default frontend barazo.forum
2
fork

Configure Feed

Select the types of activity you want to include in your feed.

chore(web): add author profile data to mock fixtures

Update mock topics and replies with author field for P2.8.

+32
+26
src/mocks/data.ts
··· 6 6 import type { 7 7 AuthSession, 8 8 AuthUser, 9 + AuthorProfile, 9 10 CategoryTreeNode, 10 11 CategoryWithTopicCount, 11 12 CommunityPreferenceOverride, ··· 46 47 { did: 'did:plc:user-eve-005', handle: 'eve.forum.example' }, 47 48 ] as const 48 49 50 + // --- Author Profiles (for enriched Topic/Reply responses) --- 51 + 52 + export const mockAuthorProfiles: AuthorProfile[] = [ 53 + { 54 + did: mockUsers[0]!.did, 55 + handle: mockUsers[0]!.handle, 56 + displayName: 'Alice', 57 + avatarUrl: 'https://cdn.bsky.social/avatar/alice.jpg', 58 + }, 59 + { did: mockUsers[1]!.did, handle: mockUsers[1]!.handle, displayName: 'Bob', avatarUrl: null }, 60 + { did: mockUsers[2]!.did, handle: mockUsers[2]!.handle, displayName: 'Carol', avatarUrl: null }, 61 + { did: mockUsers[3]!.did, handle: mockUsers[3]!.handle, displayName: 'Dave', avatarUrl: null }, 62 + { did: mockUsers[4]!.did, handle: mockUsers[4]!.handle, displayName: 'Eve', avatarUrl: null }, 63 + ] 64 + 49 65 // --- Auth --- 50 66 51 67 export const mockAuthSession: AuthSession = { ··· 160 176 uri: `at://${mockUsers[0]!.did}/forum.barazo.topic.post/3kf1abc`, 161 177 rkey: '3kf1abc', 162 178 authorDid: mockUsers[0]!.did, 179 + author: mockAuthorProfiles[0]!, 163 180 title: 'Welcome to Barazo Forums', 164 181 content: 'This is the first topic on our new federated forum platform.', 165 182 contentFormat: null, ··· 178 195 uri: `at://${mockUsers[1]!.did}/forum.barazo.topic.post/3kf2def`, 179 196 rkey: '3kf2def', 180 197 authorDid: mockUsers[1]!.did, 198 + author: mockAuthorProfiles[1]!, 181 199 title: 'Building with the AT Protocol', 182 200 content: 'A deep dive into building applications on the AT Protocol.', 183 201 contentFormat: null, ··· 196 214 uri: `at://${mockUsers[2]!.did}/forum.barazo.topic.post/3kf3ghi`, 197 215 rkey: '3kf3ghi', 198 216 authorDid: mockUsers[2]!.did, 217 + author: mockAuthorProfiles[2]!, 199 218 title: 'Feature Request: Dark Mode Improvements', 200 219 content: 'I would love to see more theme customization options.', 201 220 contentFormat: null, ··· 214 233 uri: `at://${mockUsers[3]!.did}/forum.barazo.topic.post/3kf4jkl`, 215 234 rkey: '3kf4jkl', 216 235 authorDid: mockUsers[3]!.did, 236 + author: mockAuthorProfiles[3]!, 217 237 title: 'Understanding Portable Identity', 218 238 content: 'How does identity work across federated services?', 219 239 contentFormat: null, ··· 232 252 uri: `at://${mockUsers[4]!.did}/forum.barazo.topic.post/3kf5mno`, 233 253 rkey: '3kf5mno', 234 254 authorDid: mockUsers[4]!.did, 255 + author: mockAuthorProfiles[4]!, 235 256 title: 'Self-Hosting Guide', 236 257 content: 'Step-by-step guide to running your own Barazo instance.', 237 258 contentFormat: null, ··· 366 387 uri: `at://${mockUsers[1]!.did}/forum.barazo.reply.post/3kf6aaa`, 367 388 rkey: '3kf6aaa', 368 389 authorDid: mockUsers[1]!.did, 390 + author: mockAuthorProfiles[1]!, 369 391 content: 'Welcome! Excited to see this forum take shape.', 370 392 contentFormat: null, 371 393 rootUri: TOPIC_URI, ··· 383 405 uri: `at://${mockUsers[2]!.did}/forum.barazo.reply.post/3kf6bbb`, 384 406 rkey: '3kf6bbb', 385 407 authorDid: mockUsers[2]!.did, 408 + author: mockAuthorProfiles[2]!, 386 409 content: 387 410 'Thanks for starting this community! The AT Protocol integration is really interesting.', 388 411 contentFormat: null, ··· 401 424 uri: `at://${mockUsers[0]!.did}/forum.barazo.reply.post/3kf6ccc`, 402 425 rkey: '3kf6ccc', 403 426 authorDid: mockUsers[0]!.did, 427 + author: mockAuthorProfiles[0]!, 404 428 content: 'Agreed! Portable identity changes everything.', 405 429 contentFormat: null, 406 430 rootUri: TOPIC_URI, ··· 418 442 uri: `at://${mockUsers[3]!.did}/forum.barazo.reply.post/3kf6ddd`, 419 443 rkey: '3kf6ddd', 420 444 authorDid: mockUsers[3]!.did, 445 + author: mockAuthorProfiles[3]!, 421 446 content: 'One question: how does content moderation work across federated instances?', 422 447 contentFormat: null, 423 448 rootUri: TOPIC_URI, ··· 435 460 uri: `at://${mockUsers[4]!.did}/forum.barazo.reply.post/3kf6eee`, 436 461 rkey: '3kf6eee', 437 462 authorDid: mockUsers[4]!.did, 463 + author: mockAuthorProfiles[4]!, 438 464 content: 439 465 'Great question! Each community has its own moderation policies, but the AT Protocol labeling system allows cross-community signals.', 440 466 contentFormat: null,
+6
src/mocks/handlers.ts
··· 237 237 uri: `at://did:plc:mock-user/forum.barazo.topic.post/${rkey}`, 238 238 rkey, 239 239 authorDid: 'did:plc:mock-user', 240 + author: { 241 + did: 'did:plc:mock-user', 242 + handle: 'mock-user.bsky.social', 243 + displayName: 'Mock User', 244 + avatarUrl: null, 245 + }, 240 246 title: body.title, 241 247 content: body.content, 242 248 contentFormat: null,