Skip to content

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

Python
3.6 KB
Raw Blame
<!-- Desktop Summary Tab. Rebuilt as a flex column shell so the
     editing mode keeps its textarea at a FIXED full-height surface
     with the textarea's own scrollbar handling overflow — the
     previous layout had an outer overflow-y-auto whose content
     stretched with the textarea's scrollHeight, pushing the
     editing-hint and the tab-bar save buttons offscreen for long
     summaries. The reading view still scrolls inside the same flex
     surface via .tab-rail-scroll.
     Per-tab action buttons (Edit / Save) live in the right-rail
     tab-bar action toolbar — that's why there's no save bar here. -->
<div v-if="selectedTab === 'summary'" class="h-full flex flex-col overflow-hidden">

    <!-- In progress -->
    <div v-if="selectedRecording.status === 'SUMMARIZING'" class="flex-1 overflow-y-auto px-4 py-4">
        <div class="empty">
            <div class="spinner spinner--lg"></div>
            <div class="empty__title" v-text="t('summary.summaryInProgress')"></div>
        </div>
    </div>

    <!-- Empty state -->
    <div v-else-if="!selectedRecording.summary" class="flex-1 overflow-y-auto px-4 py-4">
        <div class="empty">
            <div class="empty__icon"><i class="fas fa-file-alt"></i></div>
            <div class="empty__title" v-text="t('summary.noSummary')"></div>
            <div v-if="processedTranscription.isError" class="banner banner--info" style="margin-top: var(--sp-2);">
                <i class="fas fa-info-circle"></i>
                <span v-text="t('summary.needsTranscription')"></span>
            </div>
            <div class="flex items-center gap-2" style="margin-top: var(--sp-3);">
                <button class="btn btn--primary"
                        @click="generateSummary()"
                        :disabled="processedTranscription.isError">
                    <i class="fas fa-magic"></i>
                    <span>${ t('summary.generateSummary') }</span>
                </button>
                <button v-if="!processedTranscription.isError"
                        class="btn btn--ghost btn--icon"
                        @click="openCustomizeSummaryModal"
                        :title="t('summary.customizePrompt') || 'Customise prompt'">
                    <i class="fas fa-sliders-h"></i>
                </button>
            </div>
        </div>
    </div>

    <!-- Reading mode — single flex-1 scroll surface, content padding
         is inside so the scrollbar runs the full edge. -->
    <div v-else-if="!editingSummary"
         class="flex-1 overflow-y-auto px-4 py-4 prose-flush"
         v-html="summaryHtml">
    </div>

    <!-- Editing mode — EasyMDE is mounted onto the textarea below.
         The .markdown-editor-container wrapper is what hooks all the
         existing theme + height CSS (.markdown-editor-container
         .EasyMDEContainer { ... } in styles.css) — without it the
         editor falls back to its un-themed default appearance with
         auto-grow height that extends past the viewport. -->
    <div v-else class="flex-1 flex flex-col overflow-hidden px-4 py-4">
        <div class="markdown-editor-container flex-1 min-h-0 flex flex-col">
            <textarea ref="summaryMarkdownEditor"
                      v-model="selectedRecording.summary"
                      :placeholder="t('form.enterSummaryMarkdown')">
            </textarea>
        </div>
        <div class="t-meta" style="margin-top: var(--sp-2); flex-shrink: 0;">
            <i class="fas fa-circle" style="font-size: 6px; color: var(--text-accent); margin-right: var(--sp-1);"></i>
            <span>${ t('summary.editingSaveHint') }</span>
        </div>
    </div>
</div>