feat(tasks): add optional "none" priority level for tasks without urgency

New tasks default to "none" priority instead of "medium". Tasks with no
priority hide the badge in list and dashboard views, reducing visual noise
for routine items. Includes DB migration v4 and i18n keys (de, en, it).

Closes #15
This commit is contained in:
Ulas
2026-04-04 22:13:51 +02:00
parent 2508473265
commit 2c36fa0307
11 changed files with 64 additions and 11 deletions
+1
View File
@@ -100,6 +100,7 @@
"priorityHigh": "Hoch",
"priorityMedium": "Mittel",
"priorityLow": "Niedrig",
"priorityNone": "Keine",
"statusOpen": "Offen",
"statusInProgress": "In Bearbeitung",
"statusDone": "Erledigt",
+1
View File
@@ -100,6 +100,7 @@
"priorityHigh": "High",
"priorityMedium": "Medium",
"priorityLow": "Low",
"priorityNone": "None",
"statusOpen": "Open",
"statusInProgress": "In Progress",
"statusDone": "Done",
+1
View File
@@ -100,6 +100,7 @@
"priorityHigh": "Alta",
"priorityMedium": "Media",
"priorityLow": "Bassa",
"priorityNone": "Nessuna",
"statusOpen": "Aperto",
"statusInProgress": "In corso",
"statusDone": "Completato",
+1 -1
View File
@@ -167,7 +167,7 @@ function renderUrgentTasks(tasks) {
const due = formatDueDate(t.due_date);
return `
<div class="task-item" data-route="/tasks" role="button" tabindex="0">
<div class="task-item__priority task-item__priority--${t.priority}" aria-hidden="true"></div>
${t.priority !== 'none' ? `<div class="task-item__priority task-item__priority--${t.priority}" aria-hidden="true"></div>` : ''}
<span class="sr-only">${PRIORITY_LABELS()[t.priority] ?? t.priority}</span>
<div class="task-item__content">
<div class="task-item__title">${esc(t.title)}</div>
+3 -1
View File
@@ -20,6 +20,7 @@ const PRIORITIES = () => [
{ value: 'high', label: t('tasks.priorityHigh'), color: 'var(--color-priority-high)' },
{ value: 'medium', label: t('tasks.priorityMedium'), color: 'var(--color-priority-medium)' },
{ value: 'low', label: t('tasks.priorityLow'), color: 'var(--color-priority-low)' },
{ value: 'none', label: t('tasks.priorityNone'), color: 'var(--color-priority-none)' },
];
const STATUSES = () => [
@@ -110,6 +111,7 @@ function groupBy(tasks, mode) {
// --------------------------------------------------------
function renderPriorityBadge(priority) {
if (priority === 'none') return '';
return `<span class="priority-badge priority-badge--${priority}">
<span class="priority-dot priority-dot--${priority}"></span>
${PRIORITY_LABELS()[priority] ?? priority}
@@ -254,7 +256,7 @@ function renderModalContent({ task = null, users = [] } = {}) {
).join('');
const priorityOptions = PRIORITIES().map((p) =>
`<option value="${p.value}" ${(task?.priority ?? 'medium') === p.value ? 'selected' : ''}>${p.label}</option>`
`<option value="${p.value}" ${(task?.priority ?? 'none') === p.value ? 'selected' : ''}>${p.label}</option>`
).join('');
return `
+4
View File
@@ -114,12 +114,14 @@
/* --------------------------------------------------------
* 6. Farben - Prioritäten
* -------------------------------------------------------- */
--color-priority-none: var(--neutral-400);
--color-priority-low: var(--neutral-500);
--color-priority-medium: #B45309;
--color-priority-high: #D4511E;
--color-priority-urgent: #DC2626;
/* Hintergrundfarben für Priority-Badges */
--color-priority-none-bg: rgba(142, 141, 137, 0.08);
--color-priority-low-bg: rgba(142, 141, 137, 0.12);
--color-priority-medium-bg: rgba(180, 83, 9, 0.12);
--color-priority-high-bg: rgba(212, 81, 30, 0.12);
@@ -328,6 +330,7 @@
--meal-snack-light: #3D2010;
/* Priority-Badge Hintergründe */
--color-priority-none-bg: rgba(142, 141, 137, 0.12);
--color-priority-low-bg: rgba(142, 141, 137, 0.18);
--color-priority-medium-bg: rgba(230, 147, 10, 0.18);
--color-priority-high-bg: rgba(212, 81, 30, 0.18);
@@ -408,6 +411,7 @@
--meal-dinner-light: #1A2D4D;
--meal-snack-light: #3D2010;
--color-priority-none-bg: rgba(142, 141, 137, 0.12);
--color-priority-low-bg: rgba(142, 141, 137, 0.18);
--color-priority-medium-bg: rgba(230, 147, 10, 0.18);
--color-priority-high-bg: rgba(212, 81, 30, 0.18);
+3 -3
View File
@@ -12,9 +12,9 @@
* API: Immer Netzwerk (kein Caching von Nutzerdaten)
*/
const SHELL_CACHE = 'oikos-shell-v23';
const PAGES_CACHE = 'oikos-pages-v23';
const ASSETS_CACHE = 'oikos-assets-v23';
const SHELL_CACHE = 'oikos-shell-v24';
const PAGES_CACHE = 'oikos-pages-v24';
const ASSETS_CACHE = 'oikos-assets-v24';
const ALL_CACHES = [SHELL_CACHE, PAGES_CACHE, ASSETS_CACHE];
// App-Shell: sofort benötigt für ersten Render