feat: sort completed tasks to bottom + align Add task input

- Completed tasks in someday lists now always render below all active
  tasks. Slot system builds from incomplete tasks only; done tasks get
  their own section at the bottom outside the droppable slots.
- "Add task..." input right margin increased to 24px so its right edge
  stops before the provider icon (G) column, matching task row layout.

v1.109.0
This commit is contained in:
mARTin-B78 2026-05-11 12:29:01 +02:00
parent 6325e07912
commit b53eff9fd1
2 changed files with 47 additions and 8 deletions

View File

@ -1,6 +1,6 @@
{ {
"name": "my-weekly-todo-list", "name": "my-weekly-todo-list",
"version": "1.108.4", "version": "1.109.0",
"description": "A web-based weekly task management application that organizes to-dos and calendar events in a single, intuitive weekly view", "description": "A web-based weekly task management application that organizes to-dos and calendar events in a single, intuitive weekly view",
"main": "index.js", "main": "index.js",
"scripts": { "scripts": {

View File

@ -8530,9 +8530,13 @@ export default function WeeklyView() {
}} }}
> >
{(() => { {(() => {
const slotCount = getSomedaySlotCount(list.tasks); // Separate complete from active so done tasks always render at bottom
const indexedTasks = list.tasks.filter(t => t.somedaySlotIndex !== null && t.somedaySlotIndex !== undefined && t.somedaySlotIndex < slotCount); const activeTasks = list.tasks.filter(t => !t.completed);
const unindexedTasks = list.tasks.filter(t => t.somedaySlotIndex === null || t.somedaySlotIndex === undefined || t.somedaySlotIndex >= slotCount); const doneTasks = list.tasks.filter(t => t.completed);
const slotCount = getSomedaySlotCount(activeTasks);
const indexedTasks = activeTasks.filter(t => t.somedaySlotIndex !== null && t.somedaySlotIndex !== undefined && t.somedaySlotIndex < slotCount);
const unindexedTasks = activeTasks.filter(t => t.somedaySlotIndex === null || t.somedaySlotIndex === undefined || t.somedaySlotIndex >= slotCount);
// Fill indexed slots and put unindexed tasks in empty slots starting from top // Fill indexed slots and put unindexed tasks in empty slots starting from top
const slots = Array.from({ length: slotCount }, (_, i) => ({ index: i, task: indexedTasks.find(t => t.somedaySlotIndex === i) || null })); const slots = Array.from({ length: slotCount }, (_, i) => ({ index: i, task: indexedTasks.find(t => t.somedaySlotIndex === i) || null }));
@ -8545,7 +8549,7 @@ export default function WeeklyView() {
return slot; return slot;
}); });
// Any remaining unindexed tasks that didn't fit in slots // Any remaining unindexed active tasks that didn't fit in slots
const remainingTasks = unindexedTasks.slice(unindexedIdx); const remainingTasks = unindexedTasks.slice(unindexedIdx);
return ( return (
@ -8718,6 +8722,41 @@ export default function WeeklyView() {
/> />
</div> </div>
))} ))}
{/* Completed tasks always rendered at bottom */}
{doneTasks.map((task) => (
<div key={task.id} className="task-list-slot">
<TaskItem
key={task.id}
task={task}
isEditing={editingTaskId === task.id}
onToggle={() => toggleTask(task.id)}
onEdit={() => setEditingTaskId(task.id)}
onUpdate={(title) => updateTask(task.id, title)}
onDelete={() => deleteTask(task.id)}
onNotes={(notes) => updateTaskNotes(task.id, notes)}
onUrl={(url) => updateTaskUrl(task.id, url)}
onRollToggle={() => toggleTaskRolling(task.id)}
onRecurrence={() => setSelectedTaskForRecurrence(task)}
onDragStart={(e, t) => handleDragStart(e, t)}
onDragEnd={handleDragEnd}
variant="minimal"
isSomeday={true}
onAddSubTask={addSubTask}
onToggleSubTask={toggleSubTask}
onDeleteSubTask={deleteSubTask}
onUpdateSubTask={updateSubTask}
editingTaskId={editingTaskId}
onSetEditingTaskId={setEditingTaskId}
showTaskCheckboxes={effectiveShowTaskCheckboxes}
showProjectIcons={effectiveShowProjectIcons}
showPriorityIcons={effectiveShowPriorityIcons}
priorityStyle={effectivePriorityStyle}
projects={projects}
onProjectAssign={assignProject}
kanbanStages={kanbanStages}
/>
</div>
))}
</> </>
); );
})()} })()}
@ -9820,7 +9859,7 @@ function SomedayAddTask({
<li <li
className="weekly-task-item minimal" className="weekly-task-item minimal"
style={{ style={{
margin: isBottomAddInput ? "0 0.5rem" : "0", margin: isBottomAddInput ? "0 24px 0 0.5rem" : "0",
listStyle: "none", listStyle: "none",
width: "100%" width: "100%"
}} }}