From 9f8cee669fb3c8bae74c1ba4fe1e855db65a6e16 Mon Sep 17 00:00:00 2001 From: Brett Jephson Date: Wed, 9 Sep 2026 14:47:14 +0100 Subject: [PATCH] Only open the dialog when the integration answers with a modal A `block` output would render loose next to the button, and a `complete` means the integration handled the click without any UI. Co-Authored-By: Claude Opus 5 (1M context) --- .../src/components/DocumentView/IntegrationActionButton.tsx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/packages/gitbook/src/components/DocumentView/IntegrationActionButton.tsx b/packages/gitbook/src/components/DocumentView/IntegrationActionButton.tsx index 3787d0389..aa549cbb5 100644 --- a/packages/gitbook/src/components/DocumentView/IntegrationActionButton.tsx +++ b/packages/gitbook/src/components/DocumentView/IntegrationActionButton.tsx @@ -46,7 +46,9 @@ export function IntegrationActionButton(props: { }; const result = await renderIntegrationUi({ renderContext, request: input }); - if (result.output?.type === 'element') { + // Anything but a modal has no place to go here: a `block` would render loose next to + // the button, and a `complete` means the integration handled the click on its own. + if (result.output?.type === 'element' && result.output.element.type === 'modal') { setModal({ input, output: result.output, children: result.children }); } } finally {