forge
Explore
Log in

Don't you dare go Hollow

🐛 seek waits for unloaded audio, resizable rail, clearer errors

Browse files at this commit

e78105f294e6ed242904be736ecf36a838258197Burak BoduroğluParent: 6581414
  • fix
    • 🐛 seek waits for unloaded audio, resizable rail, clearer errors
Show full message
fix: 🐛 seek waits for unloaded audio, resizable rail, clearer errors
- a seek is instant only inside the buffered range or the local copy;
  elsewhere playback pauses, the thumb spins at the target with "Bu kısım
  yükleniyor…", and it resumes from there once loaded (seekable was not
  trusted — Safari reports it for a stream that ignores Range and keeps
  playing from the old spot); skips stack on a pending target
- the studio's audio rail is resizable from its left edge (drag, arrow
  keys, double-click to reset), 280–720px, remembered on this device
- study history docks on the right on desktop so it no longer sits flush
  against the app sidebar; the phone drawer stays on the left
- pagination without a row count centres its buttons instead of pushing
  them to the right edge
- unmapped API errors name the kind of failure by status (invalid request,
  conflict, missing or wrong field, timeout) and quote the server's reason;
  serde body errors become "“Başlık” alanı eksik", invalid option and
  wrong-format messages
src/api/__tests__/client/client.test.tsmodified+23 -5
@@ -278,13 +278,31 @@ describe("client", () => {
278278 ).toBe("Bu sınava yalnızca dersin öğretmenleri veya bir müdür soru ekleyebilir.");
279279 });
280280
281- it("falls back to a clean localized message for unmapped errors (no raw leak)", () => {
281+ it("names the failure and quotes the server's reason for unmapped errors", () => {
282282 expect(formatApiErrorMessage("custom error occurred", "en")).toBe(
283- "Something went wrong. Please check your input and try again.",
283+ "The action could not be completed. Server said: “custom error occurred”.",
284284 );
285285 expect(formatApiErrorMessage("custom error occurred", "tr")).toBe(
286- "İşlem tamamlanamadı. Lütfen bilgileri kontrol edip tekrar dene.",
286+ "İşlem tamamlanamadı. Sunucu yanıtı: “custom error occurred”.",
287287 );
288+ expect(formatApiError(new ApiError(409, "slot taken by a later edit"), "tr")).toBe(
289+ "İşlem kaydın şu anki durumuyla çakışıyor. Sunucu yanıtı: “slot taken by a later edit”.",
290+ );
291+ expect(formatApiError(new ApiError(400, ""), "tr")).toBe(
292+ "Sunucu isteği geçersiz buldu. Bilgileri kontrol edip tekrar dene.",
293+ );
294+ });
295+
296+ it("translates request bodies the backend could not decode", () => {
297+ expect(
298+ formatApiError(new ApiError(422, "Failed to deserialize the JSON body into the target type: missing field `title` at line 1 column 2"), "tr"),
299+ ).toBe("“Başlık” alanı eksik. Doldurup tekrar dene.");
300+ expect(
301+ formatApiError(new ApiError(422, "Failed to deserialize the JSON body into the target type: format: unknown variant `kisa`, expected `duz_okuma` or `tek_ogretici` at line 1 column 20"), "tr"),
302+ ).toBe("“kisa” geçerli bir seçenek değil. Geçerli değerler: duz_okuma or tek_ogretici.");
303+ expect(
304+ formatApiError(new ApiError(422, "Failed to deserialize the JSON body into the target type: ders_saati: invalid type: string \"3\", expected u32 at line 1 column 18"), "tr"),
305+ ).toBe("“Ders saati” alanının biçimi hatalı: u32 bekleniyordu, string \"3\" geldi.");
288306 });
289307
290308 it("localizes backend max-length validation messages", () => {
@@ -370,8 +388,8 @@ describe("client", () => {
370388 });
371389
372390 it("formats generic Error", () => {
373- expect(formatApiError(new Error("generic"), "en")).toBe("Something went wrong. Please check your input and try again.");
374- expect(formatApiError(new Error("generic"), "tr")).toBe("İşlem tamamlanamadı. Lütfen bilgileri kontrol edip tekrar dene.");
391+ expect(formatApiError(new Error("generic"), "en")).toBe("The action could not be completed. Server said: “generic”.");
392+ expect(formatApiError(new Error("generic"), "tr")).toBe("İşlem tamamlanamadı. Sunucu yanıtı: “generic”.");
375393 });
376394
377395 it("does not expose network, runtime, or provider errors to users", () => {
src/api/client/client.tsmodified+63 -8
@@ -539,7 +539,62 @@ export async function blobClient(path: string, signal?: AbortSignal): Promise<Bl
539539 return res.blob();
540540 }
541541
542-export function formatApiErrorMessage(message: string, locale: Locale = currentLocale()): string {
542+/**
543+ * A request body the backend could not read (its JSON extractor, serde). The
544+ * text names the field and what was wrong with it, which is exactly what a
545+ * reader needs to fix the form — so it is translated instead of hidden.
546+ */
547+function formatDecodeMessage(message: string, locale: Locale): string | null {
548+ const tr = locale === "tr";
549+ const missing = message.match(/missing field `([^`]+)`/i);
550+ if (missing) {
551+ const label = fieldLabel(missing[1], locale);
552+ return tr ? `“${label}” alanı eksik. Doldurup tekrar dene.` : `The “${label}” field is missing. Fill it in and try again.`;
553+ }
554+ const variant = message.match(/unknown variant `([^`]*)`, expected (.+?)(?: at line \d+.*)?$/i);
555+ if (variant) {
556+ return tr
557+ ? `“${variant[1]}” geçerli bir seçenek değil. Geçerli değerler: ${variant[2].replace(/`/g, "")}.`
558+ : `“${variant[1]}” is not a valid option. Valid values: ${variant[2].replace(/`/g, "")}.`;
559+ }
560+ const field = message.match(/([\w.[\]]+): invalid (?:type|value|length)/i)?.[1];
561+ const typed = message.match(/invalid (?:type|value): (.+?), expected (.+?)(?: at line \d+.*)?$/i);
562+ if (typed) {
563+ const where = field ? (tr ? `“${fieldLabel(field, locale)}” alanının` : `The “${fieldLabel(field, locale)}” field has the`) : tr ? "Bir alanın" : "A field has the";
564+ return tr
565+ ? `${where} biçimi hatalı: ${typed[2]} bekleniyordu, ${typed[1]} geldi.`
566+ : `${where} wrong format: expected ${typed[2]}, got ${typed[1]}.`;
567+ }
568+ if (/failed to (parse|deserialize) the (request )?(json )?body|expected value at line|eof while parsing/i.test(message)) {
569+ return tr ? "Gönderilen veri okunamadı (biçim hatası). Alanları kontrol edip tekrar dene." : "The data sent could not be read (format error). Check the fields and try again.";
570+ }
571+ return null;
572+}
573+
574+/** What kind of failure a status is, for when the backend's words are not mapped. */
575+function statusLead(status: number | null, locale: Locale): string {
576+ const tr = locale === "tr";
577+ if (status === 400) return tr ? "Sunucu isteği geçersiz buldu." : "The server rejected the request as invalid.";
578+ if (status === 408) return tr ? "Sunucu zamanında yanıt vermedi." : "The server did not answer in time.";
579+ if (status === 409) return tr ? "İşlem kaydın şu anki durumuyla çakışıyor." : "The action conflicts with the record's current state.";
580+ if (status === 422) return tr ? "Gönderilen bilgilerde eksik ya da hatalı bir alan var." : "A field is missing or has the wrong format.";
581+ return tr ? "İşlem tamamlanamadı." : "The action could not be completed.";
582+}
583+
584+/**
585+ * The last resort: say what kind of failure it was and quote the backend's
586+ * own reason, so the reader (and whoever they ask) can tell a format problem
587+ * from a conflict. Raw text is labelled as the server's, not passed off as ours.
588+ */
589+function formatFallbackMessage(message: string, status: number | null, locale: Locale): string {
590+ const lead = statusLead(status, locale);
591+ const detail = message.trim().replace(/[.\s]+$/, "");
592+ const generic = !detail || /^(request failed|bad request|unprocessable entity|conflict|error)$/i.test(detail);
593+ if (generic) return `${lead} ${locale === "tr" ? "Bilgileri kontrol edip tekrar dene." : "Check your input and try again."}`;
594+ return `${lead} ${locale === "tr" ? "Sunucu yanıtı" : "Server said"}: “${detail}”.`;
595+}
596+
597+export function formatApiErrorMessage(message: string, locale: Locale = currentLocale(), status: number | null = null): string {
543598 const normalized = normalizeApiMessage(message);
544599 const known = API_ERROR_MESSAGES[normalized]?.[locale];
545600 if (known) return known;
@@ -547,12 +602,12 @@ export function formatApiErrorMessage(message: string, locale: Locale = currentL
547602 if (runtime) return runtime;
548603 const validation = formatValidationMessage(message, locale);
549604 if (validation) return validation;
550- // Unmapped backend text is raw English/technical — never surface it to the
551- // user. Fall back to a clean localized line; add a mapping in
552- // API_ERROR_MESSAGES when a specific message deserves its own wording.
553- return locale === "tr"
554- ? "İşlem tamamlanamadı. Lütfen bilgileri kontrol edip tekrar dene."
555- : "Something went wrong. Please check your input and try again.";
605+ const decode = formatDecodeMessage(message, locale);
606+ if (decode) return decode;
607+ // Unmapped backend text: name the kind of failure and quote the server's
608+ // reason instead of a bare "something went wrong" that hides it. Add a
609+ // mapping in API_ERROR_MESSAGES when a message deserves its own wording.
610+ return formatFallbackMessage(message, status, locale);
556611 }
557612
558613 export function formatApiError(err: unknown, locale: Locale = currentLocale()): string {
@@ -574,7 +629,7 @@ export function formatApiError(err: unknown, locale: Locale = currentLocale()):
574629 if (err.status === 404) return API_ERROR_MESSAGES["not found"][locale];
575630 if (err.status === 413) return API_ERROR_MESSAGES["payload too large"][locale];
576631 if (err.status >= 500) return locale === "tr" ? "Sunucuda bir sorun oluştu. Lütfen tekrar dene." : "Server error. Please try again.";
577- return formatApiErrorMessage(err.message, locale);
632+ return formatApiErrorMessage(err.message, locale, err.status);
578633 }
579634 if (err instanceof TypeError) {
580635 return formatRuntimeErrorMessage(err.message, locale) ??
src/components/ai/note-studio-panel.tsxmodified+64 -3
@@ -1,4 +1,4 @@
1-import { Show, Suspense, createMemo } from "solid-js";
1+import { Show, Suspense, createEffect, createMemo, createSignal } from "solid-js";
22 import { Link, useNavigate } from "@tanstack/solid-router";
33 import { createResource } from "@/lib/create-resource";
44 import { getCourseNotes } from "@/api/course-notes";
@@ -22,6 +22,17 @@ import { cn } from "@/lib/cn";
2222 import { courseNoteFiles } from "@/lib/note-source";
2323 import { hasMinRole } from "@/lib/roles";
2424
25+const RAIL_KEY = "hezarfen.studio.railWidth";
26+const RAIL_MIN = 280;
27+const RAIL_MAX = 720;
28+const RAIL_DEFAULT = 352;
29+
30+function readRailWidth(): number {
31+ if (typeof localStorage === "undefined") return RAIL_DEFAULT;
32+ const value = Number(localStorage.getItem(RAIL_KEY));
33+ return Number.isFinite(value) && value >= RAIL_MIN && value <= RAIL_MAX ? value : RAIL_DEFAULT;
34+}
35+
2536 type StudioNote = CourseNote & { courseTitle: string; courseCreatorId: string };
2637
2738 /** Every lesson note the account can produce from, with its course. */
@@ -117,6 +128,32 @@ export function NoteStudioDetail(props: { noteId: string; episode?: string }) {
117128 const auth = useAuth();
118129 const [notes, { refetch }] = useStudioNotes();
119130 const note = createMemo(() => (notes() ?? []).find((row) => row.id === props.noteId) ?? null);
131+ // The audio rail is resizable from its left edge, remembered on this device.
132+ const [railWidth, setRailWidth] = createSignal(readRailWidth());
133+ const clampRail = (value: number) => Math.round(Math.min(RAIL_MAX, Math.max(RAIL_MIN, value)));
134+ createEffect(() => {
135+ if (typeof localStorage !== "undefined") localStorage.setItem(RAIL_KEY, String(railWidth()));
136+ });
137+ const startResize = (event: PointerEvent) => {
138+ event.preventDefault();
139+ const handle = event.currentTarget as HTMLElement;
140+ handle.setPointerCapture(event.pointerId);
141+ const startX = event.clientX;
142+ const startWidth = railWidth();
143+ const move = (next: PointerEvent) => setRailWidth(clampRail(startWidth + (startX - next.clientX)));
144+ const stop = () => {
145+ handle.removeEventListener("pointermove", move);
146+ handle.removeEventListener("pointerup", stop);
147+ handle.removeEventListener("pointercancel", stop);
148+ document.body.style.removeProperty("cursor");
149+ document.body.style.removeProperty("user-select");
150+ };
151+ document.body.style.cursor = "col-resize";
152+ document.body.style.userSelect = "none";
153+ handle.addEventListener("pointermove", move);
154+ handle.addEventListener("pointerup", stop);
155+ handle.addEventListener("pointercancel", stop);
156+ };
120157 const canManage = () => {
121158 const current = note();
122159 const user = auth.user();
@@ -147,7 +184,10 @@ export function NoteStudioDetail(props: { noteId: string; episode?: string }) {
147184 <h1 class="min-w-0 truncate text-sm font-semibold text-text-strong">{current().title}</h1>
148185 <span class="rounded-md bg-primary/10 px-1.5 py-0.5 text-xs font-medium text-primary-text">{current().courseTitle}</span>
149186 </div>
150- <div class="grid min-h-0 flex-1 grid-cols-1 lg:grid-cols-[minmax(0,1fr)_22rem]">
187+ <div
188+ class="grid min-h-0 flex-1 grid-cols-1 lg:grid-cols-[minmax(0,1fr)_var(--studio-rail)]"
189+ style={{ "--studio-rail": `${railWidth()}px` }}
190+ >
151191 <div class="min-w-0 py-6 lg:overflow-y-auto lg:px-8">
152192 <div class="mx-auto w-full max-w-3xl">
153193 <RagOutputsPanel
@@ -160,7 +200,28 @@ export function NoteStudioDetail(props: { noteId: string; episode?: string }) {
160200 />
161201 </div>
162202 </div>
163- <aside class="min-w-0 border-t border-border-hairline py-6 lg:overflow-y-auto lg:border-l lg:border-t-0 lg:bg-surface-overlay/30 lg:px-5">
203+ <aside class="relative min-w-0 border-t border-border-hairline py-6 lg:overflow-y-auto lg:border-l lg:border-t-0 lg:bg-surface-overlay/30 lg:px-5">
204+ {/* Drag (or arrow keys) to widen the rail; double-click resets it. */}
205+ <div
206+ role="separator"
207+ aria-orientation="vertical"
208+ aria-label={t("aiStudio.resizeRail")}
209+ aria-valuemin={RAIL_MIN}
210+ aria-valuemax={RAIL_MAX}
211+ aria-valuenow={railWidth()}
212+ tabIndex={0}
213+ class="group absolute inset-y-0 left-0 z-10 hidden w-2 cursor-col-resize touch-none outline-hidden lg:block"
214+ onPointerDown={startResize}
215+ onDblClick={() => setRailWidth(RAIL_DEFAULT)}
216+ onKeyDown={(event) => {
217+ if (event.key === "ArrowLeft") setRailWidth((w) => clampRail(w + 24));
218+ else if (event.key === "ArrowRight") setRailWidth((w) => clampRail(w - 24));
219+ else return;
220+ event.preventDefault();
221+ }}
222+ >
223+ <span class="block h-full w-px bg-transparent transition-colors group-hover:bg-primary/60 group-focus-visible:bg-primary group-active:bg-primary" />
224+ </div>
164225 <PodcastPanel noteId={current().id} noteTitle={current().title} episode={props.episode} active flat />
165226 </aside>
166227 </div>
src/components/events/event-roll-call.test.tsxmodified+1 -1
@@ -55,7 +55,7 @@ test("saves only changed rows and reports a failed row on that row", async () =>
5555 expect(postEventAttendance).toHaveBeenNthCalledWith(1, "event-1", { user_id: "s-2", status: "absent" });
5656 expect(postEventAttendance).toHaveBeenNthCalledWith(2, "event-1", { user_id: "s-3", status: "late" });
5757 // The failed row keeps its pick and carries its own error line.
58- expect(await screen.findByText(/İşlem tamamlanamadı|Something went wrong/)).toBeTruthy();
58+ expect(await screen.findByText(/İşlem tamamlanamadı|could not be completed/)).toBeTruthy();
5959 expect(screen.getByText(/1 of 2 rows|2 satırdan 1/)).toBeTruthy();
6060 expect(onSaved).toHaveBeenCalledTimes(1);
6161 });
src/components/notes/podcast-player.test.tsxmodified+2 -2
@@ -33,8 +33,8 @@ describe("PodcastPlayer", () => {
3333 vi.spyOn(HTMLMediaElement.prototype, "pause").mockImplementation(() => {});
3434 // Nor element scrolling, which the transcript's follow uses.
3535 Element.prototype.scrollTo ??= () => {};
36- // A stream the server lets the browser seek in, so no local copy is loaded.
37- vi.spyOn(HTMLMediaElement.prototype, "seekable", "get").mockReturnValue({
36+ // Audio already buffered this far, so the seek needs no local copy.
37+ vi.spyOn(HTMLMediaElement.prototype, "buffered", "get").mockReturnValue({
3838 length: 1,
3939 start: () => 0,
4040 end: () => 754,
src/components/rag/rag-study-panel.tsxmodified+27 -23
@@ -299,7 +299,9 @@ export function RagStudyPanel() {
299299 class={cn(
300300 "grid h-[calc(var(--app-viewport)-5.5rem-max(env(safe-area-inset-bottom),var(--android-nav-inset,0px)))] gap-4 max-lg:-mt-2",
301301 "lg:-mx-10 lg:-my-6 lg:h-[calc(100dvh-49px-env(safe-area-inset-top))] lg:gap-0",
302- historyCollapsed() ? "lg:grid-cols-[minmax(0,1fr)]" : "lg:grid-cols-[260px_minmax(0,1fr)]",
302+ // The history docks on the RIGHT on desktop: on the left it sat flush
303+ // against the app's own sidebar and the two read as one tangled nav.
304+ historyCollapsed() ? "lg:grid-cols-[minmax(0,1fr)]" : "lg:grid-cols-[minmax(0,1fr)_260px]",
303305 )}
304306 >
305307 <button
@@ -320,7 +322,7 @@ export function RagStudyPanel() {
320322 // slides out before it leaves the tab order.
321323 "fixed inset-y-0 left-0 z-[60] w-[min(20rem,85vw)] border-r border-border-line px-3 pb-[calc(max(env(safe-area-inset-bottom),var(--android-nav-inset,0px))+0.75rem)] pt-[calc(env(safe-area-inset-top)+0.75rem)] shadow-xl transition-[transform,visibility] duration-300 ease-out",
322324 historyOpen() ? "visible translate-x-0" : "invisible -translate-x-full",
323- "lg:visible lg:static lg:z-auto lg:h-full lg:w-auto lg:translate-x-0 lg:gap-2 lg:border-r lg:border-border-hairline lg:bg-surface-overlay/40 lg:px-2 lg:py-3 lg:shadow-none lg:transition-none",
325+ "lg:visible lg:static lg:z-auto lg:h-full lg:w-auto lg:translate-x-0 lg:order-last lg:gap-2 lg:border-l lg:border-r-0 lg:border-border-hairline lg:bg-surface-overlay/40 lg:px-2 lg:py-3 lg:shadow-none lg:transition-none",
324326 historyCollapsed() && "lg:hidden",
325327 )}
326328 >
@@ -334,7 +336,7 @@ export function RagStudyPanel() {
334336 title={copy().collapseHistory}
335337 onClick={() => setHistoryCollapsed(true)}
336338 >
337- <IconPanelLeft class="h-4 w-4" />
339+ <IconPanelLeft class="h-4 w-4 -scale-x-100" />
338340 </button>
339341 <button
340342 type="button"
@@ -408,26 +410,6 @@ export function RagStudyPanel() {
408410 {/* Desktop top bar: the open chat's title and its menu; with the
409411 sidebar folded away, the way back to it and a fresh chat. */}
410412 <div class="hidden h-12 shrink-0 items-center gap-1 px-3 lg:flex">
411- <Show when={historyCollapsed()}>
412- <button
413- type="button"
414- class="inline-flex h-9 w-9 shrink-0 items-center justify-center rounded-lg text-muted-foreground outline-hidden transition-colors hover:bg-muted hover:text-foreground focus-visible:ring-2 focus-visible:ring-ring"
415- aria-label={copy().expandHistory}
416- title={copy().expandHistory}
417- onClick={() => setHistoryCollapsed(false)}
418- >
419- <IconPanelLeft class="h-4 w-4" />
420- </button>
421- <button
422- type="button"
423- class="inline-flex h-9 w-9 shrink-0 items-center justify-center rounded-lg text-muted-foreground outline-hidden transition-colors hover:bg-muted hover:text-foreground focus-visible:ring-2 focus-visible:ring-ring"
424- aria-label={copy().newThread}
425- title={copy().newThread}
426- onClick={newThread}
427- >
428- <IconPlus class="h-4 w-4" />
429- </button>
430- </Show>
431413 <Show when={activeThread()}>
432414 {(thread) => (
433415 <div class="flex min-w-0 items-center gap-1 pl-1">
@@ -451,6 +433,28 @@ export function RagStudyPanel() {
451433 </div>
452434 )}
453435 </Show>
436+ <Show when={historyCollapsed()}>
437+ <div class="ml-auto flex items-center gap-1">
438+ <button
439+ type="button"
440+ class="inline-flex h-9 w-9 shrink-0 items-center justify-center rounded-lg text-muted-foreground outline-hidden transition-colors hover:bg-muted hover:text-foreground focus-visible:ring-2 focus-visible:ring-ring"
441+ aria-label={copy().expandHistory}
442+ title={copy().expandHistory}
443+ onClick={() => setHistoryCollapsed(false)}
444+ >
445+ <IconPanelLeft class="h-4 w-4 -scale-x-100" />
446+ </button>
447+ <button
448+ type="button"
449+ class="inline-flex h-9 w-9 shrink-0 items-center justify-center rounded-lg text-muted-foreground outline-hidden transition-colors hover:bg-muted hover:text-foreground focus-visible:ring-2 focus-visible:ring-ring"
450+ aria-label={copy().newThread}
451+ title={copy().newThread}
452+ onClick={newThread}
453+ >
454+ <IconPlus class="h-4 w-4" />
455+ </button>
456+ </div>
457+ </Show>
454458 </div>
455459 <Show when={error()}>
456460 <div class="mx-auto w-full max-w-3xl px-4 pt-1 sm:px-6">
src/components/ui/audio-player.tsxmodified+20 -6
@@ -130,10 +130,15 @@ export function AudioPlayer(props: AudioPlayerProps) {
130130 }
131131 return localLoad;
132132 };
133+ // A seek is instant only where the audio is actually here: the local copy,
134+ // or a range the stream has already buffered. `seekable` is not trusted —
135+ // Safari reports the whole file as seekable on a stream that ignores Range,
136+ // then keeps playing from the old spot.
133137 const canSeekTo = (secs: number) => {
134- const ranges = audio.seekable;
138+ if (objectUrl && source() === objectUrl) return true;
139+ const ranges = audio.buffered;
135140 for (let i = 0; i < ranges.length; i += 1) {
136- if (ranges.end(i) > 0 && secs >= ranges.start(i) && secs <= ranges.end(i)) return true;
141+ if (secs >= ranges.start(i) && secs <= ranges.end(i) - 0.5) return true;
137142 }
138143 return false;
139144 };
@@ -203,7 +208,8 @@ export function AudioPlayer(props: AudioPlayerProps) {
203208 else if (audio.paused) play();
204209 else audio.pause();
205210 };
206- const skip = (delta: number) => seek(audio.currentTime + delta);
211+ // Skips stack on a pending seek's target, not on the stalled stream.
212+ const skip = (delta: number) => seek((pendingSeek ?? audio.currentTime) + delta);
207213 const cycleRate = () => {
208214 const index = RATES.indexOf(rate() as (typeof RATES)[number]);
209215 setRate(RATES[(index + 1) % RATES.length]);
@@ -400,14 +406,22 @@ export function AudioPlayer(props: AudioPlayerProps) {
400406 <div
401407 aria-hidden="true"
402408 class={cn(
403- "pointer-events-none absolute top-1/2 h-3.5 w-3.5 -translate-x-1/2 -translate-y-1/2 rounded-full border-2 border-primary bg-background transition-transform peer-focus-visible:ring-2 peer-focus-visible:ring-ring",
404- playing() || current() > 0 ? "scale-100" : "scale-0 group-hover:scale-100 peer-focus-visible:scale-100",
409+ "pointer-events-none absolute top-1/2 h-3.5 w-3.5 -translate-x-1/2 -translate-y-1/2 rounded-full border-2 transition-transform peer-focus-visible:ring-2 peer-focus-visible:ring-ring",
410+ // While the target loads the thumb turns into a spinner right
411+ // where playback will resume.
412+ seeking() ? "scale-125 animate-spin border-primary border-t-transparent bg-background" : "border-primary bg-background",
413+ seeking() || playing() || current() > 0 ? "" : "scale-0 group-hover:scale-100 peer-focus-visible:scale-100",
405414 )}
406415 style={{ left: `${fraction(current()) * 100}%` }}
407416 />
408417 </div>
409418 <div class="mt-1 flex justify-between text-[11px] tabular-nums text-muted-foreground">
410- <span>{formatDurationClock(current() * 1000)}</span>
419+ <span class="flex items-center gap-1.5">
420+ {formatDurationClock(current() * 1000)}
421+ <Show when={seeking()}>
422+ <span class="text-primary-text" role="status">{t("audio.loadingPosition")}</span>
423+ </Show>
424+ </span>
411425 <span>{formatDurationClock(duration() == null ? null : duration()! * 1000)}</span>
412426 </div>
413427 </div>
src/components/ui/table-pagination.tsxmodified+9 -4
@@ -34,13 +34,18 @@ export function TablePagination(props: TablePaginationProps) {
3434 <Show when={hasRange() || props.pageCount > 1}>
3535 <div
3636 class={cn(
37- "flex w-full items-center justify-between gap-2 rounded-lg border border-border-line bg-surface-overlay px-2.5 py-1.5",
37+ "flex w-full items-center gap-2 rounded-lg border border-border-line bg-surface-overlay px-2.5 py-1.5",
38+ // With no row count to show, the empty left slot pushed the buttons
39+ // to the right edge; alone, they sit in the middle.
40+ hasRange() ? "justify-between" : "justify-center",
3841 props.class,
3942 )}
4043 >
41- <span class="text-xs font-medium tabular-nums text-muted-foreground sm:text-[11px]">
42- <Show when={hasRange()}>{t("common.pageRange", { start: start(), end: end(), total: props.total ?? 0 })}</Show>
43- </span>
44+ <Show when={hasRange()}>
45+ <span class="text-xs font-medium tabular-nums text-muted-foreground sm:text-[11px]">
46+ {t("common.pageRange", { start: start(), end: end(), total: props.total ?? 0 })}
47+ </span>
48+ </Show>
4449 <Show when={props.pageCount > 1}>
4550 <nav class="flex items-center gap-1" aria-label={t("common.pagination")}>
4651 <Button
src/i18n/locales/en.tsmodified+2 -0
@@ -710,6 +710,7 @@ export const en: Dict = {
710710 "aiStudio.outputs.title": "Studio outputs",
711711 "aiStudio.outputs.description": "Select a lesson note and keep its summary and podcast together for quick access.",
712712 "aiStudio.library.title": "Your generated library",
713+ "aiStudio.resizeRail": "Audio workshop panel width",
713714 "aiStudio.backToLibrary": "Back to library",
714715 "aiStudio.library.description": "Every summary and podcast you produced, newest first.",
715716 "aiStudio.library.count": "{count} outputs",
@@ -1092,6 +1093,7 @@ export const en: Dict = {
10921093 "audio.mute": "Mute",
10931094 "audio.unmute": "Unmute",
10941095 "audio.volume": "Volume",
1096+ "audio.loadingPosition": "Loading this part…",
10951097 "audio.loadFailed": "The audio could not be loaded.",
10961098 "podcast.transcript.title": "Transcript",
10971099 "podcast.transcript.show": "Show transcript",
src/i18n/locales/tr.tsmodified+2 -0
@@ -706,6 +706,7 @@ export const tr: Dict = {
706706 "aiStudio.outputs.title": "Hazır çıktılar",
707707 "aiStudio.outputs.description": "Bir ders notu seçin; özetini ve podcast'ini hızlı erişim için aynı alanda üretin.",
708708 "aiStudio.library.title": "Üretim kitaplığın",
709+ "aiStudio.resizeRail": "Ses Atölyesi panelinin genişliği",
709710 "aiStudio.backToLibrary": "Kitaplığa dön",
710711 "aiStudio.library.description": "Ürettiğin her özet ve podcast, en yenisi üstte.",
711712 "aiStudio.library.count": "{count} çıktı",
@@ -1088,6 +1089,7 @@ export const tr: Dict = {
10881089 "audio.mute": "Sesi kapat",
10891090 "audio.unmute": "Sesi aç",
10901091 "audio.volume": "Ses düzeyi",
1092+ "audio.loadingPosition": "Bu kısım yükleniyor…",
10911093 "audio.loadFailed": "Ses yüklenemedi.",
10921094 "podcast.transcript.title": "Transkript",
10931095 "podcast.transcript.show": "Transkripti göster",
src/i18n/messages.tsmodified+2 -0
@@ -694,6 +694,7 @@ export type MessageKey =
694694 | "aiStudio.outputs.title"
695695 | "aiStudio.outputs.description"
696696 | "aiStudio.library.title"
697+ | "aiStudio.resizeRail"
697698 | "aiStudio.backToLibrary"
698699 | "aiStudio.library.description"
699700 | "aiStudio.library.count"
@@ -1079,6 +1080,7 @@ export type MessageKey =
10791080 | "audio.mute"
10801081 | "audio.unmute"
10811082 | "audio.volume"
1083+ | "audio.loadingPosition"
10821084 | "audio.loadFailed"
10831085 | "podcast.transcript.title"
10841086 | "podcast.transcript.show"