fix(viewer): remove lightbox top-bar settings menu (user request) — close button + counter only; Esc closes directly

Co-Authored-By: Claude Code <noreply@anthropic.com>
This commit is contained in:
浅念
2026-09-23 13:39:53 +08:00
parent 903962a46b
commit bdad433dae
2 changed files with 5 additions and 17 deletions
+5 -16
View File
@@ -382,28 +382,17 @@ describe('photo lightbox dark viewer (UI-02 V04)', () => {
expect(lightbox(wrapper).emitted('update:photoId')).toEqual([['p1']]);
});
it('more menu exposes the reduce-motion toggle; Escape closes the menu before the viewer', async () => {
it('top bar has no settings/more menu (removed per user request 2026-09-23); Escape closes the viewer directly', async () => {
const wrapper = mountLightbox('p2');
await flushPromises();
await wrapper.find('.viewer-more').trigger('click');
expect(wrapper.find('.more-popover').exists()).toBe(true);
const item = wrapper.find('.more-item');
expect(item.text()).toContain('减少动画');
expect(item.attributes('aria-checked')).toBe('false');
await item.trigger('click');
expect(wrapper.find('.more-item').attributes('aria-checked')).toBe('true');
// 还原模块级偏好单例,避免影响后续用例。
await wrapper.find('.more-item').trigger('click');
// 「⋯」更多菜单(减少动画开关)已按用户要求移除:顶部仅保留关闭与序号。
expect(wrapper.find('.viewer-more').exists()).toBe(false);
expect(wrapper.find('.more-menu').exists()).toBe(false);
keydown('Escape');
await flushPromises();
expect(wrapper.find('.more-popover').exists()).toBe(false); // 先收菜单
expect(lightbox(wrapper).emitted('close')).toBeUndefined(); // 不关查看器
keydown('Escape');
await flushPromises();
expect(lightbox(wrapper).emitted('close')).toHaveLength(1);
expect(lightbox(wrapper).emitted('close')).toHaveLength(1); // Esc 直接关查看器
});
it('moves focus into the dialog on open and returns it to the trigger on close', async () => {
@@ -11,7 +11,6 @@ import HeartParticles from './viewer/HeartParticles.vue';
import InteractionNotice from './viewer/InteractionNotice.vue';
import ThumbnailStrip, { type ThumbnailItem } from './viewer/ThumbnailStrip.vue';
import ShareSheet from './viewer/ShareSheet.vue';
import { reducedMotion, toggleReducedMotion } from '../ui/prefs';
import { positionDisplay } from '../viewer/position';
import { MIN_SCALE, panBy, resetZoom, wheelFactor, zoomAt, type ZoomState } from '../viewer/zoom';