diff --git a/frontend/src/App.vue b/frontend/src/App.vue index 2525730..06aab8d 100644 --- a/frontend/src/App.vue +++ b/frontend/src/App.vue @@ -1,5 +1,5 @@ @@ -1022,7 +1100,7 @@ onMounted(bootstrap) - {{list.name}} - - 已归档清单 - {{list.name}}恢复永久删除 - + + 已归档 {{ archivedLists.length }} + + {{list.name}} + + 回收站 @@ -1154,6 +1234,9 @@ onMounted(bootstrap) {{notice}} {{error}} + + 恢复清单永久删除清单 + 永久删除清单「{{ purgeListTarget.name }}」? diff --git a/frontend/src/lib/archived-list-menu.test.ts b/frontend/src/lib/archived-list-menu.test.ts new file mode 100644 index 0000000..e52c457 --- /dev/null +++ b/frontend/src/lib/archived-list-menu.test.ts @@ -0,0 +1,47 @@ +import { describe, expect, it } from 'vitest' +import { positionArchivedMenu, resolveArchivedMenuFocusTarget } from './archived-list-menu' + +describe('resolveArchivedMenuFocusTarget', () => { + it('returns the archived row trigger while it remains connected', () => { + const trigger = { isConnected: true } as HTMLElement + const fallback = { isConnected: true } as HTMLButtonElement + + expect(resolveArchivedMenuFocusTarget(trigger, fallback)).toBe(trigger) + }) + + it('falls back to the archived-list disclosure after the row is removed', () => { + const trigger = { isConnected: false } as HTMLElement + const fallback = { isConnected: true } as HTMLButtonElement + + expect(resolveArchivedMenuFocusTarget(trigger, fallback)).toBe(fallback) + }) + + it('returns null when neither focus target is available', () => { + expect(resolveArchivedMenuFocusTarget(null, null)).toBeNull() + }) +}) + +describe('positionArchivedMenu', () => { + it('places the desktop menu below the trigger when it fits', () => { + expect(positionArchivedMenu({ left: 180, right: 224, top: 100, bottom: 144 }, 164, 102, 1280, 800)).toEqual({ left: 60, top: 150 }) + }) + + it('flips above when the menu does not fit below', () => { + expect(positionArchivedMenu({ left: 4, right: 48, top: 730, bottom: 774 }, 164, 102, 320, 800)).toEqual({ left: 8, top: 622 }) + }) + + it('clamps below-placement when the trigger is above the viewport', () => { + expect(positionArchivedMenu({ left: 180, right: 224, top: -200, bottom: -156 }, 164, 102, 1280, 800)).toEqual({ left: 60, top: 8 }) + }) + + it('clamps above-placement when the trigger is below the viewport', () => { + expect(positionArchivedMenu({ left: 180, right: 224, top: 850, bottom: 894 }, 164, 102, 1280, 800)).toEqual({ left: 60, top: 690 }) + }) + + it.each([ + { menuHeight: 104, label: 'nearly fills' }, + { menuHeight: 130, label: 'exceeds' }, + ])('uses the top margin when the menu $label the available height', ({ menuHeight }) => { + expect(positionArchivedMenu({ left: 180, right: 224, top: 50, bottom: 94 }, 164, menuHeight, 1280, 120)).toEqual({ left: 60, top: 8 }) + }) +}) diff --git a/frontend/src/lib/archived-list-menu.ts b/frontend/src/lib/archived-list-menu.ts new file mode 100644 index 0000000..e00a941 --- /dev/null +++ b/frontend/src/lib/archived-list-menu.ts @@ -0,0 +1,27 @@ +export type ArchivedMenuRect = Pick + +export function positionArchivedMenu( + trigger: ArchivedMenuRect, + menuWidth: number, + menuHeight: number, + viewportWidth: number, + viewportHeight: number, + gap = 6, + margin = 8, +): { left: number; top: number } { + const left = Math.min(Math.max(margin, trigger.right - menuWidth), viewportWidth - menuWidth - margin) + const below = trigger.bottom + gap + const preferredTop = below + menuHeight <= viewportHeight - margin + ? below + : trigger.top - menuHeight - gap + const maxTop = Math.max(margin, viewportHeight - menuHeight - margin) + const top = Math.min(Math.max(margin, preferredTop), maxTop) + return { left, top } +} + +export function resolveArchivedMenuFocusTarget( + trigger: HTMLElement | null, + fallback: HTMLButtonElement | null, +): HTMLElement | null { + return trigger?.isConnected ? trigger : fallback +} diff --git a/frontend/src/style.css b/frontend/src/style.css index 2c1ceba..3110fad 100644 --- a/frontend/src/style.css +++ b/frontend/src/style.css @@ -7,6 +7,7 @@ main{min-width:0;padding:27px 34px 50px;overflow:auto;background:linear-gradient(rgba(255,253,248,.92),rgba(255,253,248,.92)),repeating-linear-gradient(0deg,transparent,transparent 31px,#eee3d2 32px)}.topbar{display:flex;align-items:center;gap:14px}.topbar>div{flex:1}.topbar p{margin:0;color:var(--muted);font-size:12px}.topbar h1{font-size:27px;margin:3px 0 21px;letter-spacing:-.03em}.topbar.today-topbar h1{margin-bottom:4px}.today-board{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:1px;margin:18px 0 8px;padding:6px;background:#fff;border:1px solid rgba(231,221,204,.86);border-radius:14px;box-shadow:0 3px 14px rgba(81,61,38,.04)}.today-track{min-width:0;border:0;background:transparent;border-radius:9px;padding:9px 11px;display:grid;gap:8px;text-align:left;transition:background .15s ease}.today-track+.today-track{border-left:1px solid var(--line);border-radius:0 9px 9px 0}.today-track:hover{background:#fff9f2}.today-track:focus-visible{outline:2px solid rgba(241,90,41,.3);outline-offset:1px}.today-track-head{display:flex;align-items:baseline;justify-content:space-between;gap:10px}.today-track-head strong{font-size:14px;line-height:1.2;color:#403a32}.today-track-rail{display:block;height:5px;overflow:hidden;border-radius:999px;background:#eee7dc}.today-track-fill{display:block;width:0;height:100%;border-radius:inherit;background:#71856b;transition:width .35s ease}.today-habit-track .today-track-fill{background:var(--accent)}.today-section-anchor{scroll-margin-top:16px}.search{margin-bottom:18px;display:flex;align-items:center;gap:8px;width:min(260px,36%);padding:8px 10px;background:#faf7f0;border:1px solid var(--line);border-radius:9px;color:var(--muted)}.search input{min-width:0;width:100%;border:0;outline:0;background:transparent}.search kbd{font-size:10px;white-space:nowrap;border:1px solid var(--line);padding:2px 4px;border-radius:4px}.list-toolbar{height:42px;display:flex;align-items:center;gap:14px;color:var(--muted);font-size:12px}.list-toolbar label{margin-right:auto}.link{border:0;background:transparent;color:var(--accent);padding:3px;display:inline-flex;gap:3px;align-items:center}.link svg{width:14px}.task-list{transition:opacity .2s}.task-list.loading{opacity:.45}.task-row{border-left:0;--swipe-x:0px;min-height:53px;display:flex;align-items:center;gap:10px;border-bottom:1px solid var(--line);padding:4px 8px;transition:background .15s,transform .18s ease;position:relative;overflow:hidden;isolation:isolate}.task-row.swipeable{touch-action:pan-y;transform:translate(var(--swipe-x),var(--reorder-y,0px))}.task-row.swipeable:not([style*="0px"]){transition:none}.task-row:hover,.task-row.selected{background:rgba(250,240,229,.75)}.task-row:hover:not(.reordering){transform:translate(calc(var(--swipe-x) + 2px),var(--reorder-y,0px))}.check{width:19px;height:19px;flex:0 0 19px;border:1.6px solid #c6baa8;background:#fff;border-radius:5px;padding:0;display:grid;place-items:center}.check svg{width:13px}.task-check{width:44px;height:44px;flex:0 0 44px;border:0;background:transparent;padding:0;display:grid;place-items:center;border-radius:9px}.task-check-mark{width:19px;height:19px;border:1.6px solid #c6baa8;background:#fff;border-radius:50%;display:grid;place-items:center;transition:background .15s ease,border-color .15s ease,color .15s ease,transform .15s ease}.task-check-mark svg{width:13px}.task-check:hover .task-check-mark{transform:scale(1.06);border-color:#9d8f7b}.task-check:focus-visible{outline:2px solid rgba(241,90,41,.32);outline-offset:1px}.task-check[aria-pressed="true"] .task-check-mark{background:#71856b;border-color:#71856b;color:#fff}.task-check-mark.p1{border-color:#4b93d1}.task-check-mark.p2{border-color:#d79b25}.task-check-mark.p3{border-color:#dc4b30}.check.p1{border-color:#4b93d1}.check.p2{border-color:#d79b25}.check.p3{border-color:#dc4b30}.done .check{background:#afa595;color:white}.task-main{border:0;background:transparent;flex:1;min-width:0;text-align:left;padding:8px 0}.task-main strong{display:block;font-size:14px;font-weight:590;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.done .task-main strong{text-decoration:line-through;color:#9b9388}.meta{display:flex;align-items:center;gap:9px;color:#9b9286;font-size:11px;margin-top:3px}.meta span{display:flex;align-items:center;gap:3px}.meta svg{width:12px}.priority{font-size:10px;font-weight:750;padding:3px 6px;border-radius:5px}.priority.p1{color:#3f80ba;background:#e5f2fc}.priority.p2{color:#a56b05;background:#fff1cb}.priority.p3{color:#bd3827;background:#fde2dc}.icon,.ghost{min-width:44px;min-height:44px;border:0;background:transparent;display:grid;place-items:center;padding:5px;border-radius:6px}.mobile-only{display:none}.ghost{opacity:0;color:#9d9387}.task-row:hover .ghost{opacity:1}.ghost:hover{color:var(--danger);background:#fce7e2}.restore{display:flex;align-items:center;gap:5px;border:1px solid var(--line);background:#fff;border-radius:7px;padding:6px 8px;font-size:12px}.restore svg{width:14px}.subtask{padding-left:53px;min-height:42px;color:#6d655b}.subtask>svg{width:13px;color:#bbb0a2}.empty{min-height:300px;display:grid;place-items:center;align-content:center;gap:8px;color:#aaa094;text-align:center}.empty>svg{width:38px;height:38px;color:#d8cabb}.empty b{color:#6f675c}.empty span{font-size:13px} .drag-handle{width:34px;height:44px;flex:0 0 34px;display:grid;place-items:center;border:0;background:transparent;color:#b3a795;cursor:grab;touch-action:none;border-radius:8px}.drag-handle:active{cursor:grabbing}.drag-handle:disabled{opacity:.3;cursor:not-allowed}.drag-handle svg{width:17px;height:17px}.reordering{opacity:.78;z-index:4;box-shadow:0 12px 28px rgba(78,58,34,.18)!important;transition:none!important;pointer-events:none}.reorder-target{box-shadow:inset 0 2px 0 var(--accent)} .list-drag-handle{width:44px;min-width:44px;height:44px;display:grid;place-items:center;border:0;background:transparent;color:#ad9f8c;cursor:grab;touch-action:none;border-radius:8px}.list-drag-handle svg{width:15px;height:15px}.list-row{touch-action:pan-y}.list-row.list-dragging{position:relative;z-index:8;opacity:.8;box-shadow:0 10px 24px rgba(78,58,34,.2);transform:translateY(var(--list-drag-y));transition:none;pointer-events:none;background:#fffaf4}.folder-row.list-drop-target{background:var(--accent-soft);box-shadow:inset 3px 0 0 var(--accent)}.list-root-drop.list-drop-target{background:var(--accent-soft);color:#b7421e;border-radius:9px}.list-row.list-reorder-target{box-shadow:inset 0 2px 0 var(--accent)}.list-move-menu{display:grid;gap:4px;padding:6px 0 6px 28px}.list-move-menu button{min-height:42px}.list-move-menu button:disabled,.sidebar-action-sheet .app-sheet__body button:disabled{opacity:.45;cursor:default} +.archived-lists{position:relative;margin-top:4px}.archived-lists-toggle{min-height:44px;width:100%;display:flex;align-items:center;gap:8px;border:0;border-radius:9px;background:transparent;padding:0 12px;color:#81786c;text-align:left;font-size:12px;font-weight:650}.archived-lists-toggle:hover:not(:disabled){background:rgba(255,255,255,.52)}.archived-lists-toggle:focus-visible,.archived-row-menu-trigger:focus-visible,.archived-row-actions button:focus-visible{outline:2px solid var(--accent);outline-offset:2px}.archived-lists-toggle:disabled{cursor:default;color:#aaa196}.archived-lists-toggle svg{width:15px;height:15px;transition:transform .16s ease}.archived-lists-toggle svg.expanded{transform:rotate(90deg)}.archived-list-items{display:grid;transition:opacity .16s ease}.archived-row{min-height:44px;display:grid;grid-template-columns:minmax(0,1fr) 44px;align-items:center;padding-left:35px;color:#746c61}.archived-row-label{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:12px}.archived-row-menu{display:grid;place-items:center}.archived-row-menu-trigger{width:44px;height:44px;display:grid;place-items:center;border:0;border-radius:9px;background:transparent;color:#8e8477}.archived-row-menu-trigger svg{width:15px;height:15px}.archived-action-mask{display:contents}.archived-row-actions{position:fixed;z-index:70;width:164px;display:grid;gap:2px;padding:6px;background:#fffdf8;border:1px solid var(--line);border-radius:12px;box-shadow:var(--shadow)}.archived-row-actions button{min-height:44px;display:flex;align-items:center;gap:9px;border:0;border-radius:8px;background:transparent;padding:8px 10px;text-align:left;font-size:12px}.archived-row-actions button:hover{background:#f8f1e8}.archived-row-actions svg{width:15px;height:15px}@media(max-width:930px){.archived-action-mask{display:block;position:fixed;z-index:60;inset:0;background:rgba(45,38,31,.3)}.archived-row-actions{position:fixed;z-index:61;left:0;right:0;top:auto;bottom:0;width:100%;padding:12px 16px calc(16px + env(safe-area-inset-bottom));border-radius:22px 22px 0 0}.archived-row-actions button{font-size:14px}}@media(prefers-reduced-motion:reduce){.archived-lists-toggle svg,.archived-list-items{transition:none}} .detail{min-width:0;border-left:1px solid var(--line);background:#faf7f0;overflow:auto}.detail-head{height:57px;display:flex;align-items:center;justify-content:space-between;padding:0 21px;border-bottom:1px solid var(--line);font-size:12px;font-weight:700;color:#80766a;text-transform:uppercase;letter-spacing:.08em}.paper{margin:22px;padding:28px 20px;min-height:180px;background:#fff;border:1px solid var(--line);border-radius:11px;box-shadow:0 4px 18px rgba(76,57,34,.05);display:grid;place-items:center;align-content:center;text-align:center;color:#8f8578}.paper svg{width:32px;height:32px;color:#ceb8a4;margin-bottom:12px}.paper b{color:#625b50}.paper p{font-size:13px;line-height:1.6}.detail-form{min-width:0;grid-template-columns:minmax(0,1fr);padding:19px;display:grid;gap:15px}.detail-form>*{min-width:0}.detail-title{display:flex;align-items:flex-start;gap:10px}.check.large{margin-top:8px;width:22px;height:22px;flex-basis:22px}.detail-title textarea{flex:1;border:0;background:transparent;resize:none;outline:none;font-size:19px;line-height:1.4;font-weight:700}.detail-form>label{grid-template-columns:80px 1fr;align-items:center}.detail-form>label input,.detail-form>label select{padding:8px}.task-detail-field-input{width:190px!important;max-width:100%;justify-self:end}.task-detail-due-input{padding-inline:9px!important}.field{display:grid;gap:7px}.field-label{display:flex;justify-content:space-between;align-items:center;font-size:12px;font-weight:700;color:#756d61}.hint{font-size:12px;color:#a49a8d}.markdown .field-label>span:last-child{display:flex;background:#eee7dc;padding:2px;border-radius:6px}.markdown .field-label button{border:0;background:transparent;padding:4px 8px;border-radius:5px;font-size:11px}.markdown .field-label button.active{background:#fff;color:var(--accent)}.markdown textarea{border:1px solid var(--line);background:#fff;border-radius:9px;padding:11px;resize:vertical;outline:none;font:13px/1.6 ui-monospace,SFMono-Regular,Menlo,monospace}.markdown-preview{min-height:160px;padding:10px 12px;background:#fff;border:1px solid var(--line);border-radius:9px;font-size:13px;line-height:1.65;overflow-wrap:anywhere}.markdown-preview h1{font-size:20px}.markdown-preview h2{font-size:16px}.markdown-preview p{margin:8px 0}.markdown-preview code{background:#f2ece2;padding:2px 4px;border-radius:4px}.markdown-preview a{color:var(--accent)}.subtasks{display:grid;gap:5px}.subtask-detail{width:100%;min-width:0;max-width:100%;overflow-wrap:anywhere;word-break:break-word;white-space:normal;display:flex;align-items:center;gap:8px;border:0;background:#fff;padding:8px;border-radius:7px;text-align:left}.subtask-detail .check{pointer-events:none}.strike{text-decoration:line-through;color:var(--muted)}.detail-actions{display:flex;justify-content:space-between;align-items:center;padding-top:10px;border-top:1px solid var(--line)}.secondary{border:1px solid var(--line);background:#fff;padding:8px 11px;border-radius:8px;font-weight:650}.danger-text{border:0;background:transparent;color:var(--danger);display:flex;align-items:center;gap:5px;font-size:12px}.danger-text svg{width:14px} .field-hint{color:var(--muted);font-size:11px;font-weight:400}.repeat-custom-fields{display:grid;gap:10px;padding:12px;border:1px solid var(--line);border-radius:11px;background:#fffaf4}.repeat-custom-fields>div,.repeat-custom-fields>label{display:flex;align-items:center;gap:8px;color:#675f54;font-size:12px}.repeat-custom-fields input[type="number"]{width:72px}.repeat-custom-fields input,.repeat-custom-fields select{min-height:40px;border:1px solid var(--line);border-radius:8px;background:#fff;padding:7px 9px}.weekday-picker{display:flex;gap:4px;flex-wrap:wrap}.weekday-picker label{width:34px;height:34px;display:grid;place-items:center;border:1px solid var(--line);border-radius:50%;background:#fff}.weekday-picker input{position:absolute;opacity:0;pointer-events:none}.weekday-picker label:has(input:checked){background:var(--accent);border-color:var(--accent);color:#fff}.toast,.error-toast{position:fixed;z-index:50;left:50%;bottom:24px;transform:translateX(-50%);background:#322d28;color:#fff;border-radius:9px;padding:10px 15px;box-shadow:var(--shadow);font-size:13px}.error-toast{background:var(--danger);display:flex;align-items:center;gap:10px}.error-toast button{border:0;background:transparent;color:#fff;padding:0}.toast-enter-active,.toast-leave-active{transition:.2s}.toast-enter-from,.toast-leave-to{opacity:0;transform:translate(-50%,8px)} @media(max-width:1050px) and (min-width:931px){.shell.detail-open{grid-template-columns:220px minmax(400px,1fr) minmax(280px,30vw)}.shell.sidebar-collapsed.detail-open{grid-template-columns:0 minmax(400px,1fr) minmax(280px,30vw)}main{padding-inline:24px}} diff --git a/frontend/src/style.test.ts b/frontend/src/style.test.ts index 2c42fc9..a344c98 100644 --- a/frontend/src/style.test.ts +++ b/frontend/src/style.test.ts @@ -80,6 +80,71 @@ describe('completion feedback motion', () => { }) }) +describe('archived task-list disclosure', () => { + it('keeps one collapsed disclosure row even when the archive is empty', () => { + expect(app).toContain('const archivedListsExpanded = ref(false)') + expect(app).toContain('class="archived-lists-toggle"') + expect(app).toContain('已归档 {{ archivedLists.length }}') + expect(app).toContain(':aria-expanded="archivedLists.length > 0 && archivedListsExpanded"') + expect(app).toContain('aria-controls="archived-task-lists"') + expect(app).toContain(':disabled="archivedLists.length === 0"') + expect(app).toContain('id="archived-task-lists"') + }) + + it('renders compact archived rows with a restore and purge menu', () => { + expect(app).toContain('v-show="archivedListsExpanded"') + expect(app).toContain('class="list-row archived-row"') + expect(app).toContain('class="archived-row-menu-trigger"') + expect(app).toContain('恢复清单') + expect(app).toContain('永久删除清单') + expect(css).toContain('.archived-lists-toggle{min-height:44px;') + expect(css).toContain('.archived-row{min-height:44px;display:grid;grid-template-columns:minmax(0,1fr) 44px;align-items:center;') + expect(css).toContain('.archived-row-actions{position:fixed;z-index:70;') + expect(css).toContain('@media(max-width:930px){.archived-action-mask{display:block;position:fixed;') + expect(css).toContain('.archived-row-actions{position:fixed;z-index:61;left:0;right:0;top:auto;bottom:0;') + }) + + it('preserves the expanded state while restoring or deleting the last list', () => { + const restoreBlock = app.slice(app.indexOf('async function restoreList'), app.indexOf('function openPurgeList')) + const purgeBlock = app.slice(app.indexOf('async function confirmPurgeList'), app.indexOf('function toggleSidebarCreate')) + expect(restoreBlock).not.toContain('archivedListsExpanded.value = false') + expect(purgeBlock).not.toContain('archivedListsExpanded.value = false') + }) + + it('keeps archived and ordinary sidebar action menus mutually exclusive', () => { + const archivedActionBlock = app.slice(app.indexOf('function toggleArchivedListAction'), app.indexOf('function openPurgeList')) + const sidebarActionBlock = app.slice(app.indexOf('function openSidebarAction'), app.indexOf('function runSidebarCreate')) + expect(archivedActionBlock).toContain('closeSidebarAction()') + expect(sidebarActionBlock).toContain('closeArchivedListAction(false)') + }) + + it('closes the desktop archived menu from outside pointer input without replacing the mobile mask', () => { + expect(app).toContain("document.addEventListener('pointerdown', handleArchivedListOutsidePointer)") + expect(app).toContain("window.matchMedia('(min-width: 931px)').matches") + expect(app).toContain("target.closest('.archived-row-menu,.archived-row-actions')) closeArchivedListAction(false)") + expect(app).toContain('') + expect(app).toContain('class="archived-action-mask" @click.self="closeArchivedListAction()"') + expect(app).toContain("document.addEventListener('scroll', handleArchivedListViewportChange, true)") + expect(app).toContain("window.addEventListener('resize', handleArchivedListViewportChange)") + expect(css).toContain('@media(max-width:930px){.archived-action-mask{display:block;position:fixed;') + }) + + it('restores archive menu focus after Escape and actions, with a fallback after row removal', () => { + expect(app).toContain('const archivedListsToggle = ref(null)') + expect(app).toContain('let archivedListActionTrigger: HTMLElement | null = null') + expect(app).toContain("document.addEventListener('keydown', handleArchivedListEscape)") + expect(app).toContain('resolveArchivedMenuFocusTarget(archivedListActionTrigger, archivedListsToggle.value)') + expect(app).toContain('ref="archivedListsToggle"') + expect(app).toContain("@click=\"toggleArchivedListAction(list,$event.currentTarget)\"") + expect(app).toContain('purgeListTrigger = archivedListActionTrigger') + expect(app).toContain('focusArchivedListTrigger()') + }) + + it('disables archive disclosure motion for reduced-motion users', () => { + expect(css).toContain('@media(prefers-reduced-motion:reduce){.archived-lists-toggle svg,.archived-list-items{transition:none}}') + }) +}) + describe('mobile sheet contract', () => { it('uses shared roles for details, creation and secondary actions', () => { expect(app).toContain('class="task-compose-mask app-sheet-mask"') @@ -629,7 +694,7 @@ describe('sidebar information hierarchy', () => { expect(app).toContain('aria-label="打开清单操作"') expect(app).toContain('class="sidebar-action-mask app-sheet-mask"') expect(app).toContain('class="sidebar-action-sheet app-sheet app-sheet--actions"') - expect(app).toContain('@keydown.esc="sidebarCreateOpen=false;closeSidebarAction()"') + expect(app).toContain('@keydown.esc="sidebarCreateOpen=false;closeArchivedListAction();closeSidebarAction()"') expect(app).toContain('sidebarCreateOpen.value = false; sidebarAction.value = null') expect(app).not.toContain('aria-label="重命名文件夹" @click="renameEntity') expect(app).not.toContain('aria-label="重命名清单" @click="renameEntity') @@ -724,22 +789,22 @@ describe('sidebar layout', () => { expect(css).not.toContain('.list-row.list-dragging{touch-action:none}') }) - it('only restores archived lists from the explicit restore action', () => { - expect(app).toContain('class="list-row-main archived-row-label"') + it('only restores archived lists from the explicit restore menu action', () => { + expect(app).toContain('class="archived-row-label"') expect(app).not.toContain(':aria-label="`恢复清单:${list.name}`" @click="restoreList(list)"') - expect(app).toContain('aria-label="恢复清单" @click="restoreList(list)"') + expect(app).toContain('@click="restoreList(archivedListAction)">恢复清单') }) it('loads archived lists during bootstrap so archived rows are visible after refresh', () => { expect(app).toContain('expandedFolders.value = new Set(folders.value.map((folder) => folder.id))\n await loadArchivedLists()\n void preloadCountdowns()\n await loadRestoredView()') }) - it('styles archived rows through the new list-row-main structure', () => { - expect(css).toContain('.archived-row .list-row-main>svg{color:#c9a45c}') + it('styles archived rows through the compact disclosure structure', () => { + expect(css).toContain('.archived-row-label{min-width:0;overflow:hidden;text-overflow:ellipsis;') }) - it('offers permanent deletion only beside archived lists', () => { - expect(app).toContain('aria-label="永久删除清单" @click="openPurgeList(list,$event.currentTarget)"') + it('offers permanent deletion only inside archived list menus', () => { + expect(app).toContain('@click="openPurgeList(archivedListAction)">永久删除清单') expect(app).toContain("api(`/lists/${purgeListTarget.value.id}/purge`, { method: 'DELETE' })") expect(app).not.toMatch(/list\.is_inbox[^\n]*openPurgeList/) })