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 -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 `