feat(web): 右侧面板默认收起 - #367
Merged
Merged
Conversation
全新 profile 打开 Lisa 时右侧面板不再展开,默认进入两栏(侧边栏 + 聊天区占满)的布局;只有用户手动打开过一次之后才会保持展开。 - lisa-client.ts: 反转 lisaRightbar 的判定 —— 原来是"存了 collapsed 才收起",现在是"存了 open 才展开",于是 key 未设置即读作收起。 #fnPanel 的切换与持久化行为不变。 - lisa-html.ts: 紧跟 <body> 增加一段启动脚本,在 .frame 被解析前就打上 body.rb-collapsed。MAIN_CLIENT_JS 挂在 </body> 前且体积很大,浏览器 很可能先绘制已解析的 DOM 再执行它;收起既然成了多数人的默认路径, 不加这段会让每次冷加载都闪一下三栏再跳成两栏。主脚本随后幂等地 重新应用同一个 class。 - lisa-html-snapshot.test.ts: MAIN_HTML 是逐字节校验(长度 + sha256), 改 GUI 必须重算,已更新并补上变更流水注释。 ≤1180px 与 ≤720px 两个断点的自动隐藏逻辑未动,本次只影响宽屏默认值。 验证:typecheck 通过,npm test 全绿(1639 项 / 0 失败);1440px 宽度下 实测三种状态 —— 未设置→收起、open→展开、collapsed→收起且按钮保留 高亮态,open/collapsed 均跨刷新保持。 Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
全新 profile 打开 Lisa 时右侧面板不再展开,默认进入两栏(侧边栏 + 聊天区占满)的布局;只有用户手动打开过一次之后才会保持展开。
改动
src/web/lisa-client.ts— 反转lisaRightbar的判定。原来是"存了collapsed才收起",现在是"存了open才展开",于是 key 未设置(全新用户)即读作收起:#fnPanel的切换与持久化行为不变。src/web/lisa-html.ts— 紧跟<body>增加一段启动脚本,在.frame被解析前就打上body.rb-collapsed。MAIN_CLIENT_JS挂在</body>前且体积很大,浏览器很可能先绘制已解析的 DOM 再执行它;收起既然成了多数人的默认路径,不加这段会让每次冷加载都闪一下三栏再跳成两栏。主脚本随后幂等地重新应用同一个 class。src/web/lisa-css.ts— 更新注释说明默认态。src/web/lisa-html-snapshot.test.ts—MAIN_HTML是逐字节校验(长度 + sha256),改 GUI 必须重算,已更新为308201/08a2d26…,并在文件顶部的变更流水注释里补了这一条。范围
≤1180px 与 ≤720px 两个断点的自动隐藏逻辑未动,本次只影响宽屏下的默认值。
验证
npm run typecheck通过;npm test全绿(1639 项,0 失败,1 跳过)。真机跑起来在 1440px 宽度逐项验证了三种状态:
.rightbarrb-collapsed300px 1140pxnoneopen300px 820px 320pxflexcollapsedrb-collapsed300px 1140pxnone#fnPanel按钮的切换与持久化正常,收起时按钮保留高亮态;open与collapsed都能跨刷新保持。🤖 Generated with Claude Code