feat: Include chat public key in conversation data and enhance chat page layout for full width and dynamic height.

This commit is contained in:
Christomatt
2026-01-27 04:16:05 +01:00
parent 5262cb1dbd
commit c007741b65
4 changed files with 18 additions and 5 deletions
@@ -49,11 +49,12 @@ export async function GET(request: NextRequest) {
// Parse participant info // Parse participant info
const participant2Handle = conv.participant2Handle; const participant2Handle = conv.participant2Handle;
const isRemote = participant2Handle.includes('@'); const isRemote = participant2Handle.includes('@');
let participant2Info = { let participant2Info = {
handle: participant2Handle, handle: participant2Handle,
displayName: participant2Handle, displayName: participant2Handle,
avatarUrl: null as string | null, avatarUrl: null as string | null,
chatPublicKey: null as string | null,
}; };
// Try to get cached user info // Try to get cached user info
@@ -66,6 +67,7 @@ export async function GET(request: NextRequest) {
handle: cachedUser.handle, handle: cachedUser.handle,
displayName: cachedUser.displayName || cachedUser.handle, displayName: cachedUser.displayName || cachedUser.handle,
avatarUrl: cachedUser.avatarUrl, avatarUrl: cachedUser.avatarUrl,
chatPublicKey: cachedUser.publicKey, // This is the chat public key
}; };
} }
+6 -1
View File
@@ -1,7 +1,12 @@
/* Chat Page Styles */ /* Chat Page Styles */
.chat-page { .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 { .chat-container {
+6 -1
View File
@@ -9,7 +9,12 @@ import './chat.css';
interface Conversation { interface Conversation {
id: string; 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; lastMessageAt: string;
lastMessagePreview: string; lastMessagePreview: string;
unreadCount: number; unreadCount: number;
+3 -2
View File
@@ -260,8 +260,9 @@ a.btn-primary:visited {
} }
.layout.hide-right-sidebar .main { .layout.hide-right-sidebar .main {
flex: 0 1 920px !important; flex: 1 !important;
max-width: 920px !important; max-width: 100% !important;
width: 100%;
} }
.aside { .aside {