From ca47f9c18b9ca4c950a70e50c9e7fc66dc39127c Mon Sep 17 00:00:00 2001 From: Gros Frumos Date: Sat, 21 Mar 2026 09:24:13 +0200 Subject: [PATCH] kin: KIN-UI-026-frontend_dev --- web/frontend/src/views/Dashboard.vue | 57 ++++++++++++++++++++++++++-- 1 file changed, 53 insertions(+), 4 deletions(-) diff --git a/web/frontend/src/views/Dashboard.vue b/web/frontend/src/views/Dashboard.vue index 1966342..8aa2393 100644 --- a/web/frontend/src/views/Dashboard.vue +++ b/web/frontend/src/views/Dashboard.vue @@ -22,6 +22,33 @@ const filteredProjects = computed(() => { ) }) +const SORT_OPTIONS = ['name', 'priority', 'active', 'cost'] as const +type SortOption = typeof SORT_OPTIONS[number] +const selectedSort = ref('name') +const showSortMenu = ref(false) + +const sortedProjects = computed(() => { + const list = [...filteredProjects.value] + switch (selectedSort.value) { + case 'priority': return list.sort((a, b) => b.priority - a.priority) + case 'active': return list.sort((a, b) => b.active_tasks - a.active_tasks) + case 'cost': return list.sort((a, b) => (costMap.value[b.id] || 0) - (costMap.value[a.id] || 0)) + default: return list.sort((a, b) => a.name.localeCompare(b.name)) + } +}) + +const GROUP_KEYS = ['development', 'operations', 'research'] as const + +const groupedProjects = computed(() => { + const groups: Record = { development: [], operations: [], research: [] } + for (const p of sortedProjects.value) { + const ptype = p.project_type || 'development' + const key = ptype in groups ? ptype : 'development' + groups[key].push(p) + } + return groups +}) + // Add project modal const showAdd = ref(false) const form = ref({ @@ -227,17 +254,36 @@ async function createNewProject() { -
+
+ class="flex-1 bg-gray-800 border border-gray-700 rounded px-3 py-1.5 text-sm text-gray-300 placeholder-gray-600 focus:border-gray-500 outline-none" /> +
+
+ +
+ +
+

{{ t('dashboard.loading') }}

{{ error }}

-
-
+
+