From c007741b65a0cb2d47f4565e64376a783fee5bf6 Mon Sep 17 00:00:00 2001 From: Christomatt Date: Tue, 27 Jan 2026 04:16:05 +0100 Subject: [PATCH] feat: Include chat public key in conversation data and enhance chat page layout for full width and dynamic height. --- src/app/api/swarm/chat/conversations/route.ts | 4 +++- src/app/chat/chat.css | 7 ++++++- src/app/chat/page.tsx | 7 ++++++- src/app/globals.css | 5 +++-- 4 files changed, 18 insertions(+), 5 deletions(-) diff --git a/src/app/api/swarm/chat/conversations/route.ts b/src/app/api/swarm/chat/conversations/route.ts index 0ace504..8544bda 100644 --- a/src/app/api/swarm/chat/conversations/route.ts +++ b/src/app/api/swarm/chat/conversations/route.ts @@ -49,11 +49,12 @@ export async function GET(request: NextRequest) { // Parse participant info const participant2Handle = conv.participant2Handle; const isRemote = participant2Handle.includes('@'); - + let participant2Info = { handle: participant2Handle, displayName: participant2Handle, avatarUrl: null as string | null, + chatPublicKey: null as string | null, }; // Try to get cached user info @@ -66,6 +67,7 @@ export async function GET(request: NextRequest) { handle: cachedUser.handle, displayName: cachedUser.displayName || cachedUser.handle, avatarUrl: cachedUser.avatarUrl, + chatPublicKey: cachedUser.publicKey, // This is the chat public key }; } diff --git a/src/app/chat/chat.css b/src/app/chat/chat.css index b7cc81e..438d094 100644 --- a/src/app/chat/chat.css +++ b/src/app/chat/chat.css @@ -1,7 +1,12 @@ /* Chat Page Styles */ .chat-page { - height: calc(100vh - 60px); + height: 100vh; + /* Use dynamic viewport height for mobile browsers */ + height: 100dvh; + max-height: 100dvh; + display: flex; + flex-direction: column; } .chat-container { diff --git a/src/app/chat/page.tsx b/src/app/chat/page.tsx index 0e5c568..4288ea9 100644 --- a/src/app/chat/page.tsx +++ b/src/app/chat/page.tsx @@ -9,7 +9,12 @@ import './chat.css'; interface Conversation { id: string; - participant2: { handle: string; displayName: string; avatarUrl: string | null; chatPublicKey: string | null; }; + participant2: { + handle: string; + displayName: string; + avatarUrl: string | null; + chatPublicKey: string | null; + }; lastMessageAt: string; lastMessagePreview: string; unreadCount: number; diff --git a/src/app/globals.css b/src/app/globals.css index b175f16..d3e75ab 100644 --- a/src/app/globals.css +++ b/src/app/globals.css @@ -260,8 +260,9 @@ a.btn-primary:visited { } .layout.hide-right-sidebar .main { - flex: 0 1 920px !important; - max-width: 920px !important; + flex: 1 !important; + max-width: 100% !important; + width: 100%; } .aside {