Private
Public Access
Rebuild frontend from the Claude Design handoff, DarkSingularity brand
Replaces the Phase 1 placeholder UI with a single persistent app shell (top bar + sidebar + chat pane, 860px responsive breakpoint) matching the "PWA chat system UI" design handoff: message bubbles with consecutive-run avatar/name grouping, auto-growing composer, room search, and the real DarkSingularity logo (also used to regenerate the PWA icons). The handoff didn't cover Phase 2 (private rooms, roles, invites) or browsing/joining open rooms, so those are added using the same visual language: a room info panel with role badges, invite-by-username with a pending-invites list, member management (remove/promote/demote/transfer ownership), room settings (rename/describe/delete), and separate browse-rooms/invites-inbox modals. Unread badges, last-message preview, and the typing indicator are deliberately deferred -- both need new backend features (read-tracking, a WS typing event) that weren't in scope this pass. Two small backend additions round out data the new UI needs but the API didn't expose: MessageRead.username (historic messages had no sender name) and InviteRead.target_username / MyInviteRead.room_name+invited_by_username (a recipient's invite list can't otherwise resolve a room they're not in). Both are additive; 35 backend tests still pass. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
@@ -72,14 +72,15 @@ async def create_invite(
|
||||
db.add(invite)
|
||||
await db.commit()
|
||||
await db.refresh(invite)
|
||||
invite.target_user = target
|
||||
return invite
|
||||
|
||||
|
||||
async def list_room_invites(db: AsyncSession, room_id: uuid.UUID) -> list[RoomInvite]:
|
||||
result = await db.execute(
|
||||
select(RoomInvite).where(
|
||||
RoomInvite.room_id == room_id, RoomInvite.status == InviteStatus.pending
|
||||
)
|
||||
select(RoomInvite)
|
||||
.where(RoomInvite.room_id == room_id, RoomInvite.status == InviteStatus.pending)
|
||||
.options(selectinload(RoomInvite.target_user))
|
||||
)
|
||||
return list(result.scalars().all())
|
||||
|
||||
@@ -92,7 +93,7 @@ async def list_my_invites(db: AsyncSession, user_id: uuid.UUID) -> list[RoomInvi
|
||||
RoomInvite.status == InviteStatus.pending,
|
||||
RoomInvite.expires_at > datetime.now(timezone.utc),
|
||||
)
|
||||
.options(selectinload(RoomInvite.room))
|
||||
.options(selectinload(RoomInvite.room), selectinload(RoomInvite.inviter))
|
||||
)
|
||||
return list(result.scalars().all())
|
||||
|
||||
|
||||
Reference in New Issue
Block a user