Files
2026-08-16 22:20:00 +08:00

17 lines
1.2 KiB
Markdown
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# 侧栏折叠入口初步调查
## 证据
- `public/index.html` 已存在 `#menu-btn`,包含 `aria-controls="sidebar"` 和初始 `aria-expanded="true"`。
- `public/app.js` 已缓存 `menuBtn`,并区分窄屏 drawer 与桌面 fixed collapse 两条点击路径。
- 桌面折叠能力当前使用 `(width > 768px) and (hover: hover) and (pointer: fine)`。
- `scripts/regression.js` 已有 `assertFrontendSidebarCollapseContract()`,覆盖 DOM、持久化、无障碍状态、窄屏 drawer 与桌面 hover rail。
- 用户截图底部有触控设备 Home Indicator,且视口为横屏宽屏;这与 `width > 768px`、`pointer: coarse`、无 hover 的组合一致。
## 根因假设
宽触控设备既不满足 `max-width: 768px` 的 drawer 条件,也不满足要求 `hover: hover`、`pointer: fine` 的桌面折叠条件,因此落入能力空档:现有按钮可能被 CSS 隐藏,即使存在于 DOM 中也不会进入任何有效点击分支。
## 实施方向
- 宽屏固定折叠能力应按宽度提供,而不是按鼠标能力整体禁用。
- hover 临时展开只属于鼠标增强,可继续用 hover/fine 条件隔离。
- 先用本地源码与浏览器 computed style 验证假设,再做最小实现。