fix(console): 聊天分隔线修复——加载后按规格钳制存档chatW(脏值1067→600,setChatW同兜底max);分隔线向内容侧偏移3px,避开与宿主聊天区2px重叠(不加宽)

This commit is contained in:
Aisland
2026-09-02 20:31:24 +08:00
parent 173fd61bda
commit 5c6c04d70a
11 changed files with 43 additions and 4 deletions
+7 -2
View File
@@ -17344,6 +17344,11 @@ var splitStore = {
this.savedMarginRight = viewArea.style.marginRight;
this.savedMarginTop = viewArea.style.marginTop;
this.refreshGeom();
if (this.geom) {
const minContent = main.reduce((a, p) => a + p.min, 0) + Math.max(0, main.length - 1) * GAP;
const hi = Math.max(spec.chatWidth.min, this.geom.right - this.geom.left - minContent);
this.chatW = clamp(Math.round(this.chatW), spec.chatWidth.min, Math.min(spec.chatWidth.max, hi));
}
const g0 = this.geom;
if (g0) {
const colW0 = g0.right - g0.left;
@@ -17482,7 +17487,7 @@ var splitStore = {
const main = spec.main ?? [];
const minContent = main.reduce((a, p) => a + p.min, 0) + Math.max(0, main.length - 1) * GAP;
const hi = Math.max(spec.chatWidth.min, colW - minContent);
this.chatW = clamp(Math.round(w), spec.chatWidth.min, hi);
this.chatW = clamp(Math.round(w), spec.chatWidth.min, Math.min(spec.chatWidth.max, hi));
this.applyMargin();
this.persist();
this.notify();
@@ -19744,7 +19749,7 @@ function WorkspaceLayer(props) {
title: hasLeft ? "\u62D6\u52A8\u8C03\u6574\u5DE6\u53F3\u5217\u5BBD" : "\u62D6\u52A8\u8C03\u6574\u804A\u5929\u5BBD\u5EA6",
style: {
position: "fixed",
left: (hasLeft ? g.left + leftW : chatLeft ? g.left + chatW : g.right - chatW) - DIVIDER / 2,
left: (hasLeft ? g.left + leftW : chatLeft ? g.left + chatW : g.right - chatW) - DIVIDER / 2 + (hasLeft ? 0 : chatLeft ? 3 : -3),
top: hasLeft || chatFull ? barTop + BAR_H : bodyTop,
width: DIVIDER,
height: hasLeft || chatFull ? g.bottom - barTop - BAR_H : mainH,