diff --git a/frontend/src/components/TaskBadges.vue b/frontend/src/components/TaskBadges.vue index 7c03f0b..a60d089 100644 --- a/frontend/src/components/TaskBadges.vue +++ b/frontend/src/components/TaskBadges.vue @@ -10,6 +10,7 @@ priorityLabel, priorityVariant, recurrenceLabel, + statusIcon, statusLabel, statusVariant, } from '../taskui' @@ -20,15 +21,17 @@ \ No newline at end of file diff --git a/frontend/src/components/TaskCard.vue b/frontend/src/components/TaskCard.vue index dc1d7b7..28a461c 100644 --- a/frontend/src/components/TaskCard.vue +++ b/frontend/src/components/TaskCard.vue @@ -28,7 +28,7 @@ // Markdown-разметку убираем — сниппет plain-текст. const snippet = computed(() => { const text = - props.task.description.trim() || proposalItems(props.task).join(' · ') + props.task.description.trim() || proposalItems(props.task).map((i) => i.label).join(' · ') return text .replace(/\[([^\]]+)\]\([^)]*\)/g, '$1') .replace(/\*\*([^*]+)\*\*/g, '$1') diff --git a/frontend/src/taskui.ts b/frontend/src/taskui.ts index 7c49787..43f90ba 100644 --- a/frontend/src/taskui.ts +++ b/frontend/src/taskui.ts @@ -31,6 +31,19 @@ return STATUS_VARIANTS[status] ?? 'neutral' } +// Иконка статуса — согласована со счётчиками статистики (ph-square / ph-circle-half / …) +export const STATUS_ICONS: Record = { + to_do: 'ph-square', + in_progress: 'ph-circle-half', + done: 'ph-check-circle', + cancelled: 'ph-x-circle', + deferred: 'ph-pause-circle', +} + +export function statusIcon(status: string): string { + return STATUS_ICONS[status] ?? 'ph-square' +} + export function relevanceLabel(status: string): string { return tOr(`taskui.relevance.${status}`, status) } @@ -212,15 +225,19 @@ // Подписи чернового предложения LLM (стек, страница задачи) export function proposalItems(task: { ai_proposal: import('./api').AiProposal | null -}): string[] { +}): { icon: string; label: string }[] { const p = task.ai_proposal if (!p) return [] - const items: string[] = [] - p.tags.forEach((tag) => items.push(tag)) + const items: { icon: string; label: string }[] = [] + p.tags.forEach((tag) => items.push({ icon: 'ph-tag', label: tag })) if (p.project) - items.push(p.new_project ? t('stack.proposalNewProject', { name: p.project }) : p.project) - if (p.priority !== null) items.push(t('stack.proposalPriority', { n: p.priority })) + items.push({ + icon: 'ph-folder', + label: p.new_project ? t('stack.proposalNewProject', { name: p.project }) : p.project, + }) + if (p.priority !== null) + items.push({ icon: 'ph-flag', label: t('stack.proposalPriority', { n: p.priority }) }) if (p.estimated_minutes !== null && p.estimated_minutes !== undefined) - items.push(`≈ ${formatMinutes(p.estimated_minutes)}`) + items.push({ icon: 'ph-timer', label: `≈ ${formatMinutes(p.estimated_minutes)}` }) return items } \ No newline at end of file diff --git a/frontend/src/views/StackView.vue b/frontend/src/views/StackView.vue index c964734..abbda31 100644 --- a/frontend/src/views/StackView.vue +++ b/frontend/src/views/StackView.vue @@ -193,7 +193,7 @@
{{ t('stack.proposal') }} - {{ item }} +