feat(tabbar): 新增 TabDescriptor.rightActions,活跃 tab 可注入 tab 栏右侧操作区
TabBar 新增 getTabRightActions prop,活跃 tab 的 descriptor 声明 rightActions 时,返回的 ReactNode 渲染在 tab 栏右端(+ 按钮右侧、面板关闭按钮左侧, 右对齐)。让 tab 把自己的工具栏(如终端 tab 的新建 / 拆分 / 重启)直接放进 tab 栏,而不是在内容区顶部再单独渲染一行头部。 TabDescriptor.rightActions 与 badge 同签名 (ctx, scope, state) => ReactNode, 抛错被吞掉(不渲染操作),每次活跃 tab 渲染调用——保持廉价。 文档同步:docs/external-plugin-guide.md §4.1 TabDescriptor 字段。
This commit is contained in:
1 parent
492661a3ea
commit
679889d8a9
6 files changed
+83
-4
No files matched your search
@@ -660,6 +660,21 @@ body[data-dsh-sidebar-dragging] .bottomPanel {
|
||||
color: var(--dsw-alias-label-primary);
|
||||
}
|
||||
|
||||
/* The active tab's right-aligned action area: sits at the tab strip's right
|
||||
end (after the + button, before the panel's close control). Flexes to fill
|
||||
the remaining width so its content can right-align; content is opaque to
|
||||
the tab strip's own layout (the strip reserves the close control's width
|
||||
via .bottomPanel .tabBar's padding-right, so this area never underlaps it). */
|
||||
.tabBarRightActions {
|
||||
flex: 1;
|
||||
min-width: 0;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: flex-end;
|
||||
gap: 2px;
|
||||
padding-right: 4px;
|
||||
}
|
||||
|
||||
/* ── Explorer ──────────────────────────────────────────────────────────── */
|
||||
|
||||
.explorer {
|
||||
|
||||
Reference in new issue
Block a user