4 Commits
Author SHA1 Message Date
klemek 8b1cddea55 chore: 1.6.0
Python Lint CI / ruff-format-check (push) Successful in 1m57s
Python Lint CI / ruff (push) Successful in 1m57s
Python Lint CI / ty (push) Successful in 1m57s
TS Lint / Oxlint (push) Successful in 1m56s
TS Lint / TypeScript (push) Successful in 2m43s
TS Lint / ESLint (push) Successful in 2m43s
Docker Build / build (push) Successful in 6m58s
2026-07-21 11:19:45 +02:00
klemek 0abcc7ae1b feat: show missed tasks 2026-07-21 11:19:37 +02:00
klemek 6f8c14e8fb chore: 1.5.1 2026-07-21 10:24:04 +02:00
klemek 69512a4f1d feat: better monthly select 2026-07-21 10:23:56 +02:00
12 changed files with 218 additions and 116 deletions
+1 -1
View File
@@ -1,6 +1,6 @@
{ {
"name": "tout-doux", "name": "tout-doux",
"version": "1.5.0", "version": "1.6.0",
"private": true, "private": true,
"type": "module", "type": "module",
"engines": { "engines": {
+1 -1
View File
@@ -1,6 +1,6 @@
[project] [project]
name = "tout-doux" name = "tout-doux"
version = "1.5.0" version = "1.6.0"
description = "" description = ""
requires-python = ">=3.14" requires-python = ">=3.14"
dependencies = [ dependencies = [
+10 -5
View File
@@ -22,10 +22,14 @@
"Sunday" "Sunday"
], ],
"month": { "month": {
"st": "st", "st": "The {0}st",
"nd": "nd", "nd": "The {0}nd",
"rd": "rd", "rd": "The {0}rd",
"th": "th" "th": "The {0}th",
"first_day": "First day of month",
"last_day": "Last day of month",
"last": "Last",
"first": "First"
}, },
"year": [ "year": [
"January", "January",
@@ -61,7 +65,8 @@
"reverse_sort": "Reverse sort", "reverse_sort": "Reverse sort",
"last_checked": "Show last checked time", "last_checked": "Show last checked time",
"next_reset": "Show next reset time", "next_reset": "Show next reset time",
"separate_completed": "Separate completed tasks below" "separate_completed": "Separate completed tasks below",
"missed": "Show in red missed tasks (reset without check)"
}, },
"alerts": { "alerts": {
"task_updated": "Task updated", "task_updated": "Task updated",
+10 -5
View File
@@ -22,10 +22,14 @@
"Dimanche" "Dimanche"
], ],
"month": { "month": {
"st": "", "st": "Le {0}",
"nd": "", "nd": "Le {0}",
"rd": "", "rd": "Le {0}",
"th": "" "th": "Le {0}",
"first_day": "Premier jour du mois",
"last_day": "Dernier jour du mois",
"last": "Dernier",
"first": "Premier"
}, },
"year": [ "year": [
"Janvier", "Janvier",
@@ -61,7 +65,8 @@
"reverse_sort": "Inverser le tri", "reverse_sort": "Inverser le tri",
"last_checked": "Afficher la dernière completion", "last_checked": "Afficher la dernière completion",
"next_reset": "Afficher la prochaine réinitialisation", "next_reset": "Afficher la prochaine réinitialisation",
"separate_completed": "Séparer les tâches complétées plus bas" "separate_completed": "Séparer les tâches complétées plus bas",
"missed": "Indiquer en rouge les tâches manquées (réinitialisées sans completion)"
}, },
"alerts": { "alerts": {
"task_updated": "Tâche mise a jour", "task_updated": "Tâche mise a jour",
+1 -1
View File
@@ -25,7 +25,7 @@ onMounted(() => {
<div class="hero bg-hero grow"> <div class="hero bg-hero grow">
<div class="hero-content text-center p-0"> <div class="hero-content text-center p-0">
<div <div
class="max-w-md min-w-96 bg-base-100 rounded-box shadow-md p-4" class="max-w-96 min-w-96 bg-base-100 rounded-box shadow-md p-4"
> >
<router-link <router-link
to="/" to="/"
+34 -19
View File
@@ -11,23 +11,23 @@ const valid = ref<boolean>(true);
const props = defineProps<{ editMode: boolean }>(); const props = defineProps<{ editMode: boolean }>();
const cronType = ref<CronType>(CronType.MANUAL); const cronType = ref<CronType>(CronType.MANUAL);
const cronValue = ref<number>(0); const cronValue = ref<string>('0');
function onCronChanged() { function onCronChanged() {
const data = parseCron(cron.value); const data = parseCron(cron.value);
rawCron.value = cron.value ?? DEFAULT_CRON; rawCron.value = cron.value ?? DEFAULT_CRON;
cronType.value = data.type; cronType.value = data.type;
cronValue.value = data.value; cronValue.value = data.value.toFixed(0);
} }
function updateCron() { function updateCron() {
cron.value = getCron(cronType.value, cronValue.value, rawCron.value); cron.value = getCron(cronType.value, parseInt(cronValue.value), rawCron.value);
} }
function onChangeCronType() { function onChangeCronType() {
switch (cronType.value) { switch (cronType.value) {
case CronType.EVERY_DAY: case CronType.EVERY_DAY:
cronValue.value = 0; cronValue.value = '0';
break; break;
case CronType.EVERY_WEEK: case CronType.EVERY_WEEK:
case CronType.EVERY_MONTH: case CronType.EVERY_MONTH:
@@ -35,7 +35,7 @@ function onChangeCronType() {
case CronType.EVERY_N_DAYS: case CronType.EVERY_N_DAYS:
case CronType.EVERY_N_WEEKS: case CronType.EVERY_N_WEEKS:
case CronType.EVERY_N_MONTHS: case CronType.EVERY_N_MONTHS:
cronValue.value = 1; cronValue.value = '1';
break; break;
case CronType.CUSTOM: case CronType.CUSTOM:
cron.value ??= DEFAULT_CRON; cron.value ??= DEFAULT_CRON;
@@ -106,7 +106,7 @@ watch(cron, () => {
> >
<option <option
v-for="i in Array.from(Array(24).keys())" v-for="i in Array.from(Array(24).keys())"
:key="`h${i}`" :key="`h${i+1}`"
:value="i" :value="i"
> >
{{ i.toFixed(0).padStart(2, "0") }}:00 {{ i.toFixed(0).padStart(2, "0") }}:00
@@ -120,7 +120,7 @@ watch(cron, () => {
> >
<option <option
v-for="i in Array.from(Array(7).keys())" v-for="i in Array.from(Array(7).keys())"
:key="`w${i}`" :key="`w${i+1}`"
:value="i + 1" :value="i + 1"
> >
{{ $t(`cron.week.${i.toFixed(0)}`) }} {{ $t(`cron.week.${i.toFixed(0)}`) }}
@@ -132,20 +132,35 @@ watch(cron, () => {
class="select flex-1" class="select flex-1"
@change="onChangeCronValue" @change="onChangeCronValue"
> >
<option :value="1">{{ $t('cron.month.first_day') }}</option>
<option :value="32">{{ $t('cron.month.last_day') }}</option>
<option <option
v-for="i in Array.from(Array(31).keys())" v-for="i in Array.from(Array(7).keys())"
:key="`d${i}`" :key="`d${-(i+1)}`"
:value="i + 1" :value="-(i + 1)"
> >
{{ i + 1 {{ $t("cron.month.first") }} {{ $t(`cron.week.${i.toFixed(0)}`).toLowerCase() }}
}}{{ </option>
i % 10 == 0 <option
? $t("cron.month.st") v-for="i in Array.from(Array(7).keys())"
: i % 10 === 1 :key="`d${-(i+8)}`"
? $t("cron.month.nd") :value="-(i + 8)"
: i % 10 === 2 >
? $t("cron.month.rd") {{ $t("cron.month.last") }} {{ $t(`cron.week.${i.toFixed(0)}`).toLowerCase() }}
: $t("cron.month.th") </option>
<option
v-for="i in Array.from(Array(30).keys())"
:key="`d${i+2}`"
:value="i + 2"
>
{{
(i % 10 == 9 && i !== 9)
? $t("cron.month.st", [i+2])
: (i % 10 === 0 && i !== 10)
? $t("cron.month.nd", [i+2])
: (i % 10 === 1 && i !== 11)
? $t("cron.month.rd", [i+2])
: $t("cron.month.th", [i+2])
}} }}
</option> </option>
</select> </select>
+97
View File
@@ -0,0 +1,97 @@
<script setup lang="ts">
import { ArrowDownUpIcon, Settings2Icon } from "@lucide/vue";
import { SortType } from "@/enums";
defineEmits<(e: "changeSort") => void>();
const sortType = defineModel<SortType>("sortType", { required: true });
const sortReverse = defineModel<boolean>("sortReverse", { required: true });
const showLastChecked = defineModel<boolean>("showLastChecked", {
required: true,
});
const showNextReset = defineModel<boolean>("showNextReset", { required: true });
const separateCompleted = defineModel<boolean>("separateCompleted", {
required: true,
});
const showMissed = defineModel<boolean>("showMissed", { required: true });
</script>
<template>
<div class="collapse collapse-arrow font-light text-sm">
<input id="options-dropdown p-0" type="checkbox" />
<div class="collapse-title p-0 content-center">
<settings-2-icon class="inline" :size="16" />
{{ $t("options.title") }}
</div>
<div class="collapse-content">
<div class="w-full flex flex-col gap-2 text-left overflow-scroll">
<label class="label">
<arrow-down-up-icon class="inline" />
{{ $t("options.sort_by") }}
<select
v-model="sortType"
class="select"
@change="$emit('changeSort')"
>
<option :value="SortType.CREATED_AT">
{{ $t("options.sort.created_at") }}
</option>
<option :value="SortType.UPDATED_AT">
{{ $t("options.sort.updated_at") }}
</option>
<option :value="SortType.CHECK_DATE">
{{ $t("options.sort.check_date") }}
</option>
<option :value="SortType.RESET_DATE">
{{ $t("options.sort.reset_date") }}
</option>
<option :value="SortType.NAME">
{{ $t("options.sort.name") }}
</option>
</select>
</label>
<label class="label text-wrap">
<input
v-model="sortReverse"
type="checkbox"
class="checkbox"
@change="$emit('changeSort')"
/>
{{ $t("options.reverse_sort") }}
</label>
<label class="label text-wrap">
<input
v-model="showLastChecked"
type="checkbox"
class="checkbox"
/>
{{ $t("options.last_checked") }}
</label>
<label class="label text-wrap">
<input
v-model="showNextReset"
type="checkbox"
class="checkbox"
/>
{{ $t("options.next_reset") }}
</label>
<label class="label text-wrap">
<input
v-model="separateCompleted"
type="checkbox"
class="checkbox"
/>
{{ $t("options.separate_completed") }}
</label>
<label class="label text-wrap">
<input
v-model="showMissed"
type="checkbox"
class="checkbox"
/>
{{ $t("options.missed") }}
</label>
</div>
</div>
</div>
</template>
+19 -2
View File
@@ -13,7 +13,12 @@ import { updateTask } from "@/api/tasks";
const CronInput = defineAsyncComponent( const CronInput = defineAsyncComponent(
() => import("@/components/CronInput.vue"), () => import("@/components/CronInput.vue"),
); );
import { isTemporary, taskCompleted, taskNextReset } from "@/lib/tasks"; import {
isTemporary,
taskCompleted,
taskFutureReset,
taskNextReset,
} from "@/lib/tasks";
import { relativeTime } from "@/lib/dates"; import { relativeTime } from "@/lib/dates";
import { useAlertStore } from "@/stores/alerts"; import { useAlertStore } from "@/stores/alerts";
import { useI18n } from "vue-i18n"; import { useI18n } from "vue-i18n";
@@ -23,7 +28,11 @@ const emit =
defineEmits<(e: "clone" | "delete" | "updated", task: Task) => void>(); defineEmits<(e: "clone" | "delete" | "updated", task: Task) => void>();
const task = defineModel<Task>({ required: true }); const task = defineModel<Task>({ required: true });
defineProps<{ showLastChecked: boolean; showNextReset: boolean }>(); defineProps<{
showLastChecked: boolean;
showNextReset: boolean;
showMissed: boolean;
}>();
const editMode = ref<boolean>(false); const editMode = ref<boolean>(false);
const editName = ref<string>(""); const editName = ref<string>("");
@@ -33,6 +42,13 @@ const editNameInput = ref<HTMLInputElement | null>(null);
const checked = computed<boolean>(() => taskCompleted(task.value)); const checked = computed<boolean>(() => taskCompleted(task.value));
const nextReset = computed<Date | null>(() => taskNextReset(task.value)); const nextReset = computed<Date | null>(() => taskNextReset(task.value));
const futureReset = computed<Date | null>(() => taskFutureReset(task.value));
const missed = computed<boolean>(
() =>
!checked.value &&
futureReset.value !== null &&
futureReset.value.getTime() < new Date().getTime(),
);
const i18n = useI18n(); const i18n = useI18n();
@@ -157,6 +173,7 @@ watch(task, () => {
</div> </div>
<div <div
class="cursor-pointer text-lg select-none" class="cursor-pointer text-lg select-none"
:class="showMissed && missed ? 'text-error' : ''"
@click.prevent="onOpen" @click.prevent="onOpen"
> >
<div>{{ task.name }}</div> <div>{{ task.name }}</div>
+24
View File
@@ -36,6 +36,21 @@ export function parseCron(cron: string | null): {
type: CronType.EVERY_MONTH, type: CronType.EVERY_MONTH,
value: parseInt(value[1] ?? ""), value: parseInt(value[1] ?? ""),
}; };
} else if ((value = /^0 0 L \* \*$/i.exec(cron)) !== null) {
return {
type: CronType.EVERY_MONTH,
value: 32,
};
} else if ((value = /^0 0 \* \* (\d+)#1$/i.exec(cron)) !== null) {
return {
type: CronType.EVERY_MONTH,
value: -parseInt(value[1] ?? ""),
};
} else if ((value = /^0 0 \* \* (\d+)L$/i.exec(cron)) !== null) {
return {
type: CronType.EVERY_MONTH,
value: -parseInt(value[1] ?? "") - 7,
};
} else if ((value = /^0 0 1 (\d+) \*$/i.exec(cron)) !== null) { } else if ((value = /^0 0 1 (\d+) \*$/i.exec(cron)) !== null) {
return { return {
type: CronType.EVERY_YEAR, type: CronType.EVERY_YEAR,
@@ -99,6 +114,15 @@ export function getCron(
case CronType.EVERY_WEEK: case CronType.EVERY_WEEK:
return `0 0 * * ${value.toFixed(0)}`; return `0 0 * * ${value.toFixed(0)}`;
case CronType.EVERY_MONTH: case CronType.EVERY_MONTH:
if (value === 32) {
return `0 0 L * *`;
}
if (value < 0 && value >= -7) {
return `0 0 * * ${(-value).toFixed(0)}#1`;
}
if (value < -7 && value >= -14) {
return `0 0 * * ${(-value - 7).toFixed(0)}L`;
}
return `0 0 ${value.toFixed(0)} * *`; return `0 0 ${value.toFixed(0)} * *`;
case CronType.EVERY_YEAR: case CronType.EVERY_YEAR:
return `0 0 1 ${value.toFixed(0)} *`; return `0 0 1 ${value.toFixed(0)} *`;
+4
View File
@@ -38,6 +38,10 @@ export function taskNextReset(task: Task): Date | null {
return nextCronReset(task.check_date, task.reset_cron, task.id); return nextCronReset(task.check_date, task.reset_cron, task.id);
} }
export function taskFutureReset(task: Task): Date | null {
return nextCronReset(taskNextReset(task), task.reset_cron, task.id);
}
export function taskCompleted(task: Task): boolean { export function taskCompleted(task: Task): boolean {
const nextReset = taskNextReset(task); const nextReset = taskNextReset(task);
if (nextReset === null) { if (nextReset === null) {
+16 -81
View File
@@ -4,8 +4,6 @@ import type { Task } from "@/types";
import { getTasks, createTask, deleteTask } from "@/api/tasks"; import { getTasks, createTask, deleteTask } from "@/api/tasks";
import { import {
CirclePlusIcon, CirclePlusIcon,
ArrowDownUpIcon,
Settings2Icon,
CircleCheckBigIcon, CircleCheckBigIcon,
CheckCheckIcon, CheckCheckIcon,
SearchIcon, SearchIcon,
@@ -14,6 +12,9 @@ import {
const TaskItem = defineAsyncComponent( const TaskItem = defineAsyncComponent(
() => import("@/components/TaskItem.vue"), () => import("@/components/TaskItem.vue"),
); );
const ListOptions = defineAsyncComponent(
() => import("@/components/ListOptions.vue"),
);
import { taskCompleted, sortTasks, newTemporaryTask } from "@/lib/tasks"; import { taskCompleted, sortTasks, newTemporaryTask } from "@/lib/tasks";
import { SortType } from "@/enums"; import { SortType } from "@/enums";
import { booleanCookieRef, enumCookieRef } from "@/lib/cookies"; import { booleanCookieRef, enumCookieRef } from "@/lib/cookies";
@@ -36,6 +37,7 @@ const sortReverse = booleanCookieRef("sortReverse", false);
const showLastChecked = booleanCookieRef("showLastChecked", false); const showLastChecked = booleanCookieRef("showLastChecked", false);
const showNextReset = booleanCookieRef("showNextReset", false); const showNextReset = booleanCookieRef("showNextReset", false);
const separateCompleted = booleanCookieRef("separateCompleted", true); const separateCompleted = booleanCookieRef("separateCompleted", true);
const showMissed = booleanCookieRef("showMissed", true);
const completedCount = computed<number>( const completedCount = computed<number>(
() => tasks.value.filter(taskCompleted).length, () => tasks.value.filter(taskCompleted).length,
@@ -146,14 +148,6 @@ function onDeleteTask(task: Task) {
}); });
} }
function onChangeSortType() {
reSortTasks();
}
function onChangeSortReverse() {
reSortTasks();
}
function onShare() { function onShare() {
if (!empty.value) { if (!empty.value) {
shareLink( shareLink(
@@ -229,6 +223,7 @@ onBeforeRouteLeave(() => {
v-model="tasks[i]" v-model="tasks[i]"
:show-last-checked="showLastChecked" :show-last-checked="showLastChecked"
:show-next-reset="showNextReset" :show-next-reset="showNextReset"
:show-missed="showMissed"
@updated="onUpdateTask" @updated="onUpdateTask"
@clone="onCloneTask" @clone="onCloneTask"
@delete="onDeleteTask" @delete="onDeleteTask"
@@ -256,6 +251,7 @@ onBeforeRouteLeave(() => {
v-model="tasks[i]" v-model="tasks[i]"
:show-last-checked="showLastChecked" :show-last-checked="showLastChecked"
:show-next-reset="showNextReset" :show-next-reset="showNextReset"
:show-missed="showMissed"
@clone="onCloneTask" @clone="onCloneTask"
@delete="onDeleteTask" @delete="onDeleteTask"
/> />
@@ -281,76 +277,15 @@ onBeforeRouteLeave(() => {
<circle-plus-icon /> <circle-plus-icon />
</button> </button>
</div> </div>
<div <list-options
v-if="!empty" v-if="!empty"
class="mt-4 -mb-4 collapse collapse-arrow font-light text-sm" v-model:sort-type="sortType"
> v-model:sort-reverse="sortReverse"
<input id="options-dropdown p-0" type="checkbox" /> v-model:show-last-checked="showLastChecked"
<div class="collapse-title p-0 content-center"> v-model:show-next-reset="showNextReset"
<settings-2-icon class="inline" :size="16" /> v-model:separate-completed="separateCompleted"
{{ $t("options.title") }} v-model:show-missed="showMissed"
</div> class="mt-4 -mb-4"
<div class="collapse-content"> @change-sort="reSortTasks"
<fieldset class="fieldset flex flex-col gap-2"> />
<label class="label">
<arrow-down-up-icon class="inline" />
{{ $t("options.sort_by") }}
<select
v-model="sortType"
class="select"
@change="onChangeSortType"
>
<option :value="SortType.CREATED_AT">
{{ $t("options.sort.created_at") }}
</option>
<option :value="SortType.UPDATED_AT">
{{ $t("options.sort.updated_at") }}
</option>
<option :value="SortType.CHECK_DATE">
{{ $t("options.sort.check_date") }}
</option>
<option :value="SortType.RESET_DATE">
{{ $t("options.sort.reset_date") }}
</option>
<option :value="SortType.NAME">
{{ $t("options.sort.name") }}
</option>
</select>
</label>
<label class="label">
<input
v-model="sortReverse"
type="checkbox"
class="checkbox"
@change="onChangeSortReverse"
/>
{{ $t("options.reverse_sort") }}
</label>
<label class="label">
<input
v-model="showLastChecked"
type="checkbox"
class="checkbox"
/>
{{ $t("options.last_checked") }}
</label>
<label class="label">
<input
v-model="showNextReset"
type="checkbox"
class="checkbox"
/>
{{ $t("options.next_reset") }}
</label>
<label class="label">
<input
v-model="separateCompleted"
type="checkbox"
class="checkbox"
/>
{{ $t("options.separate_completed") }}
</label>
</fieldset>
</div>
</div>
</template> </template>
Generated
+1 -1
View File
@@ -323,7 +323,7 @@ asyncpg = [
[[package]] [[package]]
name = "tout-doux" name = "tout-doux"
version = "1.5.0" version = "1.6.0"
source = { editable = "." } source = { editable = "." }
dependencies = [ dependencies = [
{ name = "flask", extra = ["async"] }, { name = "flask", extra = ["async"] },