feat: tab context menu pin submenu

M2 of pinned terminals (v0.17.0):
- TabBar: onPinTab prop (optional, hidden when unset for legacy callers)
- Terminal tabs get a 'Pin ▸' submenu (workspace/global) or 'Unpin' row
- UI vs Agent label distinction via isAgentTabId
- Non-terminal tabs get no pin entry (5-item legacy menu preserved)
- WorkbenchActions.pinTab threaded through split-pane LeafView
- Sidebar.onPinTab wires store.reduce(setTabPin) with cwd snapshot
- 12 new i18n keys synced across all 19 language dictionaries
This commit is contained in:
HuanLinOTO
2026-08-26 18:33:02 +08:00
parent 68f771e65f
commit 5d019d78ac
24 changed files with 412 additions and 10 deletions
+7
View File
@@ -31,6 +31,12 @@ export interface WorkbenchActions {
resizeSplit: (splitId: string, index: number, deltaFrac: number) => void
/** Float a docked tab out as a free window (tab context menu entry). */
floatTab: (tabId: string) => void
/**
* Pin/unpin a terminal tab (v0.17.0+). The shell snapshots the home cwd
* at pin time; null clears the pin. Optional: when undefined the tab
* context menu hides the pin entry (legacy callers).
*/
pinTab?: (tabId: string, scope: 'workspace' | 'global' | null) => void
}
/** One divider: pointer-capture drag translating px deltas into fractions.
@@ -211,6 +217,7 @@ function LeafView(props: {
else actions.moveTabBefore(payload, leaf.id, before)
}}
onFloatTab={actions.floatTab}
onPinTab={actions.pinTab}
/>
{leaf.tabs.length > 0 ? (
/*