diff --git a/plugins/session-sharing/src/frontend/index.tsx b/plugins/session-sharing/src/frontend/index.tsx
index a794b5fbd..ec0b6488a 100644
--- a/plugins/session-sharing/src/frontend/index.tsx
+++ b/plugins/session-sharing/src/frontend/index.tsx
@@ -320,6 +320,17 @@ export function activate(app: TermixApp): void {
},
});
+ // A small share button on the tab itself, as in 2.8.
+ app.registerSlotContribution("tab.inline", {
+ actionId: SHARE_ACTION,
+ titleKey: "sessionSharing.shareButton",
+ icon: Share2,
+ kind: "button",
+ when: (context) =>
+ typeof (context.handle as { getShareTarget?: unknown } | null | undefined)
+ ?.getShareTarget === "function",
+ });
+
app.registerSlotContribution("terminal.overlay", {
actionId: "session-sharing.participants",
titleKey: "collab.members",
diff --git a/plugins/session-sharing/tests/frontend/activate.test.tsx b/plugins/session-sharing/tests/frontend/activate.test.tsx
index 21d204d55..601f4d78d 100644
--- a/plugins/session-sharing/tests/frontend/activate.test.tsx
+++ b/plugins/session-sharing/tests/frontend/activate.test.tsx
@@ -66,6 +66,9 @@ describe("session-sharing activate", () => {
expect(rendered.registered.slot("remote-desktop.toolbar")).toEqual([
"session-sharing.share",
]);
+ expect(rendered.registered.slot("tab.inline")).toEqual([
+ "session-sharing.share",
+ ]);
expect(rendered.registered.slot("shell.overlay")).toHaveLength(2);
expect(rendered.registered.actions().sort()).toEqual([
"session-sharing.share",
diff --git a/src/ui/shell/TabBar.tsx b/src/ui/shell/TabBar.tsx
index 6963ca369..f4441239e 100644
--- a/src/ui/shell/TabBar.tsx
+++ b/src/ui/shell/TabBar.tsx
@@ -489,6 +489,27 @@ export function TabBar({
)}
+ {/* Plugins add small buttons here, invoked with the tab's surface handle. */}
+ [tab.terminalRef?.current, tab]}
+ renderItem={(contribution, invoke) => (
+
+ )}
+ />