206206 </button>
207207 <div class="cleanup-wrap">
208208 <button class="scan-sys-toolbar-btn cleanup-trigger" @click="showCleanupMenu = !showCleanupMenu" :title="t('library.cleanupTitle')">
209- <span class="btn-icon" v-html="deleteSvg" />
210- <span class="btn-text">{{ t('library.cleanup') }}</span>
211- <svg width="9" height="9" viewBox="0 0 10 10" fill="none" aria-hidden="true"><path d="M2 3.5 5 6.5 8 3.5" stroke="currentColor" stroke-width="1.4" stroke-linecap="round" stroke-linejoin="round"/></svg>
209+ <span class="btn-icon" v-html="cleanupSvg" />
212210 </button>
213211 <div v-if="showCleanupMenu" class="cleanup-menu">
214212 <button class="cleanup-menu-item cleanup-menu-item--danger" :disabled="cleanupBusy" @click="runCleanup('all')">
@@ -1822,6 +1820,7 @@ import DropImportModal from '../components/DropImportModal.vue'
18221820import type { DropItem } from '../components/DropImportModal.vue'
18231821import ResourceDetailPanel from '../components/ResourceDetailPanel.vue'
18241822import { match as pinyinMatch } from 'pinyin-pro'
1823+ import { showConfirm } from '../utils/confirm-dialog'
18251824
18261825const { t, locale } = useI18n()
18271826const store = useResourceStore()
@@ -4187,6 +4186,7 @@ const typeSvg = `<svg viewBox="0 0 24 24" fill="none" stroke="currentCol
41874186const pathSvg = `<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8"><path d="M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"/><path d="M7 10l5 5 5-5"/><path d="M12 15V3"/></svg>`
41884187const ignoreSvg = `<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8"><circle cx="12" cy="12" r="10"/><line x1="4.93" y1="4.93" x2="19.07" y2="19.07"/></svg>`
41894188const deleteSvg = `<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8"><polyline points="3 6 5 6 21 6"/><path d="M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6m3 0V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2"/></svg>`
4189+ const cleanupSvg = `<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round"><path d="m9 11 6-6"/><path d="m5 21 3-3"/><path d="m14 4 3 3"/><path d="m3 7 7 7"/><path d="M5 21h8a3 3 0 0 0 3-3v-5"/></svg>`
41904190const arrowSvg = `<svg viewBox="0 0 24 24" width="20" height="20" fill="none" stroke="currentColor" stroke-width="2"><path d="M5 12h14"/><path d="M13 6l6 6-6 6"/></svg>`
41914191const aiSvg = `<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8"><path d="M12 2l2.4 7.2H22l-6 4.8 2.4 7.2L12 16.4l-6.4 4.8 2.4-7.2-6-4.8h7.6z"/></svg>`
41924192const scanSysSvg = `<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8"><circle cx="11" cy="11" r="8"/><line x1="21" y1="21" x2="16.65" y2="16.65"/></svg>`
@@ -4209,7 +4209,14 @@ async function runCleanup(mode: CleanupMode) {
42094209 missing: 'library.cleanupConfirmMissing',
42104210 ignoredMissing: 'library.cleanupConfirmIgnoredMissing',
42114211 }
4212- if (!window.confirm(t(confirmKey[mode]))) return
4212+ showCleanupMenu.value = false
4213+ if (!await showConfirm({
4214+ title: t('library.confirmTitle'),
4215+ message: t(confirmKey[mode]),
4216+ confirmText: t('library.confirmBtn'),
4217+ cancelText: t('library.cancelBtn'),
4218+ danger: true,
4219+ })) return
42134220
42144221 cleanupBusy.value = true
42154222 cleanupNotice.value = ''
@@ -4780,8 +4787,14 @@ async function openLocalNote(resource: Resource, touchUsage = true) {
47804787 noteSurfaceRef.value?.focus()
47814788}
47824789
4783- function closeNoteEditor() {
4784- if (noteEditor.dirty && !confirm(t('library.documents.discardConfirm'))) return
4790+ async function closeNoteEditor() {
4791+ if (noteEditor.dirty && !await showConfirm({
4792+ title: t('library.confirmTitle'),
4793+ message: t('library.documents.discardConfirm'),
4794+ confirmText: t('library.confirmBtn'),
4795+ cancelText: t('library.cancelBtn'),
4796+ danger: true,
4797+ })) return
47854798 noteEditor.show = false
47864799 noteEditor.resource = null
47874800 noteEditor.blocks = []
@@ -5425,7 +5438,7 @@ async function deleteIgnored(filePath: string) {
54255438.scan-sys-toolbar-btn .btn-icon { width: 16px; height: 16px; }
54265439
54275440.cleanup-wrap { position: relative; }
5428- .cleanup-trigger { gap: 4px ; }
5441+ .cleanup-trigger { width: 30px; justify-content: center; padding: 5px ; }
54295442.cleanup-menu {
54305443 position: absolute;
54315444 z-index: 120;
0 commit comments