fix(#15950): mobile favorites folder navigation with proper back button (#16118)

## What’s done
- Clicking a favorite folder on mobile now opens a clean drill-down
layer with only its contents
- Added a back button (icon + folder name) — visually 100% identical to
`NavigationDrawerBackButton`
- Sidebar no longer collapses when opening a folder
- Tree line is removed on mobile (consistent with current Twenty design)

## Intentional deviations from the mockup
1. **Back button does not replace `MultiWorkspaceDropdownButton`**  
Kept `NavigationDrawerHeader` untouched — it’s responsible for the
hamburger menu and workspace name.
   Added the back button as a separate block below.  
→ This feels cleaner architecturally and avoids breaking other places
that use `NavigationDrawerHeader`.

2. **Vertical spacing between items is slightly tighter than in the
mockup**
Used `NavigationDrawerSubItem` — the standard component for nested items
in Twenty.
Current production spacing matches this exactly, so I preferred
consistency over pixel-perfect mockup matching.

Happy to adjust either point if the team prefers to follow the mockup
1:1.

Closes #15950

---------

Co-authored-by: Baptiste Devessier <baptiste@devessier.fr>
This commit is contained in:
Anton Ambarov
2025-12-03 15:08:52 +05:00
committed by GitHub
parent e18262cfa6
commit a892462c05
6 changed files with 178 additions and 10 deletions
@@ -51,6 +51,7 @@ export type NavigationDrawerItemProps = {
isRightOptionsDropdownOpen?: boolean;
triggerEvent?: TriggerEventType;
mouseUpNavigation?: boolean;
preventCollapseOnMobile?: boolean;
};
type StyledItemProps = Pick<
@@ -267,6 +268,7 @@ export const NavigationDrawerItem = ({
isRightOptionsDropdownOpen,
triggerEvent,
mouseUpNavigation = false,
preventCollapseOnMobile = false,
}: NavigationDrawerItemProps) => {
const theme = useTheme();
const isMobile = useIsMobile();
@@ -282,7 +284,7 @@ export const NavigationDrawerItem = ({
);
const handleMobileNavigation = () => {
if (isMobile) {
if (isMobile && !preventCollapseOnMobile) {
setIsNavigationDrawerExpanded(false);
}
};
@@ -0,0 +1,6 @@
import { atom } from 'recoil';
export const currentFavoriteFolderIdState = atom<string | null>({
key: 'currentFavoriteFolderIdState',
default: null,
});