diff --git a/01_content/src/client/index.tsx b/01_content/src/client/index.tsx index 3083cf8..8c3a9d5 100644 --- a/01_content/src/client/index.tsx +++ b/01_content/src/client/index.tsx @@ -66,12 +66,12 @@ const OVER_SIDE_PX = 80 /** 拓扑预设(聊天窗恒贴右,PRD §13.2 硬约束):左右/三栏/上一下二/井字 */ const PRESET_DEFS = [ - { id: '2h', leftCount: 0, topCount: 0, contentCount: 1 }, - { id: '3h', leftCount: 0, topCount: 0, contentCount: 2 }, - { id: 'l2', leftCount: 1, topCount: 1, contentCount: 0 }, - { id: 't2', leftCount: 0, topCount: 1, contentCount: 1 }, - { id: 'grid', leftCount: 0, topCount: 2, contentCount: 1 }, - { id: 't3', leftCount: 0, topCount: 1, contentCount: 2 }, + { id: '2h', leftCount: 0, topCount: 0, contentCount: 1, chatFull: false }, + { id: '3h', leftCount: 0, topCount: 0, contentCount: 2, chatFull: false }, + { id: 'l2', leftCount: 1, topCount: 1, contentCount: 0, chatFull: false }, + { id: 't2', leftCount: 0, topCount: 1, contentCount: 1, chatFull: false }, + { id: 'grid', leftCount: 0, topCount: 2, contentCount: 1, chatFull: false }, + { id: 't3', leftCount: 0, topCount: 1, contentCount: 2, chatFull: true }, ] as const function buildLayout(presetId: string, name: string): LayoutSpec { @@ -95,6 +95,7 @@ function buildLayout(presetId: string, name: string): LayoutSpec { chatWidth: { default: 360, min: 240, max: 600 }, topHeight: { default: 200, min: 120, max: 480 }, chatSide: 'right', + chatFullHeight: def.chatFull === true, } } @@ -137,9 +138,12 @@ function presetThumb(defId: string) { ) } return ( - - {cell(false, 'a')} - {cell(false, 'b')}{cell(false, 'c')}{cell(true, 'd')} + + + {cell(false, 'a')} + {cell(false, 'b')}{cell(false, 'c')} + + {cell(true, 'd')} ) } diff --git a/01_content/src/client/locales.ts b/01_content/src/client/locales.ts index b94529f..f2417c0 100644 --- a/01_content/src/client/locales.ts +++ b/01_content/src/client/locales.ts @@ -50,7 +50,7 @@ export const zh = { 'preset.l2': '左一右二', 'preset.t2': '上一下二', 'preset.grid': '井字四栏', - 'preset.t3': '上一下三', + 'preset.t3': '左品右聊', 'manage.deleteLayout': '删除布局', 'pane.browser': '浏览器', 'pane.explorer': '资源管理器', @@ -115,7 +115,7 @@ export const en = { 'preset.l2': 'Left + stacked', 'preset.t2': 'Top + two', 'preset.grid': '2×2 grid', - 'preset.t3': 'Top + three', + 'preset.t3': 'Pin + chat', 'manage.deleteLayout': 'Delete layout', 'pane.browser': 'Browser', 'pane.explorer': 'Explorer', diff --git a/01_content/src/client/split.tsx b/01_content/src/client/split.tsx index 4a217a4..65134b9 100644 --- a/01_content/src/client/split.tsx +++ b/01_content/src/client/split.tsx @@ -30,6 +30,8 @@ export type LayoutSpec = { topHeight?: { default: number; min: number; max: number } /** 聊天窗贴边位置:'right'(右列/右下,默认)| 'left'(左列/左下) */ chatSide?: 'left' | 'right' + /** 聊天窗通高(整列):为 true 时聊天占整条右/左列,内容区(含 top 行)全部排在其另一侧 */ + chatFullHeight?: boolean } type Geom = { left: number; top: number; right: number; bottom: number } @@ -310,8 +312,9 @@ export const splitStore: SplitState = { const leftW = hasLeft ? clamp(this.leftW, spec.leftWidth?.min ?? 160, Math.max(spec.leftWidth?.min ?? 160, colW - 260)) : 0 + const chatFull = spec.chatFullHeight === true const gap = Math.max(0, colW - chatW) + 'px' - const mt = (BAR_H + topH) + 'px' + const mt = (BAR_H + (hasTop && !chatFull ? topH : 0)) + 'px' const chatLeft = !hasLeft && spec.chatSide === 'left' this.lastMarginLeft = hasLeft ? leftW + 'px' : (chatLeft ? '' : gap) this.lastMarginRight = hasLeft ? '' : (chatLeft ? gap : '') @@ -691,10 +694,11 @@ function SplitWorkspace() { const leftW = hasLeft ? clamp(snap.leftW, spec.leftWidth?.min ?? 160, Math.max(spec.leftWidth?.min ?? 160, colW - 260)) : 0 + const chatFull = spec.chatFullHeight === true const contentW = Math.max(0, colW - chatW) const contentX = hasLeft ? g.left + leftW : (chatLeft ? g.left + chatW : g.left) - const topRowX = hasLeft ? g.left + leftW : g.left - const topRowW = hasLeft ? Math.max(0, colW - leftW) : colW + const topRowX = hasLeft ? g.left + leftW : contentX + const topRowW = hasLeft ? Math.max(0, colW - leftW) : (chatFull ? contentW : colW) const topItems = allocate(top, snap.topWs, topRowW) const mainItems = allocate(main, snap.paneWs, contentW) @@ -731,7 +735,7 @@ function SplitWorkspace() { return ( <> {/* 标题栏 */} -
+
{spec.title} {!hasLeft && (