Loading skill
Install any skill in seconds. Free to start, no credit card required.
Get Started Free →Computes the chat page's mobile or desktop layout from the visible viewport width, syncing on resize and closing stale mobile drawers.
50% 91%+41 ptsof test cases passed
Passed 20 of 22 test cases with the skill, and 11 of 22 without it.
3 of 3 safety checks passed
Not used yet
对于 ai-shifu/src/web/src/app/c/[[...id]],优先把聊天布局视为“视口问题”,而不只是“容器问题”。
若业务语义明确要求 FRAME_LAYOUT_MOBILE 只代表真实移动设备,而不是窄桌面窗口,则应把“是否返回 FRAME_LAYOUT_MOBILE”改为基于 user agent / 设备能力判断,同时保留 FRAME_LAYOUT_PC、FRAME_LAYOUT_PAD、FRAME_LAYOUT_PAD_INTENSIVE 的既有返回方式,避免影响现有消费方。
#root.clientWidth、document.documentElement.clientWidth、window.innerWidth、window.visualViewport?.width。uiConstants,并在 store 与页面间复用。resize、orientationchange、visualViewport.resize 时重新计算布局。calcFrameLayout 增加或更新测试,覆盖 root 节点缺失与移动端 WebView 容器宽度异常偏大的场景。calcFrameLayout 内部,不要改调用方对 FRAME_LAYOUT_* 的比较逻辑。calcFrameLayout 可能在 store 初始化阶段被服务端模块求值调用,读取 document 前必须做 SSR guard,服务端默认回退 FRAME_LAYOUT_PC,避免非聊天页面或错误兜底页因 document is not defined 先崩溃。react-device-detect 进行聊天布局切换。Next to this one in the catalogue, plus more from the same author.