From 0c160a162d58023a48a4a4358f04eb88f5b1655d Mon Sep 17 00:00:00 2001 From: Jon Staab Date: Sat, 26 Sep 2026 01:17:20 -0700 Subject: [PATCH] Re-anchor room and space chat on a keyed remount only, parse the at param once, and derive the locked-room check in RoomChat --- .agents/skills/flotilla-views/SKILL.md | 3 +- src/app/components/RoomChat.svelte | 6 ++- src/app/components/RoomTranscript.svelte | 58 +++++++-------------- src/routes/spaces/[relay]/chat/+page.svelte | 5 +- 4 files changed, 29 insertions(+), 43 deletions(-) diff --git a/.agents/skills/flotilla-views/SKILL.md b/.agents/skills/flotilla-views/SKILL.md index 1be87777..24eec9a2 100644 --- a/.agents/skills/flotilla-views/SKILL.md +++ b/.agents/skills/flotilla-views/SKILL.md @@ -56,7 +56,8 @@ const url = decodeRelay(relay) That is safe because the layouts remount their children when a param changes. `spaces/+layout.svelte` keys on `relay`, `spaces/[relay]/+layout.svelte` and -`chat/+layout.svelte` key on the pathname, `[h]/+layout.svelte` keys on `?at=`, and +`chat/+layout.svelte` key on the pathname, `[h]/+layout.svelte` and the space chat page key on +`?at=` and `?event=` (which is how a room transcript re-anchors on a permalink), and `people/[npub]/+layout.svelte` keys on `npub`. A new param-bearing route needs the same `{#key}`, or its page has to derive from `$page` instead. Routes read `$page` from the deprecated `$app/stores`; only the two modal modules use `page` from `$app/state`. diff --git a/src/app/components/RoomChat.svelte b/src/app/components/RoomChat.svelte index ca88ae5f..c6780e13 100644 --- a/src/app/components/RoomChat.svelte +++ b/src/app/components/RoomChat.svelte @@ -91,6 +91,9 @@ const membershipStatus = h ? deriveUserRoomMembershipStatus(url, h) : readable(MembershipStatus.Granted) + const locked = $derived( + $room?.meta?.isPrivate() && $membershipStatus !== MembershipStatus.Granted, + ) // Restart the feed now that we're a member const onJoin = () => transcript?.restart() @@ -193,6 +196,7 @@
- {#if $room?.meta?.isPrivate() && $membershipStatus !== MembershipStatus.Granted} + {#if locked} {:else if h && $room?.meta?.isRestricted() && $membershipStatus !== MembershipStatus.Granted}
diff --git a/src/app/components/RoomTranscript.svelte b/src/app/components/RoomTranscript.svelte index d8447e00..2351fe20 100644 --- a/src/app/components/RoomTranscript.svelte +++ b/src/app/components/RoomTranscript.svelte @@ -1,5 +1,5 @@