Skip to content
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion apps/meteor/client/providers/LayoutProvider.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ const LayoutProvider = ({ children }: LayoutProviderProps) => {
const breakpoints = useBreakpoints(); // ["xs", "sm", "md", "lg", "xl", xxl"]
const [hiddenActions, setHiddenActions] = useState(hiddenActionsDefaultValue);
const enhancedNavigationEnabled = useFeaturePreview('newNavigation');
const secondSidebarEnabled = useFeaturePreview('secondarySidebar');

const router = useRouter();
// Once the layout is embedded, it can't be changed
Expand All @@ -34,6 +35,7 @@ const LayoutProvider = ({ children }: LayoutProviderProps) => {

const shouldToggle = enhancedNavigationEnabled ? isTablet || isMobile : isMobile;
const shouldDisplaySidePanel = !isTablet || displaySidePanel;
const defaultSidebarWidth = secondSidebarEnabled ? '220px' : '240px';

useEffect(() => {
setIsCollapsed(shouldToggle);
Expand Down Expand Up @@ -80,7 +82,7 @@ const LayoutProvider = ({ children }: LayoutProviderProps) => {
openSidePanel: () => setDisplaySidePanel(true),
},
size: {
sidebar: isTablet ? '280px' : '240px',
sidebar: isTablet ? '280px' : defaultSidebarWidth,
// eslint-disable-next-line no-nested-ternary
contextualBar: breakpoints.includes('sm') ? (breakpoints.includes('xl') ? '38%' : '380px') : '100%',
},
Expand All @@ -100,6 +102,7 @@ const LayoutProvider = ({ children }: LayoutProviderProps) => {
isCollapsed,
shouldToggle,
shouldDisplaySidePanel,
defaultSidebarWidth,
breakpoints,
hiddenActions,
router,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ export const useShortcutOpenMenu = (ref: RefObject<Element>): void => {
useEffect(() => {
const unsubscribe = tinykeys(ref.current as HTMLElement, {
Alt: (event) => {
if (!(event.target as HTMLElement).className.includes('rcx-sidebar-item')) {
if (!(event.target as HTMLElement).className.includes('rcx-sidebar-v2-item')) {
return;
}
event.preventDefault();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ const SidePanel = ({ title, currentTab, unreadOnly, toggleUnreadOnly, rooms }: S
<ToggleSwitch id={unreadFieldId} checked={unreadOnly} onChange={toggleUnreadOnly} />
</Box>
</SidepanelHeader>
<Box pb={8} h='full' ref={ref}>
<Box h='full' ref={ref}>
{rooms && rooms.length === 0 && <SidePanelNoResults currentTab={currentTab} />}
<VirtualizedScrollbars>
<Virtuoso
Expand Down
Original file line number Diff line number Diff line change
@@ -1,19 +1,21 @@
import { SidepanelList } from '@rocket.chat/fuselage';
import { useMergedRefs } from '@rocket.chat/fuselage-hooks';
import type { ForwardedRef, HTMLAttributes } from 'react';
import { forwardRef } from 'react';
import { useTranslation } from 'react-i18next';

import { useSidebarListNavigation } from '../../../sidebar/RoomList/useSidebarListNavigation';
import { useSidebarListNavigation } from '../sidebar/RoomList/useSidebarListNavigation';
Copy link

Copilot AI Aug 26, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The import path has been changed but appears incorrect. The path '../sidebar/RoomList/useSidebarListNavigation' suggests going up one level to 'sidebar', but from the sidepanel directory, the correct path should be '../../../sidebar/RoomList/useSidebarListNavigation' as it was originally.

Copilot uses AI. Check for mistakes.

type SidepanelListWrapperProps = HTMLAttributes<HTMLDivElement>;

const SidepanelListWrapper = forwardRef(function SidepanelListWrapper(props: SidepanelListWrapperProps, ref: ForwardedRef<HTMLDivElement>) {
const { t } = useTranslation();
const { sidebarListRef } = useSidebarListNavigation();
const mergedRefs = useMergedRefs(ref, sidebarListRef);

return <SidepanelList aria-label={t('Channels')} ref={mergedRefs} {...props} />;
return (
<SidepanelList aria-label={t('Channels')} ref={sidebarListRef}>
<div ref={ref} {...props} />
</SidepanelList>
Copy link

Copilot AI Aug 26, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The component structure has been fundamentally changed from forwarding refs to the SidepanelList to wrapping content in a div. This breaks the expected API where the forwarded ref should reference the SidepanelList component itself, not an inner div wrapper.

Copilot uses AI. Check for mistakes.
);
});

export default SidepanelListWrapper;
8 changes: 4 additions & 4 deletions packages/i18n/src/locales/en.i18n.json
Original file line number Diff line number Diff line change
Expand Up @@ -3614,11 +3614,11 @@
"No_departments_yet_description": "Organize agents into departments, set how tickets get forwarded and monitor their performance.",
"No_direct_messages_yet": "No Direct Messages.",
"No_channels_or_discussions": "No channels or discussions",
"No_channels_or_discussions_description": "Channels and discussions belonging to this team will appear hear.",
"No_channels_or_discussions_description": "Channels and discussions belonging to this team will appear here.",
"No_discussions": "No discussions",
"No_discussions_description": "Discussions you've joined will appear hear.",
"No_discussions_channels_filter_description": "Discussions belonging to this channel will appear hear.",
"No_discussions_dms_filter_description": "Discussions belonging to this user will appear hear.",
"No_discussions_description": "Discussions youve joined will appear here.",
"No_discussions_channels_filter_description": "Discussions belonging to this channel will appear here.",
"No_discussions_dms_filter_description": "Discussions belonging to this user will appear here.",
"No_discussions_yet": "No discussions yet",
"No_emojis_found": "No emojis found",
"No_feature_to_preview": "No feature to preview",
Expand Down
Loading