Skip to content

Speakr is a personal, self-hosted web application designed for transcribing audio recordings

Python

Pass D part 3: chat section header now uses the tabs-bar primitive too (matching transcription/summary headers) — chat title-as-tab with message-count badge on the left, action toolbar (download, maximize, collapse) on the right; chat input swapped to .field, send button to .btn--primary --icon --lg, empty state and loading state use empty/spinner primitives; the recording-detail screen now reads as four sibling tab-bar sections (transcript / audio / summary-notes / chat) sharing one design language

Murtaza Nasirebde110c4e11
diff --git a/templates/components/detail/desktop-chat-section.html b/templates/components/detail/desktop-chat-section.html
index 263ac143..3af106b6 100644
--- a/templates/components/detail/desktop-chat-section.html
+++ b/templates/components/detail/desktop-chat-section.html
@@ -1,49 +1,54 @@
-<!-- Desktop Chat Section -->
+<!-- Desktop Chat Section (design system v1) — sits at the bottom of the
+ right rail; header uses the same tabs-bar primitive as Summary/Notes
+ so the visual rhythm continues; chat input uses .field + .btn--primary. -->
<div class="border-t border-[var(--border-primary)] flex flex-col" :class="{'flex-1 overflow-hidden': isChatMaximized}">
- <!-- Chat Toggle -->
- <div class="bg-[var(--bg-tertiary)] px-4 py-3 hover:bg-[var(--bg-accent-hover)] transition-colors flex items-center">
- <button @click="() => { showChat = !showChat; if (!showChat) isChatMaximized = false; }"
- class="flex-1 text-left flex items-center">
- <span class="font-medium flex items-center">
- <i class="fas fa-comments mr-2"></i>
- ${ t('chat.chatWithTranscription') }
+ <!-- Chat header (tabs-bar pattern, clickable to toggle visibility) -->
+ <div class="tabs-bar px-4" style="cursor: pointer;"
+ @click="() => { showChat = !showChat; if (!showChat) isChatMaximized = false; }">
+ <div class="tabs">
+ <span class="tab is-active" style="cursor: pointer;">
+ <i class="fas fa-comments" style="font-size: 13px; opacity: 0.7;"></i>
+ <span>${ t('chat.chatWithTranscription') }</span>
+ <span v-if="chatMessages.length > 0" class="tab__count">${ chatMessages.length }</span>
</span>
- </button>
- <div class="flex items-center gap-2">
+ </div>
+ <div class="tabs-bar__actions">
<button v-if="chatMessages.length > 0"
- @click="downloadChat"
- class="p-1 text-[var(--text-muted)] hover:text-[var(--text-primary)] transition-colors"
+ @click.stop="downloadChat"
+ class="btn btn--icon"
:title="t('buttons.downloadChat')">
- <i class="fas fa-download text-sm"></i>
+ <i class="fas fa-download"></i>
</button>
- <button @click="toggleChatMaximize"
- class="p-1 text-[var(--text-muted)] hover:text-[var(--text-primary)] transition-colors"
+ <button @click.stop="toggleChatMaximize"
+ class="btn btn--icon"
:title="isChatMaximized ? t('tooltips.restoreChat') : t('tooltips.maximizeChat')">
- <i :class="['fas text-sm', isChatMaximized ? 'fa-compress' : 'fa-expand']"></i>
+ <i :class="['fas', isChatMaximized ? 'fa-compress' : 'fa-expand']"></i>
</button>
- <button @click="() => { showChat = !showChat; if (!showChat) isChatMaximized = false; }"
- class="p-1 text-[var(--text-muted)] hover:text-[var(--text-primary)]">
+ <button class="btn btn--icon"
+ @click.stop="() => { showChat = !showChat; if (!showChat) isChatMaximized = false; }">
<i :class="['fas transition-transform duration-200', showChat ? 'fa-chevron-down' : 'fa-chevron-up']"></i>
</button>
</div>
</div>
- <!-- Chat Content -->
+ <!-- Chat content -->
<div v-if="showChat" class="flex flex-col relative" :class="isChatMaximized ? 'flex-1 overflow-hidden' : 'max-h-96'">
- <!-- Clear button - fixed at top right -->
+ <!-- Clear button anchored top-right -->
<button v-if="chatMessages.length > 0"
@click="clearChat"
- class="absolute top-2 right-2 p-1 text-[var(--text-muted)] opacity-60 hover:opacity-100 hover:text-[var(--text-danger)] rounded transition-all duration-200 z-20"
+ class="btn btn--icon btn--sm absolute"
+ style="top: var(--sp-2); right: var(--sp-2); z-index: 20; color: var(--text-muted);"
title="Clear chat">
- <i class="fas fa-times text-xs"></i>
+ <i class="fas fa-times"></i>
</button>
- <!-- Chat Messages -->
+ <!-- Messages -->
<div ref="chatMessagesRef"
- class="flex-1 overflow-y-auto p-4 space-y-4 bg-[var(--bg-secondary)]">
- <div v-if="chatMessages.length === 0" class="text-center py-8">
- <i class="fas fa-robot text-3xl text-[var(--text-muted)] mb-3"></i>
- <p class="text-[var(--text-muted)]" v-text="t('help.askAboutTranscription')"></p>
+ class="flex-1 overflow-y-auto px-4 py-4 space-y-4">
+ <div v-if="chatMessages.length === 0" class="empty">
+ <div class="empty__icon"><i class="fas fa-robot"></i></div>
+ <div class="empty__title" v-text="t('help.askAboutTranscription')"></div>
+ <div class="empty__body">Type a question below. Markdown supported.</div>
</div>
<div v-for="(message, index) in chatMessages"
@@ -56,11 +61,12 @@
<!-- Copy button for assistant messages -->
<button v-if="message.role === 'assistant'"
@click="copyMessage(message.content, $event)"
- class="absolute top-2 right-2 p-1 text-[var(--text-muted)] hover:text-[var(--text-primary)] hover:bg-[var(--bg-tertiary)] rounded transition-all duration-200"
+ class="btn btn--icon btn--sm absolute"
+ style="top: var(--sp-2); right: var(--sp-2);"
:title="t('buttons.copyMessage')">
- <i class="fas fa-copy text-sm"></i>
+ <i class="fas fa-copy"></i>
</button>
- <!-- Show thinking content if available -->
+ <!-- Thinking content (collapsible) -->
<div v-if="message.thinking && message.role === 'assistant'" class="mb-2">
<button @click="message.thinkingExpanded = !message.thinkingExpanded"
class="text-xs text-[var(--text-muted)] hover:text-[var(--text-secondary)] flex items-center gap-1">
@@ -69,7 +75,7 @@
<span class="text-[var(--text-muted)]">(${message.thinking.split('\n').length} lines)</span>
</button>
<div v-if="message.thinkingExpanded"
- class="mt-2 p-3 bg-[var(--bg-tertiary)] border border-[var(--border-secondary)] rounded-lg text-xs text-[var(--text-muted)] max-h-64 overflow-y-auto">
+ class="mt-2 p-3 bg-[var(--bg-tertiary)] border border-[var(--border-primary)] rounded-md text-xs text-[var(--text-muted)] max-h-64 overflow-y-auto">
<pre class="whitespace-pre-wrap font-mono">${message.thinking}</pre>
</div>
</div>
@@ -78,38 +84,38 @@
<div v-else class="whitespace-pre-wrap">${message.content}</div>
</div>
- <div v-if="isChatLoading" class="ai-message">
- <i class="fas fa-spinner fa-spin mr-2"></i>
- ${ t('chat.thinking') }
+ <div v-if="isChatLoading" class="ai-message flex items-center gap-2">
+ <div class="spinner"></div>
+ <span v-text="t('chat.thinking')"></span>
</div>
</div>
- <!-- Chat Input -->
- <div class="border-t border-[var(--border-primary)] p-4 bg-[var(--bg-tertiary)]">
- <div class="flex gap-2">
+ <!-- Chat input -->
+ <div class="border-t border-[var(--border-primary)] px-4 py-3">
+ <div class="flex gap-2 items-end">
<textarea v-model="chatInput"
ref="chatInputRef"
@keydown="handleChatKeydown"
:disabled="selectedRecording.status !== 'COMPLETED' || processedTranscription.isError"
:placeholder="t('chat.placeholderWithHint')"
- class="flex-1 px-3 py-2 bg-[var(--bg-input)] border border-[var(--border-secondary)] rounded-lg resize-none focus:outline-none focus:ring-2 focus:ring-[var(--ring-focus)] text-sm"
+ class="field"
+ style="resize: none;"
rows="2">
</textarea>
<button @click="sendChatMessage"
:disabled="!chatInput.trim() || isChatLoading || selectedRecording.status !== 'COMPLETED' || processedTranscription.isError"
- class="px-4 py-2 bg-[var(--bg-button)] text-[var(--text-button)] rounded-lg hover:bg-[var(--bg-button-hover)] transition-colors disabled:opacity-50 disabled:cursor-not-allowed">
+ class="btn btn--primary btn--icon btn--lg"
+ :title="t('buttons.send') || 'Send'">
<i class="fas fa-paper-plane"></i>
</button>
</div>
- <p v-if="processedTranscription.isError"
- class="text-xs text-amber-500 mt-2">
- <i class="fas fa-exclamation-triangle mr-1"></i>
- ${ t('chat.cannotChatTranscriptionFailed') }
- </p>
- <p v-else-if="selectedRecording.status !== 'COMPLETED'"
- class="text-xs text-[var(--text-muted)] mt-2">
- ${ t('chat.availableAfterTranscription') }
- </p>
+ <div v-if="processedTranscription.isError" class="t-meta mt-2 flex items-center gap-1.5" style="color: var(--text-danger);">
+ <i class="fas fa-exclamation-triangle"></i>
+ <span v-text="t('chat.cannotChatTranscriptionFailed')"></span>
+ </div>
+ <div v-else-if="selectedRecording.status !== 'COMPLETED'" class="t-meta mt-2">
+ <span v-text="t('chat.availableAfterTranscription')"></span>
+ </div>
</div>
</div>
</div>