From cdc0316602fc6aea0b2c508db9b66bbf2ec2688f Mon Sep 17 00:00:00 2001 From: Tom Moor Date: Sat, 11 Jul 2026 12:28:32 +0200 Subject: [PATCH] fix: Prevent collapsed sidebar opening during text selection (#12965) --- app/components/Sidebar/Sidebar.tsx | 25 ++++++++++++++-------- shared/i18n/locales/en_US/translation.json | 6 +++--- 2 files changed, 19 insertions(+), 12 deletions(-) diff --git a/app/components/Sidebar/Sidebar.tsx b/app/components/Sidebar/Sidebar.tsx index d086b27ed3..da94b1167b 100644 --- a/app/components/Sidebar/Sidebar.tsx +++ b/app/components/Sidebar/Sidebar.tsx @@ -132,16 +132,23 @@ const Sidebar = React.forwardRef(function Sidebar_( [width, direction] ); - const handlePointerActivity = React.useCallback(() => { - if (ui.sidebarIsClosed) { - // clear the timeout when mouse exits - if (hoverTimeoutRef.current) { - clearTimeout(hoverTimeoutRef.current); + const handlePointerActivity = React.useCallback( + (event: React.PointerEvent) => { + if (ui.sidebarIsClosed) { + // don't reveal while a button is held, e.g. selecting text near the edge + if (event.buttons !== 0) { + return; + } + // clear the timeout when mouse exits + if (hoverTimeoutRef.current) { + clearTimeout(hoverTimeoutRef.current); + } + setHovering(document.hasFocus()); + setPointerMoved(true); } - setHovering(document.hasFocus()); - setPointerMoved(true); - } - }, [ui.sidebarIsClosed]); + }, + [ui.sidebarIsClosed] + ); const handlePointerLeave = React.useCallback( (ev) => { diff --git a/shared/i18n/locales/en_US/translation.json b/shared/i18n/locales/en_US/translation.json index 6e233f840c..9e8bb51061 100644 --- a/shared/i18n/locales/en_US/translation.json +++ b/shared/i18n/locales/en_US/translation.json @@ -1266,8 +1266,6 @@ "{{ count }} document imported_other": "{{ count }} document imported", "You can import a zip file that was previously exported from an Outline installation – collections, documents, and images will be imported. In Outline, open Export in the Settings sidebar and click on Export Data.": "You can import a zip file that was previously exported from an Outline installation – collections, documents, and images will be imported. In Outline, open Export in the Settings sidebar and click on Export Data.", "Drag and drop the zip file from the Markdown export option in {{appName}}, or click to upload": "Drag and drop the zip file from the Markdown export option in {{appName}}, or click to upload", - "Import a zip file of Markdown documents exported from Slab – collections, posts, and images will be imported. In Slab, open the admin settings and use the <1>Export option to download an archive of your content.": "Import a zip file of Markdown documents exported from Slab – collections, posts, and images will be imported. In Slab, open the admin settings and use the <1>Export option to download an archive of your content.", - "Drag and drop the zip file exported from Slab, or click to upload": "Drag and drop the zip file exported from Slab, or click to upload", "Configure": "Configure", "Role": "Role", "Guest": "Guest", @@ -1348,7 +1346,6 @@ "Import a JSON data file exported from another {{ appName }} instance": "Import a JSON data file exported from another {{ appName }} instance", "Import pages from a Confluence instance": "Import pages from a Confluence instance", "Enterprise": "Enterprise", - "Import a zip file of Markdown documents exported from Slab": "Import a zip file of Markdown documents exported from Slab", "Quickly transfer your existing documents, pages, and files from other tools and services into {{appName}}. You can also drag and drop any HTML, Markdown, and text documents directly into Collections in the app.": "Quickly transfer your existing documents, pages, and files from other tools and services into {{appName}}. You can also drag and drop any HTML, Markdown, and text documents directly into Collections in the app.", "Recent imports": "Recent imports", "Configure a variety of integrations with third-party services.": "Configure a variety of integrations with third-party services.", @@ -1616,6 +1613,9 @@ "You can manage your passkeys at any time": "You can manage your passkeys at any time", "If you have any concerns about your account security, please contact a workspace admin.": "If you have any concerns about your account security, please contact a workspace admin.", "Manage Passkeys": "Manage Passkeys", + "Import a zip file of Markdown documents exported from Slab – collections, posts, and images will be imported. In Slab, open the admin settings and use the <1>Export option to download an archive of your content.": "Import a zip file of Markdown documents exported from Slab – collections, posts, and images will be imported. In Slab, open the admin settings and use the <1>Export option to download an archive of your content.", + "Drag and drop the zip file exported from Slab, or click to upload": "Drag and drop the zip file exported from Slab, or click to upload", + "Import a zip file of Markdown documents exported from Slab": "Import a zip file of Markdown documents exported from Slab", "Add to Slack": "Add to Slack", "document published": "document published", "document updated": "document updated",