feature/23-voice-room/poc #93

Merged
hodlbod merged 68 commits from feature/23-voice-room/poc into dev 2026-03-16 20:38:06 +00:00
2 changed files with 30 additions and 6 deletions
Showing only changes of commit de76cfd208 - Show all commits
+8 -6
View File
@@ -47,6 +47,8 @@
deriveSpaceMembers,
deriveUserRooms,
deriveOtherRooms,
deriveRoomsWithLivekit,
deriveRoomsNoText,
userSpaceUrls,
hasNip29,
deriveUserCanCreateRoom,
@@ -55,8 +57,6 @@
notificationSettings,
deriveShouldNotify,
displayRoom,
roomHasLivekit,
roomIsNoText,
} from "@app/core/state"
import {setSpaceNotifications} from "@app/core/commands"
import {pushModal} from "@app/util/modal"
@@ -72,6 +72,8 @@
const calendarPath = makeSpacePath(url, "calendar")
const userRooms = deriveUserRooms(url)
const otherRooms = deriveOtherRooms(url)
const roomsWithLivekit = deriveRoomsWithLivekit(url)
const roomsNoText = deriveRoomsNoText(url)
const members = deriveSpaceMembers(url)
const userIsAdmin = deriveUserIsSpaceAdmin(url)
const reports = deriveEventsForUrl(url, [{kinds: [REPORT]}])
@@ -260,10 +262,10 @@
<SecondaryNavHeader>Your Rooms</SecondaryNavHeader>
{/if}
{#each $userRooms as h (h)}
{#if !roomIsNoText(url, h)}
{#if !$roomsNoText.has(h)}
<SpaceMenuRoomItem notify {replaceState} {url} {h} />
{/if}
{#if roomHasLivekit(url, h)}
{#if $roomsWithLivekit.has(h)}
<VoiceRoomItem {url} {h} />
{/if}
{/each}
@@ -284,10 +286,10 @@
</label>
{/if}
{#each $roomSearch.searchValues(term) as h (h)}
{#if !roomIsNoText(url, h)}
{#if !$roomsNoText.has(h)}
<SpaceMenuRoomItem {replaceState} {url} {h} />
{/if}
{#if roomHasLivekit(url, h)}
{#if $roomsWithLivekit.has(h)}
<VoiceRoomItem {url} {h} />
{/if}
hodlbod marked this conversation as resolved Outdated
Outdated
Review

I think we talked about putting voice rooms below, separate from text rooms, is that right? I can't remember, but I think it would make sense for any room with livekit support to go there instead of in the text room area regardless of whether the room has text support.

I think we talked about putting voice rooms below, separate from text rooms, is that right? I can't remember, but I think it would make sense for any room with livekit support to go there instead of in the text room area regardless of whether the room has text support.
Outdated
Review

I don't love the labels I landed on but see what you think of the current take:
"Your Rooms"
{ favorited voice and text}
"Other Rooms"
{ text rooms}
Voice Rooms
{ voice rooms}

Or when the user has no favorited rooms it looks like:
"Rooms"
{ text rooms}
Voice Rooms
{ voice rooms}

Idk if you want to say "Text Rooms" or "Chat Rooms" or something. Those feel quite wordy for menu headings to me though.

I don't love the labels I landed on but see what you think of the current take: "Your Rooms" { favorited voice and text} "Other Rooms" { text rooms} Voice Rooms { voice rooms} Or when the user has no favorited rooms it looks like: "Rooms" { text rooms} Voice Rooms { voice rooms} Idk if you want to say "Text Rooms" or "Chat Rooms" or something. Those feel quite wordy for menu headings to me though.
Outdated
Review

This surfaces another weird consequence of rooms that are "livekit" but not "no-text": currently favoriting either the text or vioce channel pulls both into the "Your Rooms" section.

This surfaces another weird consequence of rooms that are "livekit" but not "no-text": currently favoriting either the text or vioce channel pulls both into the "Your Rooms" section.
Outdated
Review

That's probably ok, I like how the labels look.

That's probably ok, I like how the labels look.
{/each}
+22
View File
3
@@ -663,6 +663,28 @@ export const displayRoom = (url: string, h: string) => getRoom(makeRoomId(url, h
export const roomComparator = (url: string) => (h: string) => displayRoom(url, h).toLowerCase()
export const deriveRoomsWithLivekit = (url: string) =>
derived(roomsById, $roomsById => {
hodlbod marked this conversation as resolved Outdated
Outdated
Review

It looks like these utilities aren't used

It looks like these utilities aren't used
const set = new Set<string>()
for (const room of $roomsById.values()) {
if (room.url === url && room.event?.tags?.some(t => t[0] === "livekit")) {
set.add(room.h)
}
}
return set
})
export const deriveRoomsNoText = (url: string) =>
derived(roomsById, $roomsById => {
const set = new Set<string>()
for (const room of $roomsById.values()) {
if (room.url === url && room.event?.tags?.some(t => t[0] === "no-text")) {
set.add(room.h)
}
}
return set
})
export const roomHasLivekit = (url: string, h: string) => {
const room = getRoom(makeRoomId(url, h))
return room?.event?.tags?.some(t => t[0] === "livekit") ?? false