From 452029a6d32b224fb912f3fce92a40011419442e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Padez?= Date: Sun, 23 Aug 2026 16:02:48 +0000 Subject: [PATCH] rename TaskRunnerModal's track bindings off `t`, before keying it MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit No behaviour change. Separated from the conversion because a 40-site rename hiding inside a string diff is unreviewable. Read first rather than renamed blindly, and it earned it twice. `\bt\b` matches 93 times in this file and only some are tracks: `const t = ctx.currentTime` is an audio timestamp in the beep helper, and `border-t` inside classNames matches too — a blanket rename would have silently corrupted five CSS classes and the typecheck would not have said a word about them. So this renames the track bindings only, by property (`t.id`, `t.lang`, `t.codec`, `t.channels`, `t.bitrate`, `t.title`) and by parameter, leaving the timestamp and the class names alone. --- .../components/TaskRunnerModal.tsx | 107 ++++++++++-------- 1 file changed, 58 insertions(+), 49 deletions(-) diff --git a/src/workspaces/officerdev/src/apps/FileBrowser/FileBrowserApp/components/TaskRunnerModal.tsx b/src/workspaces/officerdev/src/apps/FileBrowser/FileBrowserApp/components/TaskRunnerModal.tsx index b0089d6e..fd27a627 100644 --- a/src/workspaces/officerdev/src/apps/FileBrowser/FileBrowserApp/components/TaskRunnerModal.tsx +++ b/src/workspaces/officerdev/src/apps/FileBrowser/FileBrowserApp/components/TaskRunnerModal.tsx @@ -291,14 +291,16 @@ type TaskInputFormProps = { hideTrackPickers?: boolean; }; -const trackLabel = (t: { title: string; lang: string; id: number }) => - t.title || (t.lang && t.lang !== 'und' && t.lang !== 'unknown' ? t.lang.toUpperCase() : '') || `Track ${t.id + 1}`; +const trackLabel = (track: { title: string; lang: string; id: number }) => + track.title || + (track.lang && track.lang !== 'und' && track.lang !== 'unknown' ? track.lang.toUpperCase() : '') || + `Track ${track.id + 1}`; // Channel count → friendly layout name; audio meta → "stereo · aac 193k"-style detail for a track row. const chLabel = (n: number) => n === 1 ? 'mono' : n === 2 ? 'stereo' : n === 6 ? '5.1' : n === 8 ? '7.1' : n ? `${n}ch` : ''; -const audioMeta = (t: AudioTrack) => - [chLabel(t.channels), t.codec].filter(Boolean).join(' ') + (t.bitrate ? ` ${t.bitrate}k` : ''); +const audioMeta = (track: AudioTrack) => + [chLabel(track.channels), track.codec].filter(Boolean).join(' ') + (track.bitrate ? ` ${track.bitrate}k` : ''); // subtitle_edit input: per-subtitle keep flag + editable label, serialized to JSON in the form value. type SubtitleEditEntry = { id: number; keep: boolean; label: string }; @@ -333,14 +335,16 @@ export const TaskInputForm = ({ if (def.type === 'subtitle_edit') { const tracks = subtitleTracks ?? []; const byId = new Map(parseSubtitleSpec(values[key]).map((e) => [e.id, e])); - const entryFor = (t: SubtitleTrack): SubtitleEditEntry => - byId.get(t.id) ?? { id: t.id, keep: true, label: trackLabel(t) }; + const entryFor = (track: SubtitleTrack): SubtitleEditEntry => + byId.get(track.id) ?? { id: track.id, keep: true, label: trackLabel(track) }; const update = (id: number, patch: Partial) => onChange( key, - JSON.stringify(tracks.map((t) => (t.id === id ? { ...entryFor(t), ...patch } : entryFor(t)))), + JSON.stringify( + tracks.map((track) => (track.id === id ? { ...entryFor(track), ...patch } : entryFor(track))), + ), ); - const keptCount = tracks.filter((t) => entryFor(t).keep).length; + const keptCount = tracks.filter((track) => entryFor(track).keep).length; return (
{def.description ?? key} @@ -354,26 +358,26 @@ export const TaskInputForm = ({ ) : ( <>
- {tracks.map((t) => { - const e = entryFor(t); + {tracks.map((track) => { + const e = entryFor(track); return ( -
+
update(t.id, { label: ev.target.value })} + onChange={(ev) => update(track.id, { label: ev.target.value })} className="flex-1 min-w-0 px-2 py-1 text-sm rounded-md border border-duck-dark/15 dark:border-foreground/15 bg-background focus:outline-none focus:ring-1 focus:ring-duck-teal disabled:opacity-40" />
@@ -419,23 +423,23 @@ export const TaskInputForm = ({ None ) : (
- {tracks.map((t) => ( + {tracks.map((track) => (