Repository navigation
fix(sidebar): 空白会话在右侧栏展开时仍能打开底部工作台(#989) - #1238
Merged
Merged
Conversation
blank 会话里宿主不渲染会话头 utilities,插件的底部工作台入口只剩右上角那个 备用入口;而它在宿主右侧面板展开时整个不渲染,于是「先开右栏」就再也打不开 底部工作台。#1053 修的是正常会话的会话头入口,这一处当时被留了下来。 现在展开态照常渲染,并改锚**面板左缘**:展开态宿主的 Split / Fullscreen / Collapse 搬进了面板内部,锚在那簇控件左侧会落进面板、盖住面板内容;面板左缘 那一格是会话头那一行的右端空位,与收起态入口同一列。 真实宿主(DSH 0.2.2-rc.5 + Chromium,1440x900,空白新会话)实测: - 收起态:入口 1364,11(不变); - 展开态:修复前屏上 0 个入口,修复后 756,10(面板左缘 792),点击可打开底部面板。 tests/dock-fallback.spec.tsx 把「展开态不渲染」改成「展开态渲染且锚在面板左缘 756px 并仍可点击」(还原旧守卫即红);tests/e2e/blank-session-dock-entry.e2e.ts 新增真实宿主用例:展开右栏后入口仍在、屏上恰好一个、右缘不越过面板左缘。
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.
This is by an automated agent, not a human.
Fixes #989.
调查结论
空白新会话的底部工作台入口大部分场景已经能用(#807 随 v0.25.0 发布,真实宿主实测:收起态入口在 1364,11),但宿主右侧面板展开时整个入口不渲染——blank 会话不渲染会话头 utilities,这个备用入口是唯一一个,藏掉就等于「先开右栏就再也打不开底部工作台」。
#1053 修的是正常会话的会话头入口(同一类问题),blank 会话这一处当时被留了下来。本 PR 补上这一处。
改动
src/client/sidebar/dock-fallback.tsx:[data-sidebar-right-panel]的 rect):展开态宿主的 Split / Fullscreen / Collapse 搬进了面板内部,锚在那簇控件左侧会落进面板、盖住面板内容;面板左缘那一格是会话头那一行的右端空位,与收起态入口同一列(收起态 1364 / 展开态 756,面板左缘 792)。证据(真实宿主 + Chromium)
基线:DSH
0.2.2-rc.5(桌面端同款宿主包)+ 本分支构建,视口 1440×900,浅色主题,场景为「新建会话 → 空白页 → 点开右侧栏」。Before(本分支去掉 src 改动后重新构建,即当前
dev行为):右侧面板展开后屏上0 个底部入口。After(本 PR):同一场景下入口出现在面板左缘(756,10),点击可打开底部工作台。
实测读数(同一探针脚本):
点击 After 的入口后
[data-dsh-bottom-panel]可见(底部工作台真的打开)。验证
tests/dock-fallback.spec.tsx:把「展开态不渲染」改成「展开态渲染、锚在面板左缘 756px、点击仍能打开」;还原旧守卫即红(右侧栏展开时入口仍应在: expected null not to be null)。16 例全绿。tests/e2e/blank-session-dock-entry.e2e.ts新增真实宿主用例:空白会话展开右栏后入口仍在、屏上恰好一个、右缘不越过面板左缘、点击打开底部面板。tsc --noEmit、eslint(改动文件)干净。vitest:3543 passed / 11 failed;失败的 7 个文件(fs-mkdir/selection-quote/fs-operations/market-manifest/plugin-meta/file-stream-route/git-worktree)在未改动的基线上同样失败(本机无 pnpm 等环境差异),与本改动无关。test:mount)本机跑不了(缺 pnpm),由 CI 的plugin-mountlane 覆盖。风险
position: fixed,锚点来自宿主data-sidebar-right-panel的 rect;该属性在本仓库多份 e2e 与 CSS 里已是既有契约。量不到时退回旧锚点(不会把入口藏掉)。BottomDockToggle)与收起态位置。