feat: empty list message
TS Lint / ESLint (push) Successful in 5m38s
TS Lint / Oxlint (push) Successful in 6m17s
TS Lint / TypeScript (push) Successful in 6m24s

This commit is contained in:
2026-07-14 10:52:10 +02:00
parent c7b1f3ed49
commit 3b499ff791
4 changed files with 13 additions and 1 deletions
+1 -1
View File
@@ -12,7 +12,7 @@
- [x] list option: move completed below - [x] list option: move completed below
- [x] list option: hide completed - [x] list option: hide completed
- [x] options in cookies - [x] options in cookies
- [ ] Empty list message - [x] Empty list message
- [x] change lang - [x] change lang
- [ ] toasts - [ ] toasts
- [ ] handle errors - [ ] handle errors
+2
View File
@@ -42,6 +42,8 @@
"resets": "Resets", "resets": "Resets",
"completed": "Completed", "completed": "Completed",
"new_task_hint": "New task", "new_task_hint": "New task",
"empty_hint": "Looks like there's nothing here, start by adding a new task.",
"all_completed_hint": "Looks like everything's been done!",
"options": { "options": {
"title": "Options", "title": "Options",
"sort_by": "Sort by", "sort_by": "Sort by",
+2
View File
@@ -42,6 +42,8 @@
"resets": "Reviens", "resets": "Reviens",
"completed": "Complété", "completed": "Complété",
"new_task_hint": "Nouvelle tâche", "new_task_hint": "Nouvelle tâche",
"empty_hint": "On dirait qu'il n'y a rien ici, commence par ajouter une tâche.",
"all_completed_hint": "On dirait bien que tout a été fait !",
"options": { "options": {
"title": "Options", "title": "Options",
"sort_by": "Trier par", "sort_by": "Trier par",
+8
View File
@@ -19,6 +19,8 @@ const showNextReset = booleanCookieRef("toutDouxShowNextReset", false);
const separateCompleted = booleanCookieRef("toutDouxSeparateCompleted", false); const separateCompleted = booleanCookieRef("toutDouxSeparateCompleted", false);
const hasCompleted = computed<boolean>(() => tasks.value.some(taskCompleted)); const hasCompleted = computed<boolean>(() => tasks.value.some(taskCompleted));
const empty = computed<boolean>(() => tasks.value.length === 0);
const allCompleted = computed<boolean>(() => tasks.value.every(taskCompleted));
function fetchTasks() { function fetchTasks() {
void getTasks(list.value) void getTasks(list.value)
@@ -88,6 +90,12 @@ onBeforeMount(fetchTasks);
/> />
</li> </li>
</template> </template>
<li v-if="empty" class="list-row italic text-xl font-extralight">
{{ $t('empty_hint') }}
</li>
<li v-if="allCompleted && separateCompleted" class="list-row italic text-xl font-extralight">
{{ $t('all_completed_hint') }}
</li>
<li class="list-row"> <li class="list-row">
<div class="list-col-grow"> <div class="list-col-grow">
<input <input