feat: add character sheet panel with guild info

Adds pronouns, guildName, and guildDescription fields to the player
profile. A new Character tab provides an in-game view/edit panel for
character and guild lore.

Closes #16
This commit is contained in:
2026-03-07 13:49:04 -08:00
committed by Naomi Carrigan
parent 4706f3f7f8
commit 924b9f541d
7 changed files with 460 additions and 5 deletions
+10 -1
View File
@@ -69,9 +69,12 @@ profileRouter.get("/:discordId", async (context) => {
return context.json({
characterName: player.characterName,
pronouns: player.pronouns ?? "",
username: player.username,
avatar: player.avatar ?? null,
bio: player.bio ?? "",
guildName: player.guildName ?? "",
guildDescription: player.guildDescription ?? "",
profileSettings,
createdAt: player.createdAt,
// All Time stats — cumulative across all runs, never reset
@@ -99,7 +102,10 @@ profileRouter.put("/", authMiddleware, async (context) => {
const body = await context.req.json<UpdateProfileRequest>();
const characterName = (body.characterName ?? "").trim().slice(0, 32);
const pronouns = (body.pronouns ?? "").trim().slice(0, 20);
const bio = (body.bio ?? "").trim().slice(0, 200);
const guildName = (body.guildName ?? "").trim().slice(0, 64);
const guildDescription = (body.guildDescription ?? "").trim().slice(0, 500);
const numberFormat = VALID_NUMBER_FORMATS.has(body.profileSettings?.numberFormat as string)
? (body.profileSettings?.numberFormat as ProfileSettings["numberFormat"])
: "suffix";
@@ -129,12 +135,15 @@ profileRouter.put("/", authMiddleware, async (context) => {
const updated = await prisma.player.update({
where: { discordId },
data: { characterName, bio, profileSettings: profileSettings as object },
data: { characterName, pronouns, bio, guildName, guildDescription, profileSettings: profileSettings as object },
});
return context.json({
characterName: updated.characterName,
pronouns: updated.pronouns,
bio: updated.bio,
guildName: updated.guildName,
guildDescription: updated.guildDescription,
profileSettings,
});
});