diff --git a/server.js b/server.js index a70e954..4f6aecb 100644 --- a/server.js +++ b/server.js @@ -213,8 +213,8 @@ const DEFAULT_PODCAST_CHECKLIST_TASKS = [ { id: 'verify_script', label: 'Verify Script', phase: 'pre' }, { id: 'read_script', label: 'Read Script', phase: 'pre' }, { id: 'record', label: 'Record', phase: 'pre' }, - { id: 'edit', label: 'Edit', phase: 'pre' }, { id: 'mix', label: 'Mix', phase: 'pre' }, + { id: 'edit', label: 'Edit', phase: 'pre' }, { id: 'video_script', label: 'Run Video Conversion Script', phase: 'pre' }, { id: 'post_spotify', label: 'Post on Spotify', phase: 'pre' }, { id: 'update_website', label: 'Update Website', phase: 'post' }, diff --git a/src/AdminPage.tsx b/src/AdminPage.tsx index 717dc11..3a1f662 100644 --- a/src/AdminPage.tsx +++ b/src/AdminPage.tsx @@ -1974,7 +1974,29 @@ export default function AdminPage({ content, onSave, onLogout }: Props) { questionPage * QUESTION_PAGE_SIZE, (questionPage + 1) * QUESTION_PAGE_SIZE, ) - const checklistTasksSorted = [...podcastChecklist.tasks].sort((a, b) => a.label.localeCompare(b.label, undefined, { sensitivity: 'base' })) + const checklistTaskOrder = [ + 'verify_script', + 'read_script', + 'record', + 'mix', + 'edit', + 'video_script', + 'post_spotify', + 'update_website', + 'send_email', + ] + const checklistTaskOrderIndex = new Map(checklistTaskOrder.map((id, index) => [id, index])) + const checklistTasksSorted = [...podcastChecklist.tasks].sort((a, b) => { + const aIndex = checklistTaskOrderIndex.get(a.id) + const bIndex = checklistTaskOrderIndex.get(b.id) + const aKnown = typeof aIndex === 'number' + const bKnown = typeof bIndex === 'number' + + if (aKnown && bKnown) return aIndex - bIndex + if (aKnown && !bKnown) return -1 + if (!aKnown && bKnown) return 1 + return a.label.localeCompare(b.label, undefined, { sensitivity: 'base' }) + }) const checklistPreTasks = checklistTasksSorted.filter(task => task.phase === 'pre') const checklistPostTasks = checklistTasksSorted.filter(task => task.phase === 'post') const checklistEpisodesSorted = [...podcastChecklist.episodes].sort((a, b) => { @@ -2739,6 +2761,7 @@ export default function AdminPage({ content, onSave, onLogout }: Props) { {checklistEpisodesSorted.map(episode => { const doneCount = checklistTasksSorted.reduce((count, task) => count + (episode.tasks[task.id] ? 1 : 0), 0) const totalCount = checklistTasksSorted.length + const nextTask = checklistTasksSorted.find(task => !episode.tasks[task.id]) const episodeLabelParts = [episode.series?.trim()] if (episode.episodeNumber !== null) { episodeLabelParts.push(String(episode.episodeNumber)) @@ -2753,7 +2776,11 @@ export default function AdminPage({ content, onSave, onLogout }: Props) {
{episodeLabel} -

{totalCount > 0 ? `${doneCount}/${totalCount} tasks completed` : 'No tasks assigned yet'}

+

+ {totalCount > 0 + ? `${doneCount}/${totalCount} tasks completed • Next: ${nextTask?.label ?? 'All done'}` + : 'No tasks assigned yet'} +

Expand to edit