From 4f7fba08df3d5b2fb786ae88392cb2a7f9ac064f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Samy=20Pess=C3=A9?= Date: Mon, 13 Apr 2026 11:47:21 +0200 Subject: [PATCH] Prepare for step.content to be optional (#4174) --- .github/workflows/publish.yaml | 6 ++-- .../AI/server-actions/AIMessageView.tsx | 28 +++++++++---------- 2 files changed, 17 insertions(+), 17 deletions(-) diff --git a/.github/workflows/publish.yaml b/.github/workflows/publish.yaml index 59b2d0240..f31effb66 100644 --- a/.github/workflows/publish.yaml +++ b/.github/workflows/publish.yaml @@ -26,9 +26,10 @@ jobs: with: node-version: 22 registry-url: 'https://registry.npmjs.org' - # Ensure npm 11.5.1 or later is installed - name: Update npm - run: npm install -g npm@latest + run: | + corepack enable npm + corepack install -g npm@latest - name: Setup Bun uses: ./.github/composite/setup-bun - name: Install dependencies @@ -45,4 +46,3 @@ jobs: # Using a PAT instead of GITHUB_TOKEN because we need to run workflows when releases are created # https://github.com/orgs/community/discussions/26875#discussioncomment-3253761 GITHUB_TOKEN: ${{ secrets.GH_PERSONAL_TOKEN }} - diff --git a/packages/gitbook/src/components/AI/server-actions/AIMessageView.tsx b/packages/gitbook/src/components/AI/server-actions/AIMessageView.tsx index cf984ba55..ccc0f2b67 100644 --- a/packages/gitbook/src/components/AI/server-actions/AIMessageView.tsx +++ b/packages/gitbook/src/components/AI/server-actions/AIMessageView.tsx @@ -19,24 +19,24 @@ export function AIMessageView( return message.steps.length > 0 ? (
{message.steps.map((step, index) => { + const hasContent = Boolean(step.content && step.content.nodes.length > 0); return (
0 ? 'has-content' : '' - )} + className={tcls('flex flex-col gap-2', hasContent ? 'has-content' : '')} > - + {step.content ? ( + + ) : null} {withToolCalls && step.toolCalls && step.toolCalls.length > 0 ? (