diff --git a/biome.json b/biome.json deleted file mode 100644 index d9ee9e2..0000000 --- a/biome.json +++ /dev/null @@ -1,41 +0,0 @@ -{ - "$schema": "https://biomejs.dev/schemas/2.4.2/schema.json", - "vcs": { - "enabled": true, - "clientKind": "git", - "useIgnoreFile": true - }, - "files": { - "includes": ["**", "!!**/dist"] - }, - "formatter": { - "enabled": true, - "indentStyle": "space", - "indentWidth": 2, - "lineWidth": 100 - }, - "linter": { - "enabled": true, - "rules": { - "recommended": true - } - }, - "javascript": { - "formatter": { - "quoteStyle": "double" - } - }, - "assist": { - "enabled": true, - "actions": { - "source": { - "organizeImports": "on" - } - } - }, - "css": { - "parser": { - "tailwindDirectives": true - } - } -} diff --git a/package.json b/package.json index b293c7e..908a7a1 100644 --- a/package.json +++ b/package.json @@ -13,7 +13,7 @@ "build:ios": "tauri ios build", "preview": "vite preview", "tauri": "tauri", - "format": "biome format --write" + "format": "eslint format --write" }, "dependencies": { "@phosphor-icons/vue": "^2.2.1", @@ -31,7 +31,6 @@ "vue-router": "^4.6.4" }, "devDependencies": { - "@biomejs/biome": "2.4.2", "@tailwindcss/vite": "^4.2.0", "@tauri-apps/cli": "^2", "@vitejs/plugin-vue": "^6.0.4", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index e1f4260..ccbe595 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -48,9 +48,6 @@ importers: specifier: ^4.6.4 version: 4.6.4(vue@3.5.28(typescript@5.9.3)) devDependencies: - '@biomejs/biome': - specifier: 2.4.2 - version: 2.4.2 '@tailwindcss/vite': specifier: ^4.2.0 version: 4.2.0(vite@7.3.1(jiti@2.6.1)(lightningcss@1.31.1)) @@ -92,59 +89,6 @@ packages: resolution: {integrity: sha512-LwdZHpScM4Qz8Xw2iKSzS+cfglZzJGvofQICy7W7v4caru4EaAmyUuO6BGrbyQ2mYV11W0U8j5mBhd14dd3B0A==} engines: {node: '>=6.9.0'} - '@biomejs/biome@2.4.2': - resolution: {integrity: sha512-vVE/FqLxNLbvYnFDYg3Xfrh1UdFhmPT5i+yPT9GE2nTUgI4rkqo5krw5wK19YHBd7aE7J6r91RRmb8RWwkjy6w==} - engines: {node: '>=14.21.3'} - hasBin: true - - '@biomejs/cli-darwin-arm64@2.4.2': - resolution: {integrity: sha512-3pEcKCP/1POKyaZZhXcxFl3+d9njmeAihZ17k8lL/1vk+6e0Cbf0yPzKItFiT+5Yh6TQA4uKvnlqe0oVZwRxCA==} - engines: {node: '>=14.21.3'} - cpu: [arm64] - os: [darwin] - - '@biomejs/cli-darwin-x64@2.4.2': - resolution: {integrity: sha512-P7hK1jLVny+0R9UwyGcECxO6sjETxfPyBm/1dmFjnDOHgdDPjPqozByunrwh4xPKld8sxOr5eAsSqal5uKgeBg==} - engines: {node: '>=14.21.3'} - cpu: [x64] - os: [darwin] - - '@biomejs/cli-linux-arm64-musl@2.4.2': - resolution: {integrity: sha512-/x04YK9+7erw6tYEcJv9WXoBHcULI/wMOvNdAyE9S3JStZZ9yJyV67sWAI+90UHuDo/BDhq0d96LDqGlSVv7WA==} - engines: {node: '>=14.21.3'} - cpu: [arm64] - os: [linux] - - '@biomejs/cli-linux-arm64@2.4.2': - resolution: {integrity: sha512-DI3Mi7GT2zYNgUTDEbSjl3e1KhoP76OjQdm8JpvZYZWtVDRyLd3w8llSr2TWk1z+U3P44kUBWY3X7H9MD1/DGQ==} - engines: {node: '>=14.21.3'} - cpu: [arm64] - os: [linux] - - '@biomejs/cli-linux-x64-musl@2.4.2': - resolution: {integrity: sha512-wbBmTkeAoAYbOQ33f6sfKG7pcRSydQiF+dTYOBjJsnXO2mWEOQHllKlC2YVnedqZFERp2WZhFUoO7TNRwnwEHQ==} - engines: {node: '>=14.21.3'} - cpu: [x64] - os: [linux] - - '@biomejs/cli-linux-x64@2.4.2': - resolution: {integrity: sha512-GK2ErnrKpWFigYP68cXiCHK4RTL4IUWhK92AFS3U28X/nuAL5+hTuy6hyobc8JZRSt+upXt1nXChK+tuHHx4mA==} - engines: {node: '>=14.21.3'} - cpu: [x64] - os: [linux] - - '@biomejs/cli-win32-arm64@2.4.2': - resolution: {integrity: sha512-k2uqwLYrNNxnaoiW3RJxoMGnbKda8FuCmtYG3cOtVljs3CzWxaTR+AoXwKGHscC9thax9R4kOrtWqWN0+KdPTw==} - engines: {node: '>=14.21.3'} - cpu: [arm64] - os: [win32] - - '@biomejs/cli-win32-x64@2.4.2': - resolution: {integrity: sha512-9ma7C4g8Sq3cBlRJD2yrsHXB1mnnEBdpy7PhvFrylQWQb4PoyCmPucdX7frvsSBQuFtIiKCrolPl/8tCZrKvgQ==} - engines: {node: '>=14.21.3'} - cpu: [x64] - os: [win32] - '@esbuild/aix-ppc64@0.27.3': resolution: {integrity: sha512-9fJMTNFTWZMh5qwrBItuziu834eOCUcEqymSH7pY+zoMVEZg3gcPuBNxH1EvfVYe9h0x/Ptw8KBzv7qxb7l8dg==} engines: {node: '>=18'} @@ -980,41 +924,6 @@ snapshots: '@babel/helper-string-parser': 7.27.1 '@babel/helper-validator-identifier': 7.28.5 - '@biomejs/biome@2.4.2': - optionalDependencies: - '@biomejs/cli-darwin-arm64': 2.4.2 - '@biomejs/cli-darwin-x64': 2.4.2 - '@biomejs/cli-linux-arm64': 2.4.2 - '@biomejs/cli-linux-arm64-musl': 2.4.2 - '@biomejs/cli-linux-x64': 2.4.2 - '@biomejs/cli-linux-x64-musl': 2.4.2 - '@biomejs/cli-win32-arm64': 2.4.2 - '@biomejs/cli-win32-x64': 2.4.2 - - '@biomejs/cli-darwin-arm64@2.4.2': - optional: true - - '@biomejs/cli-darwin-x64@2.4.2': - optional: true - - '@biomejs/cli-linux-arm64-musl@2.4.2': - optional: true - - '@biomejs/cli-linux-arm64@2.4.2': - optional: true - - '@biomejs/cli-linux-x64-musl@2.4.2': - optional: true - - '@biomejs/cli-linux-x64@2.4.2': - optional: true - - '@biomejs/cli-win32-arm64@2.4.2': - optional: true - - '@biomejs/cli-win32-x64@2.4.2': - optional: true - '@esbuild/aix-ppc64@0.27.3': optional: true diff --git a/src/composables/useTasks.ts b/src/composables/useTasks.ts index 25659df..c998456 100644 --- a/src/composables/useTasks.ts +++ b/src/composables/useTasks.ts @@ -1,6 +1,7 @@ import { ref } from 'vue'; import { useApi } from './useApi.ts'; import { Task } from '../types.ts'; +import { useArrayReduce, useArrayUnique } from '@vueuse/core' const tasks = ref([]); const isLoading = ref(false); @@ -75,6 +76,15 @@ export function useTasks() { } } + const tasksByCategory = useArrayReduce(tasks.value.sort((a,b) => a.id_ - b.id_), (acc, task) => { + const tag = task.tag ?? 'Uncategorized'; + acc[tag] = acc[tag] ?? []; + acc[tag].push(task); + return acc; + }, {} as Record) + + const categories = useArrayUnique(Object.keys(tasksByCategory.value)) + return { tasks, isLoading, @@ -82,5 +92,6 @@ export function useTasks() { fetchTasks, createTask, updateTask, + categories, }; } diff --git a/src/screens/ListScreen.vue b/src/screens/ListScreen.vue index d03e9a5..8f3e6ea 100644 --- a/src/screens/ListScreen.vue +++ b/src/screens/ListScreen.vue @@ -14,12 +14,7 @@ onMounted(async () => { const visibleTasks = computed(() => tasks.value.filter(task => !task.archived)) -const categorizedTasks = computed(() => visibleTasks.value.reduce((acc, task) => { - const tag = task.tag ?? 'Uncategorized'; - acc[tag] = acc[tag] ?? []; - acc[tag].push(task); - return acc; -}, {} as Record)) +const categorizedTasks = computed(() => visibleTasks.value.reduce()) const collapsed = ref([]);