diff --git a/src/components/ai/note-studio-panel.tsx b/src/components/ai/note-studio-panel.tsx index 5ce84ae..808438f 100644 --- a/src/components/ai/note-studio-panel.tsx +++ b/src/components/ai/note-studio-panel.tsx @@ -6,13 +6,13 @@ import { getMyCourses } from "@/api/reports"; import { formatApiError, type CourseNote } from "@/api/client"; import { PodcastPanel } from "@/components/notes/podcast-panel"; import { RagOutputsPanel } from "@/components/notes/rag-outputs-panel"; +import { StudioOutputLibrary } from "@/components/ai/studio-output-library"; import { EmptyState } from "@/components/ui/empty-state"; import { ErrorAlert } from "@/components/ui/error-alert"; import { IconSparkles, IconWaveform } from "@/components/ui/icons"; import { Label } from "@/components/ui/label"; import { PageSpinner } from "@/components/ui/page-spinner"; import { SearchableSelect } from "@/components/ui/searchable-select"; -import { Tabs, TabsContent, TabsList, TabsTrigger } from "@/components/ui/tabs"; import { useAuth } from "@/stores/auth-context"; import { useT } from "@/stores/preferences-context"; import { courseNoteFiles } from "@/lib/note-source"; @@ -26,7 +26,7 @@ export function NoteStudioPanel() { const t = useT(); const auth = useAuth(); const [selectedId, setSelectedId] = createSignal(""); - const [activeTab, setActiveTab] = createSignal<"summary" | "podcast">("summary"); + let outputsSection: HTMLElement | undefined; const [notes, { refetch }] = createResource( () => auth.user()?.role ?? null, async (role) => { @@ -55,6 +55,10 @@ export function NoteStudioPanel() { const user = auth.user(); return !!note && !!user && (hasMinRole(user.role, "manager") || note.courseCreatorId === user.id); }; + const selectLibraryNote = (noteId: string) => { + setSelectedId(noteId); + requestAnimationFrame(() => outputsSection?.scrollIntoView({ behavior: "smooth", block: "start" })); + }; return ( }> @@ -66,23 +70,35 @@ export function NoteStudioPanel() { when={(notes()?.length ?? 0) > 0} fallback={} > -
-
- - +
+
+
+
+ +
+
+

{t("aiHub.tab.studio")}

+

{t("aiHub.tab.studio")}

+

{t("aiHub.description")}

+
+
+
+ + +
-
+
+
@@ -93,36 +109,35 @@ export function NoteStudioPanel() { } > {(note) => ( - setActiveTab(value as "summary" | "podcast")} - class="w-full space-y-4" - > - - - - {t("aiStudio.tab.summary")} - - - - {t("aiStudio.tab.podcast")} - - - +
+
+
+

{t("aiStudio.outputs.title")}

+

{note().title}

+

{t("aiStudio.outputs.description")}

+
+ + {note().courseTitle} + +
+
- - - - - + +
+
)} + ({ id: note.id, title: note.title, courseTitle: note.courseTitle }))} + selectedId={selectedId()} + onSelect={selectLibraryNote} + />
diff --git a/src/components/ai/studio-output-library.test.tsx b/src/components/ai/studio-output-library.test.tsx new file mode 100644 index 0000000..f19b3d3 --- /dev/null +++ b/src/components/ai/studio-output-library.test.tsx @@ -0,0 +1,92 @@ +import { cleanup, fireEvent, render, screen, waitFor } from "@solidjs/testing-library"; +import { afterEach, beforeEach, describe, expect, it, vi } from "vitest"; +import type { PodcastJobSummary, RagOutput } from "@/api/client"; +import { StudioOutputLibrary } from "@/components/ai/studio-output-library"; +import { PreferencesProvider } from "@/stores/preferences-context"; + +const podcastApi = vi.hoisted(() => ({ listPodcastJobs: vi.fn() })); +const courseNotesApi = vi.hoisted(() => ({ getCourseNoteRag: vi.fn() })); + +vi.mock("@/api/podcast", () => podcastApi); +vi.mock("@/api/course-notes", () => courseNotesApi); + +const notes = [ + { id: "note-1", title: "Hücre", courseTitle: "Biyoloji" }, + { id: "note-2", title: "Kuvvet", courseTitle: "Fizik" }, + { id: "note-3", title: "Polinomlar", courseTitle: "Matematik" }, +]; + +function page(items: T[]) { + return { items, total: items.length, limit: 100, offset: 0 }; +} + +function podcast(over: Partial): PodcastJobSummary { + return { + job_id: "job-1", + state: "done", + format: "duz_okuma", + source_id: "note-1", + source_title: "Hücre", + created_at: Date.UTC(2026, 0, 2), + finished_at: Date.UTC(2026, 0, 2), + duration_secs: 120, + error_code: null, + ...over, + }; +} + +function summary(noteId: string): RagOutput { + return { + id: `rag-${noteId}`, + course_note: noteId, + course: "course-1", + sources: [], + payload: { summary: "Hazır" }, + generated_at: Date.UTC(2026, 0, 3), + }; +} + +describe("StudioOutputLibrary", () => { + beforeEach(() => { + localStorage.setItem("hezarfen.locale", "tr"); + podcastApi.listPodcastJobs.mockResolvedValue(page([ + podcast({ job_id: "job-1" }), + podcast({ job_id: "job-2" }), + podcast({ job_id: "job-failed", source_id: "note-3", state: "failed" }), + ])); + courseNotesApi.getCourseNoteRag.mockImplementation(async (noteId: string) => + page(noteId === "note-2" ? [summary(noteId)] : []), + ); + }); + + afterEach(() => { + cleanup(); + localStorage.clear(); + vi.clearAllMocks(); + }); + + it("shows only notes with finished outputs and selects one directly", async () => { + const onSelect = vi.fn(); + + render(() => ( + + + + )); + + await waitFor(() => expect(screen.getByText("Hücre")).toBeTruthy()); + expect(screen.getByText("Kuvvet")).toBeTruthy(); + expect(screen.queryByText("Polinomlar")).toBeNull(); + expect(screen.getByText("2 podcast")).toBeTruthy(); + expect(screen.getByText("Yapay zekâ özeti")).toBeTruthy(); + expect(screen.getByText("2 not")).toBeTruthy(); + + const selected = screen.getByRole("button", { name: /Hücre/ }); + expect(selected.getAttribute("aria-current")).toBe("true"); + + fireEvent.click(screen.getByRole("button", { name: /Kuvvet/ })); + expect(onSelect).toHaveBeenCalledWith("note-2"); + expect(podcastApi.listPodcastJobs).toHaveBeenCalledWith({ limit: 100 }); + expect(courseNotesApi.getCourseNoteRag).toHaveBeenCalledTimes(3); + }); +}); diff --git a/src/components/ai/studio-output-library.tsx b/src/components/ai/studio-output-library.tsx new file mode 100644 index 0000000..0922419 --- /dev/null +++ b/src/components/ai/studio-output-library.tsx @@ -0,0 +1,146 @@ +import { For, Show, Suspense, createMemo } from "solid-js"; +import { createResource } from "@/lib/create-resource"; +import { getCourseNoteRag } from "@/api/course-notes"; +import { listPodcastJobs } from "@/api/podcast"; +import { Badge } from "@/components/ui/badge"; +import { EmptyInline } from "@/components/ui/empty-inline"; +import { IconChevronRight, IconNote, IconSparkles, IconWaveform } from "@/components/ui/icons"; +import { PageSpinner } from "@/components/ui/page-spinner"; +import { cn } from "@/lib/cn"; +import { useT } from "@/stores/preferences-context"; + +export type StudioLibraryNote = { + id: string; + title: string; + courseTitle: string; +}; + +type StudioLibraryItem = StudioLibraryNote & { + podcastCount: number; + hasSummary: boolean; + latestAt: number; +}; + +const LIBRARY_LIMIT = 100; + +export function StudioOutputLibrary(props: { + notes: StudioLibraryNote[]; + selectedId: string; + onSelect: (noteId: string) => void; +}) { + const t = useT(); + const source = createMemo(() => props.notes.map((note) => note.id).join(",")); + const [items] = createResource(source, async (): Promise => { + const [podcastResult, ...summaryResults] = await Promise.allSettled([ + listPodcastJobs({ limit: LIBRARY_LIMIT }), + ...props.notes.map((note) => getCourseNoteRag(note.id, { limit: 1 })), + ]); + const podcasts = podcastResult.status === "fulfilled" ? podcastResult.value.items : []; + const podcastsByNote = new Map(); + + for (const podcast of podcasts) { + if (podcast.state !== "done") continue; + const current = podcastsByNote.get(podcast.source_id) ?? { count: 0, latestAt: 0 }; + podcastsByNote.set(podcast.source_id, { + count: current.count + 1, + latestAt: Math.max(current.latestAt, podcast.finished_at ?? podcast.created_at), + }); + } + + return props.notes + .map((note, index): StudioLibraryItem | null => { + const summaryResult = summaryResults[index]; + const summary = summaryResult?.status === "fulfilled" ? summaryResult.value.items[0] : undefined; + const podcast = podcastsByNote.get(note.id); + if (!summary && !podcast) return null; + return { + ...note, + podcastCount: podcast?.count ?? 0, + hasSummary: !!summary, + latestAt: Math.max(summary?.generated_at ?? 0, podcast?.latestAt ?? 0), + }; + }) + .filter((item): item is StudioLibraryItem => item != null) + .sort((a, b) => b.latestAt - a.latestAt); + }); + + return ( +
+
+
+ + + +
+

{t("aiStudio.library.title")}

+

{t("aiStudio.library.description")}

+
+
+ 0}> + + {t("aiStudio.library.count", { count: items()?.length ?? 0 })} + + +
+ +
}> + 0} + fallback={ +
+ +
+ } + > +
    + + {(item) => ( +
  • + +
  • + )} +
    +
