Skip to content

feat(profile): profile settings modal (name + avatar) and move dev ports to 400x - #308

Merged
raaymax merged 4 commits into
devfrom
feat/profile-settings-modal
Jul 15, 2026
Merged

feat(profile): profile settings modal (name + avatar) and move dev ports to 400x#308
raaymax merged 4 commits into
devfrom
feat/profile-settings-modal

Conversation

@raaymax

@raaymax raaymax commented Jul 1, 2026

Copy link
Copy Markdown
Owner

Summary

Adds a Profile Settings modal so users can change their display name and upload an avatar, re-adding avatar support that was dropped during the files-root-entity work — decoupled from channel File entities so profile assets never pollute the channel Files view. Also moves the local dev ports into the 400x range to avoid a collision on port 3000.

Changes

Profile settings (feature)

Backend

  • user:setProfile and user:setAvatar commands, each broadcasting {type:"user"} over the existing SSE pipeline.
  • PATCH /api/profile (name) and PUT /api/profile/avatar (raw image stream → core.storage.upload), mounted on the existing profile router.
  • Both responses go through serializeUser, so secrets/password hash never leak; setAvatar best-effort removes the previous blob.
  • Avatar/name upload via storage directly — no channel File entity created.

Frontend

  • New ProfileSettings organism (opened from the sidebar user entry) + Storybook story.
  • AppModel.updateProfile / uploadAvatar actions and API client methods.
  • UserModel.patch now also applies avatarFileId/alias/status, so avatar changes render live via SSE (previously it only patched name).
  • Modal lifted into the Sidebar organism to respect the atomic-design import hierarchy (molecules must not import organisms).
  • Email is shown read-only — it is the PBKDF2 salt for both the auth hash and the encryption key, so changing it is a separate crypto-migration, not a profile field.

Dev ports (chore)

  • Frontend 3000→4000, backend 3001→4001, Storybook 6006→4006.
  • Updates the Vite /api proxy target, backend PORT/baseUrl defaults, mobile-config dev-URL rewrite, capacitor config, and docs. The PORT env override (e.g. Docker's 8080) is unchanged.

Docs

  • ARCHITECTURE.md: add the new user/ commands and the profile/ route module.
  • Port references updated in CLAUDE.md and docs/mobile-app.md.

Testing

  • Added deno route tests for the profile endpoints (auth, name update, empty-name rejection, avatar set, non-image rejection, blob replacement, plus assertions that responses don't leak secrets) — 9/9 pass.
  • Emoji + command suites still green (20/20) after the command-collection change.
  • deno check / deno lint / deno fmt clean; frontend pnpm types shows no new errors; ESLint clean on changed files; build-storybook compiles with the new story.

raaymax added 4 commits July 1, 2026 13:36
Add a Profile/Settings modal (opened from the sidebar user entry) that
lets a user change their display name and upload an avatar.

Backend:
- user:setProfile and user:setAvatar commands, broadcasting {type:"user"}
- PATCH /api/profile and PUT /api/profile/avatar (raw image stream),
  both returning the user via serializeUser so secrets never leak
- setAvatar removes the previous blob best-effort

Frontend:
- ProfileSettings organism + Storybook story
- AppModel updateProfile/uploadAvatar actions and API client methods
- UserModel.patch now also applies avatarFileId/alias/status so avatar
  changes render live via SSE
- Modal lifted into the Sidebar organism to respect atomic-design imports

Email is shown read-only (changing it is a separate crypto-migration).
Adds profile endpoint tests.
Frontend dev server 3000->4000, backend 3001->4001, Storybook 6006->4006,
to avoid a collision on port 3000. Updates the vite proxy target, backend
PORT/baseUrl defaults, the mobile-config dev-URL rewrite, capacitor config,
and docs. The PORT env override (e.g. Docker's 8080) is unchanged.
Add user setProfile/setAvatar commands and the profile/ route module to
ARCHITECTURE.md, and mark v4-scope section 6 (avatar + name uploads) done.
@raaymax
raaymax merged commit c8c48a7 into dev Jul 15, 2026
1 check passed
@raaymax
raaymax deleted the feat/profile-settings-modal branch July 16, 2026 09:41
@raaymax raaymax mentioned this pull request Jul 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant