Skip to content

Commit a17a291

Browse files
committed
fix: Fixing Blank screen and scrolling
1 parent 730e808 commit a17a291

File tree

2 files changed

+222
-202
lines changed

2 files changed

+222
-202
lines changed

ui/src/routes/conversations/[id]/+page.svelte

Lines changed: 61 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929
import SvgIcon from "$lib/SvgIcon.svelte";
3030
import DialogConfirm from "$lib/DialogConfirm.svelte";
3131
import ConversationHeader from "./ConversationHeader.svelte";
32+
import Avatar from "$lib/Avatar.svelte";
3233
3334
const conversationStore = getContext<{ getStore: () => ConversationStore }>(
3435
"conversationStore",
@@ -69,6 +70,8 @@
6970
let deleteMessageActionHashB64: undefined | ActionHashB64 = undefined;
7071
let isDeletingMessage = false;
7172
73+
let showAvatarDialog = false;
74+
7275
let isFirstConfigLoad = true;
7376
let isFirstProfilesLoad = true;
7477
let isFirstLoadMessages = true;
@@ -232,6 +235,33 @@
232235
</script>
233236

234237
<Header backUrl="/conversations">
238+
<!-- Left slot: Back button + Avatar that opens dialog on click -->
239+
<div slot="left" class="flex items-center">
240+
<ButtonIconBare
241+
on:click={() => goto('/conversations')}
242+
icon="caretLeft"
243+
moreClasses="!h-[16px] !w-[16px] text-base"
244+
moreClassesButton="p-4"
245+
/>
246+
<button class="flex items-center" on:click={() => showAvatarDialog = true}>
247+
{#if $conversation.dnaProperties.privacy === Privacy.Private}
248+
<div class="flex -space-x-1">
249+
{#each $joined.list
250+
.filter(([agentPubKeyB64]) => agentPubKeyB64 !== myPubKeyB64)
251+
.slice(0, 2) as [agentPubKeyB64] (agentPubKeyB64)}
252+
<Avatar cellIdB64={$page.params.id} {agentPubKeyB64} size={40} moreClasses="ring-2 ring-surface-100-800-token" />
253+
{/each}
254+
</div>
255+
{:else if $conversation.config?.image}
256+
<img
257+
src={$conversation.config.image}
258+
alt="Conversation"
259+
class="h-10 w-10 rounded-full object-cover"
260+
/>
261+
{/if}
262+
</button>
263+
</div>
264+
235265
<h1 slot="center" class="overflow-hidden text-ellipsis whitespace-nowrap p-4 text-center">
236266
{$conversationTitle}
237267
</h1>
@@ -275,7 +305,7 @@
275305
<ConversationMessages
276306
loadingTop={loadingMessagesOld}
277307
cellIdB64={$page.params.id}
278-
messages={$messages.list.reverse()}
308+
messages={[...$messages.list].reverse()}
279309
on:delete={(e) => {
280310
deleteMessageActionHashB64 = e.detail;
281311
showDeleteDialog = true;
@@ -304,3 +334,33 @@
304334
>
305335
<p>{$t("common.delete_message_dialog_message")}</p>
306336
</DialogConfirm>
337+
338+
<!-- Avatar Dialog for larger view -->
339+
{#if showAvatarDialog}
340+
<div
341+
class="fixed inset-0 z-50 flex items-center justify-center bg-black/70"
342+
on:click={() => showAvatarDialog = false}
343+
on:keydown={(e) => e.key === 'Escape' && (showAvatarDialog = false)}
344+
role="button"
345+
tabindex="0"
346+
>
347+
<div class="flex flex-col items-center gap-6 p-4">
348+
{#if $conversation.dnaProperties.privacy === Privacy.Private}
349+
<div class="flex items-center gap-6">
350+
{#each $joined.list
351+
.filter(([agentPubKeyB64]) => agentPubKeyB64 !== myPubKeyB64)
352+
.slice(0, 2) as [agentPubKeyB64] (agentPubKeyB64)}
353+
<Avatar cellIdB64={$page.params.id} {agentPubKeyB64} size={200} />
354+
{/each}
355+
</div>
356+
{:else if $conversation.config?.image}
357+
<img
358+
src={$conversation.config.image}
359+
alt="Conversation"
360+
class="h-52 w-52 rounded-full object-cover"
361+
/>
362+
{/if}
363+
<h2 class="text-2xl font-semibold text-white">{$conversationTitle}</h2>
364+
</div>
365+
</div>
366+
{/if}

0 commit comments

Comments
 (0)