+
+ +
+ ); +} diff --git a/src/components/insights/insight-module-views.tsx b/src/components/insights/insight-module-views.tsx index b841d79..ab2908f 100644 --- a/src/components/insights/insight-module-views.tsx +++ b/src/components/insights/insight-module-views.tsx @@ -1,10 +1,12 @@ -import { For, Show, type JSX } from "solid-js"; +import { For, Show, createSignal, type JSX } from "solid-js"; import { Badge } from "@/components/ui/badge"; import { detailText, dimensionLabel, type InsightDetailKey } from "@/i18n/insights-detail"; import type { Locale } from "@/i18n/messages"; import { cn } from "@/lib/cn"; import { formatDateTime } from "@/lib/format"; import { isRecord, type UnknownRecord } from "@/lib/is-record"; +import { SidePanel } from "@/components/ui/side-panel"; +import { Table, TableBody, TableCell, TableHead, TableHeader, TableRow } from "@/components/ui/table"; import { usePreferences } from "@/stores/preferences-context"; /** @@ -236,7 +238,7 @@ const BAND_KEYS: Record = { insufficient_data: "marks.band.insufficient_data", }; -function MarksCourseCard(props: { id: string; statRaw: unknown; courseTitle: CourseTitle; index: number }) { +function MarksCourseDetail(props: { id: string; statRaw: unknown; courseTitle: CourseTitle; index: number }) { const stat = () => obj(props.statRaw); const placement = () => obj(stat().placement); const trend = () => obj(stat().trend); @@ -356,23 +358,95 @@ function MarksCourseCard(props: { id: string; statRaw: unknown; courseTitle: Cou function MarksView(props: { value: Rec; courseTitle: CourseTitle }) { const courses = () => Object.entries(obj(props.value.courses)); const contrast = () => obj(props.value.within_student_contrast); + const [selectedCourse, setSelectedCourse] = createSignal<{ id: string; stat: unknown; index: number } | null>(null); const contrastTitle = () => str(contrast().course_title) ?? (str(contrast().course) ? props.courseTitle(contrast().course as string) : null); + const selectedTitle = () => { + const selected = selectedCourse(); + return selected + ? str(obj(selected.stat).course_title) ?? courseLabel(selected.id, props.courseTitle, selected.index) + : ""; + }; + const placement = (statRaw: unknown) => obj(obj(statRaw).placement); + const trend = (statRaw: unknown) => obj(obj(statRaw).trend); + const bandLabel = (statRaw: unknown) => { + const band = str(placement(statRaw).band); + const key = (band === null ? undefined : BAND_KEYS[band]) ?? "marks.band.insufficient_data"; + return detailText(key); + }; + const bandVariant = (statRaw: unknown) => { + const band = str(placement(statRaw).band); + return band === "review" ? ("warning" as const) : band === "strong" ? ("success" as const) : ("secondary" as const); + }; + const trendLabel = (statRaw: unknown) => { + const current = trend(statRaw); + if (current.rising === true) return detailText("marks.rising"); + if (current.dropped === true) return detailText("marks.dropped"); + return current.available === true ? detailText("marks.trend") : detailText("marks.band.insufficient_data"); + }; return (
-
- - {([id, stat], index) => ( - - )} - +
+ + + + {detailText("marks.course")} + {detailText("marks.average")} + {detailText("marks.nMarks")} + {detailText("marks.placement")} + {detailText("marks.trend")} + + + + + {([id, stat], index) => ( + setSelectedCourse({ id, stat, index: index() })} + onKeyDown={(event) => { + if (event.key === "Enter" || event.key === " ") { + event.preventDefault(); + setSelectedCourse({ id, stat, index: index() }); + } + }} + > + {str(obj(stat).course_title) ?? courseLabel(id, props.courseTitle, index())} + {nText(obj(stat).average) ?? "—"} + {String(num(obj(stat).n_marks) ?? 0)} + {bandLabel(stat)} + {trendLabel(stat)} + + )} + + +
+ { if (!open) setSelectedCourse(null); }} + title={selectedTitle()} + description={detailText("marks.average")} + size="wide" + > + + {(selected) => ( + + )} + + +

{detailText("marks.contrast")}

(isRecord(value) ? value : {}); const num = (value: unknown): number | null => typeof value === "number" && Number.isFinite(value) ? value : null; -function ChartCard(props: { label: string; value: string; hint?: string }) { - return ( -
-

{props.label}

-

{props.value}

- -

{props.hint}

-
-
- ); -} - -function BarChart(props: { - items: Array<{ label: string; value: number | null; color?: string }>; - format?: (value: number) => string; -}) { - const max = () => Math.max(...props.items.map((item) => item.value ?? 0), 1); - const format = (value: number) => props.format?.(value) ?? String(value); - return ( -
- - {(item) => ( -
-
- {item.label} - - {item.value == null ? "—" : format(item.value)} - -
-
-
-
-
- )} - -
- ); -} - function AttendanceChart(props: { value: unknown; t: (key: string) => string }) { const overall = () => obj(obj(props.value).overall); const count = (key: string) => num(overall()[key]) ?? 0; const rate = () => num(overall().rate); + const segments = (): ProgressRingSegment[] => [ + { id: "present", label: props.t("insights.analysis.present"), value: count("present"), colorClass: "bg-success" }, + { id: "absent", label: props.t("insights.analysis.absent"), value: count("absent"), colorClass: "bg-destructive" }, + { id: "late", label: props.t("insights.analysis.late"), value: count("late"), colorClass: "bg-warning" }, + { id: "excused", label: props.t("insights.analysis.excused"), value: count("excused"), colorClass: "bg-info" }, + ]; return ( -
-
- - - -
- -
+ ); } function MarksChart(props: { value: unknown; t: (key: string) => string }) { const courses = () => Object.entries(obj(obj(props.value).courses)); - const items = () => courses().map(([id, raw]) => { + const items = (): ChartBarItem[] => courses().flatMap(([id, raw]) => { const stat = obj(raw); - return { label: String(stat.course_title ?? id).slice(0, 32), value: num(stat.average) }; + const value = num(stat.average); + return value == null ? [] : [{ + id, + label: String(stat.course_title ?? id).slice(0, 32), + value, + max: 100, + formattedValue: value.toLocaleString("tr-TR", { maximumFractionDigits: 1 }), + }]; }); - const averages = () => items().map((item) => item.value).filter((value): value is number => value != null); - const average = () => averages().length ? averages().reduce((sum, value) => sum + value, 0) / averages().length : null; return ( -
-
- - - -
- 0} fallback={}> - value.toLocaleString("tr-TR", { maximumFractionDigits: 1 })} /> - -
+ ); } @@ -106,21 +67,49 @@ function StudyChart(props: { value: unknown; t: (key: string) => string }) { const milliseconds = num(recent().total_focus_ms); return milliseconds == null ? null : milliseconds / 3_600_000; }; + const previous = () => obj(obj(props.value).previous_28d); + const focusItems = (): ChartBarItem[] => { + const currentHours = hours(); + const previousMs = num(previous().total_focus_ms); + const previousHours = previousMs == null ? null : previousMs / 3_600_000; + const items: ChartBarItem[] = []; + if (currentHours != null) { + items.push({ + id: "current", + label: props.t("insights.analysis.currentPeriod"), + value: currentHours, + formattedValue: currentHours.toLocaleString("tr-TR", { maximumFractionDigits: 1 }), + colorClass: "bg-primary", + }); + } + if (previousHours != null) { + items.push({ + id: "previous", + label: props.t("insights.analysis.previousPeriod"), + value: previousHours, + formattedValue: previousHours.toLocaleString("tr-TR", { maximumFractionDigits: 1 }), + colorClass: "bg-info", + }); + } + return items; + }; return ( -
-
- - - -
- value.toLocaleString("tr-TR", { maximumFractionDigits: 1 })} +
+ +
+
+
{props.t("insights.analysis.activeDays")}
+
{String(num(recent().active_days) ?? "—")}
+
+
+
{props.t("insights.analysis.sessions")}
+
{String(num(recent().n_stints) ?? "—")}
+
+
); } @@ -130,21 +119,21 @@ function SubmissionChart(props: { value: unknown; t: (key: string) => string }) const count = (key: string) => num(overall()[key]) ?? 0; const total = () => count("n"); const submittedRate = () => total() > 0 ? count("n_submitted") / total() : null; + const onTime = () => Math.max(0, count("n_submitted") - count("n_late")); + const segments = (): ProgressRingSegment[] => [ + { id: "on-time", label: props.t("insights.analysis.onTime"), value: onTime(), colorClass: "bg-success" }, + { id: "late", label: props.t("insights.analysis.late"), value: count("n_late"), colorClass: "bg-warning" }, + { id: "missing", label: props.t("insights.analysis.missing"), value: count("n_missing"), colorClass: "bg-destructive" }, + ]; return ( -
-
- - - -
- -
+ ); } @@ -162,17 +151,30 @@ function ModuleTab(props: { }; return ( }> -
-
-
-

{props.t(`insights.modules.${props.module}`)}

- {props.t("insights.analysis.visual")} +
+ {chart()} +
+ + + + + + + {props.t("insights.analysis.details")} + {props.t("insights.analysis.detailsHint")} + + + + + + + +
+
+ +
- {chart()} -
-
- -
+
); @@ -199,25 +201,28 @@ export function InsightStudentAnalysisTabs(props: { insight: StudentInsight }) { {t("insights.modules.submission")} - -
- - { - const values = Object.values(obj(obj(moduleValue("marks")).courses)).map((raw) => num(obj(raw).average)).filter((value): value is number => value != null); - return values.length ? (values.reduce((sum, value) => sum + value, 0) / values.length).toLocaleString("tr-TR", { maximumFractionDigits: 1 }) : "—"; - })()} /> - { - const milliseconds = num(obj(obj(moduleValue("study")).recent_28d).total_focus_ms); - return milliseconds == null ? "—" : `${(milliseconds / 3_600_000).toLocaleString("tr-TR", { maximumFractionDigits: 1 })} sa`; - })()} /> - { - const overall = obj(obj(moduleValue("submission")).overall); - const total = num(overall.n) ?? 0; - const submitted = num(overall.n_submitted) ?? 0; - return total > 0 ? `%${Math.round((submitted / total) * 100)}` : "—"; - })()} /> -
- + +
+
+
+ +

{t("insights.attention")}

+
+ 0} + fallback={} + > +
+ + {(item) =>
{item.fact}
} +
+
+
+
+
+ +
+
diff --git a/src/i18n/insights-detail.ts b/src/i18n/insights-detail.ts index 53c536b..ef008cd 100644 --- a/src/i18n/insights-detail.ts +++ b/src/i18n/insights-detail.ts @@ -42,6 +42,7 @@ export const insightsDetailTr = { "attendance.coursesEmpty": "Ders bazında devam kaydı yok.", // --- marks ------------------------------------------------------------- + "marks.course": "Ders", "marks.courseFallback": "Ders {n}", "marks.nMarks": "Not sayısı", "marks.average": "Ağırlıklı ortalama", diff --git a/src/i18n/messages.ts b/src/i18n/messages.ts index dd1381b..9f4b2ad 100644 --- a/src/i18n/messages.ts +++ b/src/i18n/messages.ts @@ -651,6 +651,16 @@ export type MessageKey = | "aiHub.tab.study" | "aiStudio.tab.podcast" | "aiStudio.tab.summary" + | "aiStudio.outputs.title" + | "aiStudio.outputs.description" + | "aiStudio.library.title" + | "aiStudio.library.description" + | "aiStudio.library.count" + | "aiStudio.library.empty" + | "aiStudio.library.emptyHint" + | "aiStudio.library.summary" + | "aiStudio.library.podcastCount" + | "aiStudio.library.open" | "today.titleStudent" | "today.inProgress" | "childHomework.title" @@ -1047,6 +1057,15 @@ export type MessageKey = | "insights.analysis.submittedRate" | "insights.analysis.submitted" | "insights.analysis.missing" + | "insights.analysis.currentSnapshot" + | "insights.analysis.courseComparison" + | "insights.analysis.currentPeriod" + | "insights.analysis.previousPeriod" + | "insights.analysis.periodComparison" + | "insights.analysis.onTime" + | "insights.analysis.details" + | "insights.analysis.detailsHint" + | "insights.analysis.detailsAction" | "insights.runs" | "insights.runsSubtitle" | "insights.runDay" @@ -2872,6 +2891,16 @@ const en: Dict = { "aiHub.tab.study": "Study", "aiStudio.tab.podcast": "Podcast creation", "aiStudio.tab.summary": "AI summary", + "aiStudio.outputs.title": "Studio outputs", + "aiStudio.outputs.description": "Select a lesson note and keep its summary and podcast together for quick access.", + "aiStudio.library.title": "Your generated library", + "aiStudio.library.description": "Return to notes that already have a summary or podcast, just like a NotebookLM studio.", + "aiStudio.library.count": "{count} notes", + "aiStudio.library.empty": "Your generated content will appear here", + "aiStudio.library.emptyHint": "Create a summary or podcast for a lesson note to add it to this area.", + "aiStudio.library.summary": "AI summary", + "aiStudio.library.podcastCount": "{count} podcasts", + "aiStudio.library.open": "Open note", "today.titleStudent": "Today's lessons", "today.inProgress": "On now", "childHomework.title": "Homework", @@ -3233,9 +3262,9 @@ const en: Dict = { "insights.sectionNotComputed": "This section was not computed.", "insights.noEvidence": "No supporting data.", "insights.modules.attendance": "Attendance", - "insights.modules.marks": "Marks", + "insights.modules.marks": "Report card", "insights.modules.study": "Study", - "insights.modules.submission": "Submissions", + "insights.modules.submission": "Homework", "insights.attention": "Attention signals", "insights.noAttention": "No attention signal.", "insights.schoolWide": "School-wide", @@ -3268,6 +3297,15 @@ const en: Dict = { "insights.analysis.submittedRate": "Submission rate", "insights.analysis.submitted": "Submitted", "insights.analysis.missing": "Missing", + "insights.analysis.currentSnapshot": "Current measured distribution", + "insights.analysis.courseComparison": "Course averages on a 100-point scale", + "insights.analysis.currentPeriod": "Last 28 days", + "insights.analysis.previousPeriod": "Previous 28 days", + "insights.analysis.periodComparison": "Focus time by period (hours)", + "insights.analysis.onTime": "On time", + "insights.analysis.details": "What supports this analysis?", + "insights.analysis.detailsHint": "Explore comparisons, trends and the limits of the available data.", + "insights.analysis.detailsAction": "Explore", "insights.runs": "Analysis runs", "insights.runsSubtitle": "Nightly and manually queued school analyses.", "insights.runDay": "Run day", @@ -5095,6 +5133,16 @@ const tr: Dict = { "aiHub.tab.study": "Çalışma", "aiStudio.tab.podcast": "Podcast oluşturma", "aiStudio.tab.summary": "Yapay zekâ özeti", + "aiStudio.outputs.title": "Hazır çıktılar", + "aiStudio.outputs.description": "Bir ders notu seçin; özetini ve podcast'ini hızlı erişim için aynı alanda üretin.", + "aiStudio.library.title": "Üretim kitaplığın", + "aiStudio.library.description": "NotebookLM'deki gibi, özeti veya podcast'i hazır olan notlarına doğrudan dön.", + "aiStudio.library.count": "{count} not", + "aiStudio.library.empty": "Ürettiğin içerikler burada görünecek", + "aiStudio.library.emptyHint": "Bu alana eklemek için bir ders notundan özet veya podcast oluştur.", + "aiStudio.library.summary": "Yapay zekâ özeti", + "aiStudio.library.podcastCount": "{count} podcast", + "aiStudio.library.open": "Nota git", "today.titleStudent": "Bugünkü derslerin", "today.inProgress": "Şimdi", "childHomework.title": "Ödevler", @@ -5456,9 +5504,9 @@ const tr: Dict = { "insights.sectionNotComputed": "Bu bölüm hesaplanmadı.", "insights.noEvidence": "Destekleyici veri yok.", "insights.modules.attendance": "Yoklama", - "insights.modules.marks": "Notlar", + "insights.modules.marks": "Karne", "insights.modules.study": "Çalışma", - "insights.modules.submission": "Teslimler", + "insights.modules.submission": "Ödevler", "insights.attention": "Dikkat sinyalleri", "insights.noAttention": "Dikkat sinyali yok.", "insights.schoolWide": "Okul geneli", @@ -5491,6 +5539,15 @@ const tr: Dict = { "insights.analysis.submittedRate": "Teslim oranı", "insights.analysis.submitted": "Teslim", "insights.analysis.missing": "Eksik", + "insights.analysis.currentSnapshot": "Güncel ölçüm dağılımı", + "insights.analysis.courseComparison": "100 puan üzerinden ders ortalamaları", + "insights.analysis.currentPeriod": "Son 28 gün", + "insights.analysis.previousPeriod": "Önceki 28 gün", + "insights.analysis.periodComparison": "Dönemlere göre odak süresi (saat)", + "insights.analysis.onTime": "Zamanında", + "insights.analysis.details": "Bu analizin dayanağı ne?", + "insights.analysis.detailsHint": "Karşılaştırmaları, eğilimleri ve mevcut verinin sınırlarını keşfet.", + "insights.analysis.detailsAction": "İncele", "insights.runs": "Analiz çalıştırmaları", "insights.runsSubtitle": "Gece çalışan ve elle sıraya alınan okul analizleri.", "insights.runDay": "Çalışma günü", diff --git a/src/pages/ai-insight-student-page.tsx b/src/pages/ai-insight-student-page.tsx index 3aa59df..fd9b2d3 100644 --- a/src/pages/ai-insight-student-page.tsx +++ b/src/pages/ai-insight-student-page.tsx @@ -10,7 +10,7 @@ import { Alert } from "@/components/ui/alert"; import { Button } from "@/components/ui/button"; import { ErrorAlert } from "@/components/ui/error-alert"; import { Badge } from "@/components/ui/badge"; -import { IconAlert, IconChart, IconDownload, IconSparkles } from "@/components/ui/icons"; +import { IconDownload, IconSparkles } from "@/components/ui/icons"; import { PageSpinner } from "@/components/ui/page-spinner"; import { createFlash } from "@/lib/flash"; import { loadInsightStudents } from "@/lib/insight-students"; @@ -110,17 +110,33 @@ function AiInsightStudentContent() { }> {(value) => ( -
-
-
+
+
+
-
+
{initials()}

{t("insights.title")}

-

{studentName()}

-

{t("insights.studentAnalysis")}

+
+

{studentName()}

+ {t("insights.noSummary")}} + > + {(summary) => ( +
+ {numericDate(summary().computed_at)} + + + {confidenceLabel(summary().confidence)} + +
+ )} +
+
+

{t("insights.studentAnalysis")}

@@ -136,32 +152,9 @@ function AiInsightStudentContent() {
-
-
-

{t("insights.computedAt")}

-

{numericDate(value().summary?.computed_at)}

-
-
-

{t("insights.confidence")}

- —} - > - {(summary) => {confidenceLabel(summary().confidence)}} - -
-
-

{t("insights.attention")}

-

{value().attention.length}

-
-
-

{t("insights.recommendations")}

-

{value().cards.length}

-
-
-
+