feat: add user display profiles and fix web context menu UX
Some checks failed
CI / test (push) Failing after 17s
Some checks failed
CI / test (push) Failing after 17s
backend: - add required user name and optional bio fields - extend auth/register and user schemas/services with name/bio - add alembic migration 0006 with safe backfill name=username - compute per-user chat display_title for private chats - keep Saved Messages delete-for-all protections web: - registration now includes name - add profile edit modal (name/username/bio/avatar url) - show private chat names via display_title - fix context menus to open near cursor with viewport clamping - stabilize +/close floating button to remove visual jump
This commit is contained in:
@@ -4,6 +4,7 @@ from pydantic import BaseModel, ConfigDict, EmailStr, Field
|
||||
|
||||
|
||||
class UserBase(BaseModel):
|
||||
name: str = Field(min_length=1, max_length=100)
|
||||
username: str = Field(min_length=3, max_length=50)
|
||||
email: EmailStr
|
||||
|
||||
@@ -17,13 +18,16 @@ class UserRead(UserBase):
|
||||
|
||||
id: int
|
||||
avatar_url: str | None = None
|
||||
bio: str | None = None
|
||||
email_verified: bool
|
||||
created_at: datetime
|
||||
updated_at: datetime
|
||||
|
||||
|
||||
class UserProfileUpdate(BaseModel):
|
||||
name: str | None = Field(default=None, min_length=1, max_length=100)
|
||||
username: str | None = Field(default=None, min_length=3, max_length=50)
|
||||
bio: str | None = Field(default=None, max_length=500)
|
||||
avatar_url: str | None = Field(default=None, max_length=512)
|
||||
|
||||
|
||||
@@ -31,5 +35,6 @@ class UserSearchRead(BaseModel):
|
||||
model_config = ConfigDict(from_attributes=True)
|
||||
|
||||
id: int
|
||||
name: str
|
||||
username: str
|
||||
avatar_url: str | None = None
|
||||
|
||||
Reference in New Issue
Block a user