improve ui

This commit is contained in:
pa
2026-03-16 10:41:18 +09:00
parent 12bb62702f
commit 1bac1e34d6
16 changed files with 46 additions and 50 deletions

View File

@@ -90,9 +90,7 @@
},
"group": {
"header": "Skupina"
},
"prev_page": "Předchozí",
"next_page": "Další"
}
},
"favorite": {
"worlds": {

View File

@@ -305,9 +305,7 @@
},
"group": {
"header": "Group"
},
"prev_page": "Prev",
"next_page": "Next"
}
},
"favorite": {
"worlds": {
@@ -1868,6 +1866,8 @@
"col_world": "World",
"col_players": "Players",
"col_resolution": "Resolution",
"col_match": "Match",
"col_author": "Author",
"back_to_results": "Back to {count} results",
"result_count": "{count} results"
},

View File

@@ -113,9 +113,7 @@
},
"group": {
"header": "Grupo"
},
"prev_page": "Anterior",
"next_page": "Siguiente"
}
},
"favorite": {
"worlds": {

View File

@@ -109,9 +109,7 @@
},
"group": {
"header": "Groupe"
},
"prev_page": "Précédent",
"next_page": "Suivant"
}
},
"favorite": {
"worlds": {

View File

@@ -90,9 +90,7 @@
},
"group": {
"header": "Csoport"
},
"prev_page": "Előző",
"next_page": "Következő"
}
},
"favorite": {
"worlds": {

View File

@@ -178,9 +178,7 @@
},
"group": {
"header": "グループ"
},
"prev_page": "前",
"next_page": "次"
}
},
"favorite": {
"worlds": {

View File

@@ -90,9 +90,7 @@
},
"group": {
"header": "그룹"
},
"prev_page": "이전",
"next_page": "다음"
}
},
"favorite": {
"worlds": {

View File

@@ -153,9 +153,7 @@
},
"group": {
"header": "Grupa"
},
"prev_page": "Wstecz",
"next_page": "Dalej"
}
},
"favorite": {
"worlds": {

View File

@@ -90,9 +90,7 @@
},
"group": {
"header": "Grupo"
},
"prev_page": "Anterior",
"next_page": "Próximo"
}
},
"favorite": {
"worlds": {

View File

@@ -114,9 +114,7 @@
},
"group": {
"header": "Группа"
},
"prev_page": "Назад",
"next_page": "Вперед"
}
},
"favorite": {
"worlds": {

View File

@@ -113,9 +113,7 @@
},
"group": {
"header": "กลุ่ม"
},
"prev_page": "ก่อนหน้า",
"next_page": "ถัดไป"
}
},
"favorite": {
"worlds": {

View File

@@ -90,9 +90,7 @@
},
"group": {
"header": "Nhóm"
},
"prev_page": "Trước",
"next_page": "Sau"
}
},
"favorite": {
"worlds": {

View File

@@ -178,9 +178,7 @@
},
"group": {
"header": "群组"
},
"prev_page": "上一页",
"next_page": "下一页"
}
},
"favorite": {
"worlds": {

View File

@@ -178,9 +178,7 @@
},
"group": {
"header": "群組"
},
"prev_page": "上一頁",
"next_page": "下一頁"
}
},
"favorite": {
"worlds": {

View File

@@ -3,12 +3,10 @@
<ButtonGroup class="shadow-lg rounded-lg">
<Button variant="outline" size="sm" :disabled="prevDisabled" @click="$emit('prev')">
<ArrowLeft />
{{ t('view.search.prev_page') }}
<Kbd class="ml-1">{{ isMac ? '⌥' : 'Alt' }}</Kbd>
<Kbd></Kbd>
</Button>
<Button variant="outline" size="sm" :disabled="nextDisabled" @click="$emit('next')">
{{ t('view.search.next_page') }}
<Kbd class="ml-1">{{ isMac ? '⌥' : 'Alt' }}</Kbd>
<Kbd></Kbd>
<ArrowRight />
@@ -22,9 +20,6 @@
import { Button } from '@/components/ui/button';
import { ButtonGroup } from '@/components/ui/button-group';
import { Kbd } from '@/components/ui/kbd';
import { useI18n } from 'vue-i18n';
const { t } = useI18n();
const isMac = navigator.platform.toUpperCase().indexOf('MAC') >= 0;

View File

@@ -64,6 +64,14 @@
{{ t('dialog.screenshot_metadata.col_world') }}
<span v-if="searchSort.key === 'world'" class="ml-1 text-[10px]">{{ searchSort.asc ? '' : '' }}</span>
</th>
<th v-if="searchHasMatchColumn" class="text-[11px] font-medium uppercase tracking-[0.08em] text-muted-foreground text-left px-3 py-2 border-b whitespace-nowrap select-none cursor-pointer hover:text-foreground" @click="toggleSearchSort('match')">
{{ t('dialog.screenshot_metadata.col_match') }}
<span v-if="searchSort.key === 'match'" class="ml-1 text-[10px]">{{ searchSort.asc ? '' : '' }}</span>
</th>
<th class="text-[11px] font-medium uppercase tracking-[0.08em] text-muted-foreground text-left px-3 py-2 border-b whitespace-nowrap select-none cursor-pointer hover:text-foreground" @click="toggleSearchSort('author')">
{{ t('dialog.screenshot_metadata.col_author') }}
<span v-if="searchSort.key === 'author'" class="ml-1 text-[10px]">{{ searchSort.asc ? '' : '' }}</span>
</th>
<th class="text-[11px] font-medium uppercase tracking-[0.08em] text-muted-foreground text-left px-3 py-2 border-b whitespace-nowrap select-none cursor-pointer hover:text-foreground w-20" @click="toggleSearchSort('players')">
{{ t('dialog.screenshot_metadata.col_players') }}
<span v-if="searchSort.key === 'players'" class="ml-1 text-[10px]">{{ searchSort.asc ? '' : '' }}</span>
@@ -81,6 +89,8 @@
@click="selectSearchResult(idx)">
<td class="text-sm px-3 py-2 border-b whitespace-nowrap overflow-hidden text-ellipsis" :class="row.filePath === selectedSearchFilePath ? 'pl-[9px]' : ''">{{ row.dateFormatted }}</td>
<td class="text-sm px-3 py-2 border-b whitespace-nowrap overflow-hidden text-ellipsis">{{ row.world || '—' }}</td>
<td v-if="searchHasMatchColumn" class="text-sm px-3 py-2 border-b whitespace-nowrap overflow-hidden text-ellipsis text-primary">{{ row.match || '' }}</td>
<td class="text-sm px-3 py-2 border-b whitespace-nowrap overflow-hidden text-ellipsis text-muted-foreground">{{ row.author || '—' }}</td>
<td class="text-sm px-3 py-2 border-b whitespace-nowrap overflow-hidden text-ellipsis">
<span class="inline-flex items-center gap-1">
<Users class="size-3 text-muted-foreground" />
@@ -300,6 +310,11 @@
const selectedSearchFilePath = ref(null);
const searchSort = reactive({ key: 'dateTime', asc: false });
const searchHasMatchColumn = computed(() => {
const type = screenshotMetadataDialog.searchType;
return type === 'Player Name' || type === 'Player ID';
});
const sortedSearchResults = computed(() => {
const data = [...searchResultsData.value];
const { key, asc } = searchSort;
@@ -333,8 +348,9 @@
getAndDisplayScreenshot(row.filePath, false);
}
async function loadSearchResultsMetadata(filePaths) {
async function loadSearchResultsMetadata(filePaths, query, searchType) {
const results = [];
const lowerQuery = String(query).toLowerCase();
const promises = filePaths.map(async (filePath) => {
try {
const metaJson = await AppApi.GetScreenshotMetadata(filePath);
@@ -353,6 +369,15 @@
dateFormatted = formatDateFilter(dateTime, 'short');
}
let match = '';
if (searchType === 0) {
const matched = meta.players?.filter((p) => p.displayName?.toLowerCase().includes(lowerQuery)) || [];
match = matched.map((p) => p.displayName).join(', ');
} else if (searchType === 1) {
const matched = meta.players?.find((p) => p.id === query);
match = matched?.displayName || '';
}
results.push({
filePath,
dateTime,
@@ -360,7 +385,9 @@
world: meta.world?.name || '',
playerCount: meta.players?.length || 0,
players: meta.players?.length || 0,
resolution: extra.fileResolution || ''
resolution: extra.fileResolution || '',
match,
author: meta.author?.displayName || ''
});
} catch (e) {
console.error('Error loading metadata for', filePath, e);
@@ -622,7 +649,7 @@
D.searchIndex = 0;
D.searchResults = results;
const enriched = await loadSearchResultsMetadata(results);
const enriched = await loadSearchResultsMetadata(results, D.search, searchType);
searchResultsData.value = enriched;
searchViewMode.value = 'table';
})