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:
parent
6325e07912
commit
b53eff9fd1
@ -1,6 +1,6 @@
|
||||
{
|
||||
"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",
|
||||
"main": "index.js",
|
||||
"scripts": {
|
||||
|
||||
@ -8530,13 +8530,17 @@ export default function WeeklyView() {
|
||||
}}
|
||||
>
|
||||
{(() => {
|
||||
const slotCount = getSomedaySlotCount(list.tasks);
|
||||
const indexedTasks = list.tasks.filter(t => t.somedaySlotIndex !== null && t.somedaySlotIndex !== undefined && t.somedaySlotIndex < slotCount);
|
||||
const unindexedTasks = list.tasks.filter(t => t.somedaySlotIndex === null || t.somedaySlotIndex === undefined || t.somedaySlotIndex >= slotCount);
|
||||
|
||||
// Separate complete from active so done tasks always render at bottom
|
||||
const activeTasks = list.tasks.filter(t => !t.completed);
|
||||
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
|
||||
const slots = Array.from({ length: slotCount }, (_, i) => ({ index: i, task: indexedTasks.find(t => t.somedaySlotIndex === i) || null }));
|
||||
|
||||
|
||||
let unindexedIdx = 0;
|
||||
const finalSlots = slots.map(slot => {
|
||||
if (!slot.task && unindexedIdx < unindexedTasks.length) {
|
||||
@ -8545,7 +8549,7 @@ export default function WeeklyView() {
|
||||
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);
|
||||
|
||||
return (
|
||||
@ -8718,6 +8722,41 @@ export default function WeeklyView() {
|
||||
/>
|
||||
</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
|
||||
className="weekly-task-item minimal"
|
||||
style={{
|
||||
margin: isBottomAddInput ? "0 0.5rem" : "0",
|
||||
margin: isBottomAddInput ? "0 24px 0 0.5rem" : "0",
|
||||
listStyle: "none",
|
||||
width: "100%"
|
||||
}}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user