From d26a7564d40852f941f59757d519499a24be0419 Mon Sep 17 00:00:00 2001 From: Zeno Kapitein Date: Fri, 19 Sep 2025 14:07:07 +0200 Subject: [PATCH] Expose "Best match" when site has translations --- .changeset/selfish-ravens-drop.md | 5 +++++ packages/gitbook/src/components/Header/Header.tsx | 5 +---- packages/gitbook/src/components/SpaceLayout/SpaceLayout.tsx | 6 +----- 3 files changed, 7 insertions(+), 9 deletions(-) create mode 100644 .changeset/selfish-ravens-drop.md diff --git a/.changeset/selfish-ravens-drop.md b/.changeset/selfish-ravens-drop.md new file mode 100644 index 0000000000..1b7585c063 --- /dev/null +++ b/.changeset/selfish-ravens-drop.md @@ -0,0 +1,5 @@ +--- +"gitbook": patch +--- + +Expose "Best match" when site has translations diff --git a/packages/gitbook/src/components/Header/Header.tsx b/packages/gitbook/src/components/Header/Header.tsx index b952f5d598..257a00792a 100644 --- a/packages/gitbook/src/components/Header/Header.tsx +++ b/packages/gitbook/src/components/Header/Header.tsx @@ -124,10 +124,7 @@ export function Header(props: { withSiteVariants={ sections?.list.some( (s) => - s.object === 'site-section' && - s.siteSpaces.filter( - (s) => s.space.language === siteSpace.space.language - ).length > 1 + s.object === 'site-section' && s.siteSpaces.length > 1 ) ?? false } withSections={!!sections} diff --git a/packages/gitbook/src/components/SpaceLayout/SpaceLayout.tsx b/packages/gitbook/src/components/SpaceLayout/SpaceLayout.tsx index a9be339da8..d813b35946 100644 --- a/packages/gitbook/src/components/SpaceLayout/SpaceLayout.tsx +++ b/packages/gitbook/src/components/SpaceLayout/SpaceLayout.tsx @@ -185,11 +185,7 @@ export function SpaceLayout(props: SpaceLayoutProps) { sections?.list.some( (s) => s.object === 'site-section' && - s.siteSpaces.filter( - (s) => - s.space.language === - siteSpace.space.language - ).length > 1 + s.siteSpaces.length > 1 ) ?? false } withSections={withSections}