feat: chat layer tracer: bootstrap, channel list, messages, composer

- createChatClient: bearer auth, one refresh-and-retry on 401, 422 field errors
- useChat over useState: host bootstrap, open a channel, send
- ChatPage, ChatChannelList, ChatMessageList, ChatComposer
- runtime config chat.apiBase, public.chat.{apiBase,channelsApiBase,botsApiBase,hostApiBase}
This commit is contained in:
Jakub Zych
2026-10-31 13:40:39 +01:00
commit fa6f9950a6
21 changed files with 9328 additions and 0 deletions

View File

@@ -0,0 +1,25 @@
<script setup lang="ts">
// The seeded channels of the community. There is no create button: members
// join and leave the channels the host has.
const { t } = useI18n()
const chat = useChat()
</script>
<template>
<nav class="chat-sidebar" :aria-label="t('chat.channels')">
<h2 class="chat-sidebar-title">{{ t('chat.channels') }}</h2>
<ul class="chat-channels">
<li v-for="c in chat.channels.value" :key="c.id">
<button
class="chat-channel"
type="button"
:data-channel-slug="c.slug"
:aria-current="chat.activeId.value === c.conversation_id ? 'true' : undefined"
@click="chat.open(c)"
>
# {{ c.name }}
</button>
</li>
</ul>
</nav>
</template>