feat(dashboard): add Show transcript and Summarize lesson buttons in lesson view (#748)
* feat(dashboard): add lesson transcript and summarize actions in view mode Add Show transcript and Summarize lesson outline buttons beneath lesson videos in view mode. Show transcript opens the existing transcript side panel when an uploaded video has a transcript. Summarize lesson appears on every lesson and sends a contextual prompt to the AI assistant. Co-authored-by: Rotimi Best <rotimi-best@users.noreply.github.com> * fix(dashboard): localize summarize lesson AI prompts Move hardcoded summarize prompt strings into translation keys so the prompt sent to the AI assistant follows the user's app language. Co-authored-by: Rotimi Best <rotimi-best@users.noreply.github.com> --------- Co-authored-by: Cursor Agent <cursoragent@cursor.com> Co-authored-by: Rotimi Best <rotimi-best@users.noreply.github.com>
This commit is contained in:
co-authored by
Rotimi Best
Cursor Agent
parent
3fbfa4b09f
commit
fdc19aac41
@@ -46,7 +46,8 @@
|
||||
Document,
|
||||
AddVideoModal,
|
||||
AddDocumentModal,
|
||||
LessonSettingsTab
|
||||
LessonSettingsTab,
|
||||
LessonSummarizeButton
|
||||
} from '$features/course/components/lesson';
|
||||
|
||||
import type { TLocale } from '@cio/db/types';
|
||||
@@ -179,6 +180,7 @@
|
||||
const viewModeComponents = $derived(getViewModeComponents(tabs));
|
||||
|
||||
const isMaterialsEmpty = $derived(tabs.every((tab) => tab.badgeValue === 0));
|
||||
const hasLessonVideos = $derived((lessonApi.lesson?.videos?.length ?? 0) > 0);
|
||||
|
||||
let timeoutId: NodeJS.Timeout | undefined;
|
||||
|
||||
@@ -524,6 +526,12 @@
|
||||
{:else if lessonApi.lesson && !isMaterialsEmpty}
|
||||
{#key lessonId}
|
||||
<div class="mb-20 flex w-full flex-col gap-2" in:fade={{ delay: 500 }} out:fade>
|
||||
{#if !hasLessonVideos}
|
||||
<div class="mb-2 flex flex-wrap gap-2">
|
||||
<LessonSummarizeButton {lessonId} />
|
||||
</div>
|
||||
{/if}
|
||||
|
||||
{#each viewModeComponents as Component, index (index)}
|
||||
<Component {mode} {lessonId} {courseId} />
|
||||
{/each}
|
||||
|
||||
Reference in New Issue
Block a user