changed checklist order and added what is next when collaped.

This commit is contained in:
nmemmert
2026-05-18 08:47:24 -04:00
parent f14992350c
commit c66be30b20
2 changed files with 30 additions and 3 deletions
+1 -1
View File
@@ -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' },
+29 -2
View File
@@ -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) {
<summary className="admin-collapsible-summary">
<div>
<strong>{episodeLabel}</strong>
<p>{totalCount > 0 ? `${doneCount}/${totalCount} tasks completed` : 'No tasks assigned yet'}</p>
<p>
{totalCount > 0
? `${doneCount}/${totalCount} tasks completed • Next: ${nextTask?.label ?? 'All done'}`
: 'No tasks assigned yet'}
</p>
</div>
<span className="admin-collapsible-hint">Expand to edit</span>
</summary>