Author SHA1 Message Date
klemek aeeabe81c7 chore: 1.7.6
Python Lint CI / ruff (push) Successful in 2m38s
Python Lint CI / ruff-format-check (push) Successful in 3m51s
Python Lint CI / ty (push) Successful in 3m22s
Docker Build / build (push) Successful in 7m56s
TS Lint / ESLint (push) Successful in 4m50s
TS Lint / Oxlint (push) Successful in 3m40s
TS Lint / TypeScript (push) Successful in 3m44s
2026-08-02 09:48:32 +02:00
klemek 87eff715f6 fix: rrule detection 2026-08-02 09:48:28 +02:00
klemek 63c80f0bae chore: 1.7.5
Python Lint CI / ruff (push) Successful in 5m57s
Python Lint CI / ruff-format-check (push) Successful in 6m31s
Python Lint CI / ty (push) Successful in 6m31s
TS Lint / ESLint (push) Successful in 6m1s
TS Lint / Oxlint (push) Successful in 5m17s
Docker Build / build (push) Successful in 14m5s
TS Lint / TypeScript (push) Successful in 5m27s
2026-08-02 09:40:44 +02:00
klemek f36c8ba315 fix: sorting resets 2026-08-02 09:40:41 +02:00
klemek 7fc16e78de chore: 1.7.4
Python Lint CI / ruff (push) Successful in 3m56s
Python Lint CI / ruff-format-check (push) Successful in 3m53s
Python Lint CI / ty (push) Successful in 4m2s
TS Lint / Oxlint (push) Successful in 3m46s
TS Lint / ESLint (push) Successful in 3m50s
Docker Build / build (push) Successful in 10m13s
TS Lint / TypeScript (push) Successful in 4m54s
2026-08-02 09:32:00 +02:00
klemek f8f38c9197 fix: task sorting 2026-08-02 09:31:56 +02:00
klemek 6e508547fc chore: 1.7.3
Python Lint CI / ruff (push) Successful in 6m21s
Python Lint CI / ruff-format-check (push) Successful in 5m58s
Python Lint CI / ty (push) Successful in 6m31s
Docker Build / build (push) Successful in 12m58s
TS Lint / ESLint (push) Successful in 6m3s
TS Lint / Oxlint (push) Successful in 6m0s
TS Lint / TypeScript (push) Successful in 6m20s
2026-08-02 09:04:21 +02:00
klemek eea6825ac7 fix: every day without hour 2026-08-02 09:04:15 +02:00
klemek d8c7cc498d fix: separate newly created with a fallback date 2026-08-02 09:03:13 +02:00
klemek 7d2e8cae5d fix: remove unused function 2026-08-02 08:59:20 +02:00
klemek f680b04533 perf: faster app without defineAsync 2026-08-02 08:59:13 +02:00
12 changed files with 77 additions and 103 deletions
+1
View File
@@ -1,5 +1,6 @@
{
"lockfileVersion": 1,
"configVersion": 0,
"workspaces": {
"": {
"name": "tout-doux",
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "tout-doux",
"version": "1.7.2",
"version": "1.7.6",
"private": true,
"type": "module",
"engines": {
+1 -1
View File
@@ -1,6 +1,6 @@
[project]
name = "tout-doux"
version = "1.7.2"
version = "1.7.6"
description = ""
requires-python = ">=3.14"
dependencies = [
+1 -4
View File
@@ -1,9 +1,6 @@
<script setup lang="ts">
import { useAlertStore } from "@/stores/alerts";
import { defineAsyncComponent } from "vue";
const AlertItem = defineAsyncComponent(
() => import("@/components/AlertItem.vue"),
);
import AlertItem from "@/components/AlertItem.vue";
const { alerts } = useAlertStore();
</script>
+2 -18
View File
@@ -1,10 +1,8 @@
<script setup lang="ts">
import { ref, onBeforeMount, watch, defineAsyncComponent } from "vue";
import { ref, onBeforeMount, watch } from "vue";
import { getCron, parseCron, validCron } from "@/lib/recurrence";
import { CronType } from "@/enums";
const DateInput = defineAsyncComponent(
() => import("@/components/DateInput.vue"),
);
import DateInput from "@/components/DateInput.vue";
const DEFAULT_CRON = "0 0 * * *";
@@ -116,20 +114,6 @@ watch(cron, () => {
{{ $t("cron.type.one_time") }}
</option>
</select>
<select
v-if="cronType === CronType.EVERY_DAY"
v-model="cronValue"
class="select flex-1"
@change="onChangeCronValue"
>
<option
v-for="i in Array.from(Array(24).keys())"
:key="`h${i + 1}`"
:value="i"
>
{{ i.toFixed(0).padStart(2, "0") }}:00
</option>
</select>
<select
v-if="cronType === CronType.EVERY_WEEK"
v-model="cronValue"
+4 -8
View File
@@ -1,17 +1,13 @@
<script setup lang="ts">
import { getMetadata } from "@/api/meta";
import type { Metadata } from "@/types";
import { defineAsyncComponent, onBeforeMount, ref } from "vue";
import { onBeforeMount, ref } from "vue";
import LangInput from "@/components/LangInput.vue";
const metadata = ref<Metadata|null>(null);
const LangInput = defineAsyncComponent(
() => import("@/components/LangInput.vue"),
);
const metadata = ref<Metadata | null>(null);
function fetchMetadata() {
void getMetadata()
.then((data) => {
void getMetadata().then((data) => {
metadata.value = data;
setTimeout(fetchMetadata, 600000);
});
+1 -4
View File
@@ -4,15 +4,12 @@ import {
ref,
watch,
computed,
defineAsyncComponent,
nextTick,
} from "vue";
import type { Task } from "@/types";
import { CopyIcon, TrashIcon, SaveIcon, XIcon } from "@lucide/vue";
import { updateTask } from "@/api/tasks";
const CronInput = defineAsyncComponent(
() => import("@/components/CronInput.vue"),
);
import CronInput from "@/components/CronInput.vue";
import {
isTemporary,
taskCompleted,
+7 -7
View File
@@ -22,7 +22,7 @@ export function parseCron(cron: string | null): {
value: 0,
date: null,
};
} else if (cron.startsWith("RRULE:") || cron.startsWith("DTSTART:")) {
} else if (isRrule(cron)) {
return parseRrule(cron);
} else if ((value = /^0 (\d+) \* \* \*$/i.exec(cron)) !== null) {
return {
@@ -75,6 +75,10 @@ export function parseCron(cron: string | null): {
}
}
function isRrule(cron: string): boolean {
return cron.startsWith("RRULE:") || cron.startsWith("DTSTART:");
}
export function parseRrule(rule: string): {
type: CronType;
value: number;
@@ -128,7 +132,7 @@ export function getCron(
case CronType.ONE_TIME:
return ONE_TIME_VALUE;
case CronType.EVERY_DAY:
return `0 ${value.toFixed(0)} * * *`;
return `0 0 * * *`;
case CronType.EVERY_WEEK:
return `0 0 * * ${value.toFixed(0)}`;
case CronType.EVERY_MONTH:
@@ -171,10 +175,6 @@ export function getCron(
return null;
}
function dtStartFormat(date: Date): string {
return `${date.getFullYear().toFixed(0)}${(date.getMonth() + 1).toFixed(0).padStart(2, "0")}${date.getDate().toFixed(0).padStart(2, "0")}T000000Z`;
}
export function isOneTime(cron: string | null): boolean {
return cron === ONE_TIME_VALUE;
}
@@ -197,7 +197,7 @@ export function nextCronReset(
return null;
}
try {
if (cron.startsWith("RRULE:")) {
if (isRrule(cron)) {
try {
const rule = new RRule({
...RRule.parseString(cron),
+44 -39
View File
@@ -35,11 +35,27 @@ export function isTemporary(task: Task): boolean {
}
export function taskNextReset(task: Task): Date | null {
return nextCronReset(task.check_date ?? new Date(), task.reset_cron, task.id);
return nextCronReset(
task.check_date ?? new Date(),
task.reset_cron,
task.id,
);
}
export function taskFutureReset(task: Task): Date | null {
return nextCronReset(taskNextReset(task) ?? new Date(), task.reset_cron, task.id);
return nextCronReset(
taskNextReset(task) ?? new Date(),
task.reset_cron,
task.id,
);
}
export function taskSortReset(task: Task): Date | null {
let resetDate = taskNextReset(task);
while (resetDate !== null && resetDate.getTime() < new Date().getTime()) {
resetDate = nextCronReset(resetDate, task.reset_cron, task.id);
}
return resetDate;
}
export function taskCompleted(task: Task): boolean {
@@ -53,54 +69,43 @@ export function taskCompleted(task: Task): boolean {
return nextReset.getTime() > new Date().getTime();
}
export function sortTasks(
tasks: Task[],
export function fallbackDate(task: Task): Date {
return new Date(
(task.check_date ?? task.created_at).getFullYear() + 100,
(task.check_date ?? task.created_at).getMonth(),
(task.check_date ?? task.created_at).getDate(),
0,
0,
0,
0,
);
}
export function taskSortFunction(
sortType: SortType,
reverse: boolean,
): Task[] {
): (a: Task, b: Task) => number {
switch (sortType) {
case SortType.CREATED_AT:
return tasks
.slice()
.sort(
(a: Task, b: Task) =>
return (a: Task, b: Task) =>
(reverse ? -1 : 1) *
(a.created_at.getTime() - b.created_at.getTime()),
);
(a.created_at.getTime() - b.created_at.getTime());
case SortType.UPDATED_AT:
return tasks
.slice()
.sort(
(a: Task, b: Task) =>
return (a: Task, b: Task) =>
(reverse ? -1 : 1) *
(a.updated_at.getTime() - b.updated_at.getTime()),
);
(a.updated_at.getTime() - b.updated_at.getTime());
case SortType.CHECK_DATE:
return tasks
.slice()
.sort(
(a: Task, b: Task) =>
return (a: Task, b: Task) =>
(reverse ? -1 : 1) *
((a.check_date ?? a.created_at).getTime() -
(b.check_date ?? b.created_at).getTime()),
);
((a.check_date ?? fallbackDate(a)).getTime() -
(b.check_date ?? fallbackDate(b)).getTime());
case SortType.RESET_DATE:
return tasks
.slice()
.sort(
(a: Task, b: Task) =>
return (a: Task, b: Task) =>
(reverse ? -1 : 1) *
(taskNextReset(a) ?? a.created_at).getTime() -
(taskNextReset(b) ?? b.created_at).getTime(),
);
((taskSortReset(a) ?? fallbackDate(a)).getTime() -
(taskSortReset(b) ?? fallbackDate(b)).getTime());
case SortType.NAME:
return tasks
.slice()
.sort(
(a: Task, b: Task) =>
(reverse ? -1 : 1) * a.name.localeCompare(b.name),
);
default:
return tasks.slice();
return (a: Task, b: Task) =>
(reverse ? -1 : 1) * a.name.localeCompare(b.name);
}
}
+2 -4
View File
@@ -2,11 +2,9 @@
import { useListStore } from "@/stores/lists";
import { ArrowBigRightDashIcon, DicesIcon, HistoryIcon } from "@lucide/vue";
import { generateSlug } from "random-word-slugs";
import { defineAsyncComponent, onBeforeMount, ref } from "vue";
import { onBeforeMount, ref } from "vue";
import { onBeforeRouteUpdate } from "vue-router";
const RecentItem = defineAsyncComponent(
() => import("@/components/RecentItem.vue"),
);
import RecentItem from "@/components/RecentItem.vue";
const listNameInput = ref<string>(generateSlug(4));
+5 -9
View File
@@ -1,5 +1,5 @@
<script setup lang="ts">
import { ref, onBeforeMount, computed, defineAsyncComponent } from "vue";
import { ref, onBeforeMount, computed } from "vue";
import type { Task } from "@/types";
import { getTasks, createTask, deleteTask } from "@/api/tasks";
import {
@@ -9,13 +9,9 @@ import {
SearchIcon,
Share2Icon,
} from "@lucide/vue";
const TaskItem = defineAsyncComponent(
() => import("@/components/TaskItem.vue"),
);
const ListOptions = defineAsyncComponent(
() => import("@/components/ListOptions.vue"),
);
import { taskCompleted, sortTasks, newTemporaryTask } from "@/lib/tasks";
import TaskItem from "@/components/TaskItem.vue";
import ListOptions from "@/components/ListOptions.vue";
import { taskCompleted, taskSortFunction, newTemporaryTask } from "@/lib/tasks";
import { SortType } from "@/enums";
import { booleanCookieRef, enumCookieRef } from "@/lib/cookies";
import { useAlertStore } from "@/stores/alerts";
@@ -79,7 +75,7 @@ function fetchTasks(requestedList: string) {
}
function reSortTasks(update = false) {
tasks.value = sortTasks(tasks.value, sortType.value, sortReverse.value);
tasks.value.sort(taskSortFunction(sortType.value, sortReverse.value));
if (update) {
updateTitle();
if (tasks.value.length && list.value) {
Generated
+1 -1
View File
@@ -323,7 +323,7 @@ asyncpg = [
[[package]]
name = "tout-doux"
version = "1.7.2"
version = "1.7.6"
source = { editable = "." }
dependencies = [
{ name = "flask", extra = ["async"] },