From 16bcf675ffdb9709ba64e1a6916131621a461095 Mon Sep 17 00:00:00 2001 From: siddhant Date: Fri, 3 Jul 2026 04:33:14 +0000 Subject: [PATCH 1/2] fix: prevent scroll jump when closing thread in narrow layout In narrow/responsive layout, the contextual bar aside was a flex child that took 100% width, squeezing the main chat body to 0 width. When the thread closed and the aside unmounted, the body expanded back, causing the VList virtualizer to re-measure and reset scroll position to top. Fix by wrapping the aside in an absolutely positioned Box when contextualbarPosition is absolute (narrow mode), so it overlays the body instead of affecting its flex layout. Also remove restoreFocus from ContextualbarDialog FocusScope to prevent unwanted focus restoration when closing the contextual bar. Fixes #41132 --- apps/meteor/client/views/room/layout/RoomLayout.tsx | 12 +++++++++++- .../components/Contextualbar/ContextualbarDialog.tsx | 2 +- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/apps/meteor/client/views/room/layout/RoomLayout.tsx b/apps/meteor/client/views/room/layout/RoomLayout.tsx index a87dd4573efdf..3b4955c4dca51 100644 --- a/apps/meteor/client/views/room/layout/RoomLayout.tsx +++ b/apps/meteor/client/views/room/layout/RoomLayout.tsx @@ -65,7 +65,17 @@ const RoomLayout = ({ header, body, footer, aside, ...props }: RoomLayoutProps): {footer && {footer}} - {aside && {aside}} + {aside && ( + + {contextualbarPosition === 'absolute' ? ( + + {aside} + + ) : ( + aside + )} + + )} diff --git a/packages/ui-client/src/components/Contextualbar/ContextualbarDialog.tsx b/packages/ui-client/src/components/Contextualbar/ContextualbarDialog.tsx index 36909e788be3e..653c523f9dc6f 100644 --- a/packages/ui-client/src/components/Contextualbar/ContextualbarDialog.tsx +++ b/packages/ui-client/src/components/Contextualbar/ContextualbarDialog.tsx @@ -38,7 +38,7 @@ const ContextualbarDialog = ({ onClose, ...props }: ContextualbarDialogProps) => ); return ( - + From c450fceb98784bad887e68fc029d27850b063f07 Mon Sep 17 00:00:00 2001 From: siddhant Date: Fri, 3 Jul 2026 12:01:38 +0000 Subject: [PATCH 2/2] fix: address review feedback --- apps/meteor/client/views/room/layout/RoomLayout.tsx | 2 +- .../src/components/Contextualbar/ContextualbarDialog.tsx | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/apps/meteor/client/views/room/layout/RoomLayout.tsx b/apps/meteor/client/views/room/layout/RoomLayout.tsx index 3b4955c4dca51..717a4e45c850e 100644 --- a/apps/meteor/client/views/room/layout/RoomLayout.tsx +++ b/apps/meteor/client/views/room/layout/RoomLayout.tsx @@ -23,7 +23,7 @@ const useBreakpointsElement = () => { const breakpoints = useMemo( () => breakpointsDefinitions - .filter(({ minViewportWidth }) => minViewportWidth && borderBoxSize.inlineSize && borderBoxSize.inlineSize >= minViewportWidth) + .filter(({ minViewportWidth }) => minViewportWidth && (!borderBoxSize.inlineSize || borderBoxSize.inlineSize >= minViewportWidth)) .map(({ name }) => name), [borderBoxSize], ); diff --git a/packages/ui-client/src/components/Contextualbar/ContextualbarDialog.tsx b/packages/ui-client/src/components/Contextualbar/ContextualbarDialog.tsx index 653c523f9dc6f..36909e788be3e 100644 --- a/packages/ui-client/src/components/Contextualbar/ContextualbarDialog.tsx +++ b/packages/ui-client/src/components/Contextualbar/ContextualbarDialog.tsx @@ -38,7 +38,7 @@ const ContextualbarDialog = ({ onClose, ...props }: ContextualbarDialogProps) => ); return ( - +