diff --git a/src/views/PeopleView.vue b/src/views/PeopleView.vue index 18b5708..aa5d2be 100644 --- a/src/views/PeopleView.vue +++ b/src/views/PeopleView.vue @@ -8,37 +8,88 @@ -
- - - -
-

Loading...

-
No results
-
-
-
- - - - - - +

- +
@@ -133,7 +184,6 @@ const loading = ref(true) const searchQuery = ref('') const searchResults = ref([]) const isSearching = ref(false) -const activeCategory = ref('confirmed') const selected = ref(null) const activeTab = ref('faces') const faces = ref([]) @@ -151,23 +201,28 @@ const candidates = ref([]) const candidateThumbs = ref>({}) const ctxMenu = ref({ show: false, x: 0, y: 0, person: null as any }) -const filteredPeople = computed(() => { - let base = people.value - if (isSearching.value && searchResults.value.length) base = searchResults.value - else if (searchQuery.value) { - const s = searchQuery.value.toLowerCase() - base = people.value.filter((p: any) => p.name.toLowerCase().includes(s)) - } - return base.filter((p: any) => p.status === activeCategory.value) +const confirmedPeople = computed(() => { + const base = isSearching.value && searchResults.value.length ? searchResults.value : people.value + const filtered = searchQuery.value ? base.filter((p: any) => p.name.toLowerCase().includes(searchQuery.value.toLowerCase())) : base + return filtered.filter((p: any) => p.status === 'confirmed') +}) + +const pendingPeople = computed(() => { + const base = isSearching.value && searchResults.value.length ? searchResults.value : people.value + const filtered = searchQuery.value ? base.filter((p: any) => p.name.toLowerCase().includes(searchQuery.value.toLowerCase())) : base + return filtered.filter((p: any) => p.status === 'pending') +}) + +const skippedPeople = computed(() => { + const base = isSearching.value && searchResults.value.length ? searchResults.value : people.value + const filtered = searchQuery.value ? base.filter((p: any) => p.name.toLowerCase().includes(searchQuery.value.toLowerCase())) : base + return filtered.filter((p: any) => p.status === 'skipped') }) onMounted(async () => { try { const result: any = await invoke('get_people', { page: 1, perPage: 1000 }) - people.value = (Array.isArray(result) ? result : []).map((p: any, i: number) => ({ - ...p, - status: i < 20 ? 'confirmed' : (i < 23 ? 'confirmed' : 'skipped') - })) + people.value = Array.isArray(result) ? result : [] } catch (e) { console.error('Failed to load people:', e) } finally { @@ -187,7 +242,7 @@ function onSearch() { if (!searchQuery.value.trim()) { isSearching.value = false; return } try { const results: any = await invoke('search_identities', { query: searchQuery.value, limit: 50 }) - searchResults.value = (Array.isArray(results) ? results : []).map((p: any) => ({ ...p, status: 'confirmed' })) + searchResults.value = Array.isArray(results) ? results : [] isSearching.value = true } catch (e) { console.error('Search failed:', e) } }, 300) @@ -346,10 +401,11 @@ h2 { margin: 0 0 16px; font-size: 1rem; } .ms-ctx-item.ms-ctx-danger { color: #d93025; } .ms-ctx-item.ms-ctx-danger:hover { background: #fce8e6; } .ms-ctx-menu-divider { height: 1px; background: #eee; margin: 4px 8px; } -.ms-ppl-section-toolbar { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; flex-wrap: nowrap; } -.ms-ppl-section-toggle-btn { display: inline-flex; align-items: center; gap: 6px; padding: 6px 14px; border-radius: 999px; border: 1.5px solid #d1d5db; background: #fff; font-family: 'DM Sans', 'Noto Sans TC', sans-serif; font-size: 13px; font-weight: 500; color: #9aa0a6; cursor: pointer; outline: none; transition: all .15s; white-space: nowrap; } -.ms-ppl-section-toggle-btn::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: #d1d5db; flex-shrink: 0; transition: background .15s; } -.ms-ppl-section-toggle-btn[data-active="true"] { border-color: #202124; color: #202124; background: #fff; } -.ms-ppl-section-toggle-btn[data-active="true"]::before { background: #202124; } -.ms-ppl-section-toggle-btn:hover { border-color: #5f6368; color: #5f6368; } +.ms-ppl-section { margin-bottom: 8px; } +.ms-ppl-section-toolbar { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; } +.ms-ppl-section-title { font-family: 'DM Sans', 'Noto Sans TC', sans-serif; font-size: 14px; font-weight: 600; color: #202124; margin: 0; display: flex; align-items: center; gap: 6px; } +.ms-ppl-hr { border: none; border-top: 1.5px solid #e8eaed; margin: 24px 0; } +.skipped-title { color: #9aa0a6; } +.skipped-card .ms-ppl-face-img-wrap { filter: grayscale(0.6); opacity: 0.7; } +.skipped-card .ms-ppl-face-name { color: #bdc1c6; }