Skip to content

Fix/UI layout,fix workspace sidebar, page-block tabs, and context submenu placement - #140

Merged
DimoADE merged 11 commits into
DimoADE:masterfrom
Savlgoodman:fix/ui-layout
Nov 30, 2026
Merged

DimoADE merged 11 commits into
DimoADE:masterfrom
Savlgoodman:fix/ui-layout

Conversation

@Savlgoodman

Copy link
Copy Markdown
Contributor

Summary

侧边栏和工作区拆开。Dockview 只排页块,侧边栏是旁边的独立一列。页块标签按同一套宽度、让位和拖放规则工作。右键子菜单在窗口右缘改向左展开。

WorkspaceShell
└── MainRow
    ├── Sidebar                 # 不再是 Dockview 里的一列
    ├── Sash
    └── WorkspaceSurface
        └── Dockview
            └── 页块标签栏
                ├── 等宽 / 关闭预瞄 / 500ms 回稳
                ├── 同页块、跨页块、左侧会话拖入,同一条让位空档
                └── 左右页块在重启和侧边栏换边后保持左右
打开子菜单
  量这一行右边还剩多少
  放得下 176px 的子菜单
    向右展开
  放不下,且左边更宽
    向左展开

这一支修了这些:

• 侧边栏底色透出壳层灰,不再盖成一块白。
• 标签放得下时各 168px,放不下时平分,最窄 36px。选中标签不再单独加宽。
• 指针还在标签栏里时,关闭中间标签不重排宽度,后一个关闭键落到刚关掉的位置。指针离开 500ms 后才回到稳定宽度。
• 同一页块里拖动会让出空位。标签栏矩形内不触发页块分裂。
• 拖到另一个页块时,空档跟着指针下的那条标签栏走,并插到空档所在的位置。
• 从左侧会话列表拖一场会话,和拖一个标签一样:加入指针下的页块,或从内容区外缘 30% 分裂。
• 会话颜色在打开时随机取 24 个色位之一,关掉之前不变。重开再抽一次。
• 选中标签底角向外接住内容区。外扩的圆角留在标签行内部,Dockview 不再因此出现滚动条和溢出下拉。
• 重启,或把侧边栏从左换到右,左右两个页块保持左右,不再被收成上下。
• 右键菜单贴在窗口右缘时,子菜单向左展开。

Evidence

• Before: 左右页块在重启或侧边栏换边后变成上下。跨页块拖标签没有让位空档。关掉一个紫色会话后,后面的会话顺位变色。选中标签单独占 168px,底角向内收。贴右缘右键时,子菜单画出窗口。
After: 上述路径由对应测试盖住。页块方向见 dockviewLayoutTransform 与 matchesArrangement。标签宽度见 tabStripGeometry.test.ts(600px 里 5 个标签各 120px)。颜色见 workspaceSessionTabSlots.test.ts。跨页块空档和左侧会话拖入见 workspaceTabDrag.integration.test.tsx、sessionTabDrop.integration.test.ts。子菜单在右缘 1000px、视口 1024px、面板 176px 时向左展开,见 ProductContextMenu.test.tsx 与 contextMenuHitTest.test.ts。这 15 个右键相关测试已通过。没有在 Electron 窗口里再点一遍右键。

Merge Danger

Door: two-way

代码可以整支回退。已经在这支上跑过的本机,工作区网格若被自愈重写过,回退代码不会自动把那份本地布局改回去。

Blast Radius: 工作区布局

影响侧边栏、页块分裂与恢复、标签栏宽度和拖放、会话色点、产品右键菜单的子菜单。不改 Host 命令、远程协议或插件契约。

Savlgoodman and others added 11 commits November 27, 2026 17:42
Content tokens and panel bg-background painted the sidebar dock white, so it sat flush with the workspace card. Keep those fills transparent so the shell gray shows through.
Record the Chrome-style close pinning, equal resting tab boxes, and the rule that the tab bar is outside edge-split hit testing.
Keep resting tabs the same size, pin close buttons while the pointer stays in the strip, and reorder within a page block without treating the tab bar as a split. Session colors stay with the session when tabs move, and a rebuilt tab keeps the width it had before the drop.
Restart and moving the sidebar rebuilt the workspace grid, and a left-right pair of page blocks became a vertical branch under the horizontal root. Keep an in-order grid as-is, and when a rebuild does run, place those siblings on the axis they already had.
Dragging a tab onto another page block dropped the in-strip gap. Open that same gap on whichever tab strip is under the pointer, and insert the tab at that gap.
A conversation dragged from the left list uses the same tab gap, joins the page block under the pointer, and splits that page block from its content edge.
Each open session keeps a random color until it closes. Tabs share one width, the selected tab joins the panel with outward bottom corners, and those corners stay inside the strip so Dockview does not open a scrollbar.
@DimoADE
DimoADE merged commit 6595965 into DimoADE:master Nov 30, 2026
12 of 13 checks passed
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.

2 participants