feat: discover people tab, privacy settings, and friend request button fix

- Add "Discover People" section to Add Friend tab with user cards, mutual counts, and inline actions
- Add discoverStore for fetching/searching discoverable users across local and federated instances
- Add PrivacyPanel to user settings with discoverability toggle
- Add is_discoverable column to users table with migration
- Fix "Send Friend Request" button vertical alignment using transform centering
This commit is contained in:
Jannis Braun
2026-03-13 22:54:19 +01:00
parent 9382477e33
commit b194cc1915
9 changed files with 584 additions and 31 deletions
+8 -1
View File
@@ -255,7 +255,7 @@ export async function userRoutes(app: FastifyInstance): Promise<void> {
});
app.patch<{ Body: UpdateUserRequest }>('/api/users/@me', { preHandler: authenticate }, async (request, reply) => {
const { displayName, avatar, banner, accentColor, avatarColor, bio, customStatus, status, replicatedInstances, homeUserId, profileUpdatedAt } = request.body;
const { displayName, avatar, banner, accentColor, avatarColor, bio, customStatus, status, replicatedInstances, homeUserId, profileUpdatedAt, discoverable } = request.body;
const db = getDb();
const updateData: Record<string, string | null | undefined> = {};
@@ -366,6 +366,13 @@ export async function userRoutes(app: FastifyInstance): Promise<void> {
}
}
if (discoverable !== undefined) {
if (typeof discoverable !== 'boolean') {
return reply.code(400).send({ error: 'discoverable must be a boolean', statusCode: 400 });
}
(updateData as Record<string, unknown>).discoverable = discoverable ? 1 : 0;
}
if (Object.keys(updateData).length === 0) {
return reply.code(400).send({ error: 'No fields to update', statusCode: 400 });
}