Skip to content

fix: 面板开关注入 session header utilities,与 Session log 同行对齐 - #89

Open
fchange wants to merge 1 commit into
omdsh-dev:mainfrom
fchange:fix/header-utilities-toggle
Open

fix: 面板开关注入 session header utilities,与 Session log 同行对齐#89
fchange wants to merge 1 commit into
omdsh-dev:mainfrom
fchange:fix/header-utilities-toggle

Conversation

@fchange

@fchange fchange commented Aug 15, 2026

Copy link
Copy Markdown

问题

会话页头(标题 / 标准模式 / Session log / 对话·轨迹)和插件 toggleCluster 不在同一水平线上。

根因:cluster 是 position: fixed; top: 3px(中心约 y=17),DSH header title 行是 padding-top: 12px + min-height: 32px(Session log 中心 y=28),差 11px。折叠时再靠 padding-right: 78px 给 header 让位,header 一改版就会再次错位。

变更

走 DSH 官方加法座,不替换整条 header:

  • 通过 slots.inject('conversation.session.header.utilities') 把面板开关挂到 Session log 同一行id: better-sidebar-toggleorder: 100,坐在 Session log 右侧)。
  • 抽出共用 ToggleCluster:header 内联一份;空白 hero / 无会话时 header 隐藏,仍用右上角 fixed 兜底。
  • header 座挂载期间写 data-dsh-sidebar-in-header,CSS 藏掉 floating 副本,并撤掉侧栏 tab 条为角落按钮预留的 padding-right
  • 删除 data-dsh-sidebar-collapsed 的 header 右 padding hack。

#82(桌面标题带避让)、#88(位置兼容模式)正交:本 PR 修的是 Web 会话页头基线,用的是 conversation.session.header.utilities,不改桌面 inset。

测试

  • 新增 tests/header-toggle.spec.tsslots.inject 等到声明再注册;挂载写/卸载清 body 属性;按钮写 store;无会话时禁用。
  • 本地:pnpm test(502 全绿)、pnpm typecheck
  • 真实 DSH web(早上好问候):header 打开/折叠后,Session log 与两个开关中心都在 y=28;空白首页 header 隐藏时仍是右上角 floating 兜底。

fixed 的 toggle cluster(top: 3px)和 DSH 会话页头 title 行不在同一基线。
改为通过 slots.inject 挂到 conversation.session.header.utilities(Session
log 同座),有会话时走文档流对齐;空白 hero 仍用右上角 fixed 兜底。
@chatgpt-codex-connector

Copy link
Copy Markdown

Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits.
Credits must be used to enable repository wide code reviews.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant