profile: wire bio/phone/location/timezone to arcadia

Adds a "Profile" card backed by /api/v1/profile (PATCH) for the four
public-profile fields arcadia already had columns for. Bio moved out of
local prefs (the server one supersedes); local prefs keeps only title,
signature, defaultAgentId, and the avatar URL mirror.

Save/revert mirror the existing Account card's pattern. The new fields
get arcadia validation + audit logging for free.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
jules
2026-05-05 09:49:34 +10:00
parent c2730e3c77
commit f6a92118da
2 changed files with 155 additions and 20 deletions

View File

@@ -1,12 +1,13 @@
// Local user preferences — title, bio, signature, avatar, default agent.
// Persisted in localStorage; reactive across tabs. Identity (name, email)
// is owned by the arcadia session, not this store — see ~/lib/session.ts.
// Local user preferences — title, signature, default agent, plus a cache
// mirror of the resolved avatar URL. Persisted in localStorage; reactive
// across tabs. Identity (name, email) is owned by the arcadia session
// (~/lib/session.ts); the public profile (bio, phone, location, timezone)
// is server-backed via /api/v1/profile (~/lib/arcadia/profiles.ts).
import { useEffect, useSyncExternalStore } from "react"
export type Profile = {
title: string
bio: string
signature: string
avatarUrl: string
defaultAgentId: string
@@ -14,7 +15,6 @@ export type Profile = {
export const DEFAULT_PROFILE: Profile = {
title: "",
bio: "",
signature: "",
avatarUrl: "",
defaultAgentId: "",
@@ -32,7 +32,6 @@ function readFromStorage(): Profile {
return {
title:
typeof parsed.title === "string" ? parsed.title : DEFAULT_PROFILE.title,
bio: typeof parsed.bio === "string" ? parsed.bio : DEFAULT_PROFILE.bio,
signature:
typeof parsed.signature === "string"
? parsed.signature