Repository navigation
[Flat Nav R3.1] Collapse the nav bar into a skinny sidebar #106570
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
mountiny
merged 13 commits into
Expensify:main
from
software-mansion-labs:jmgraa/flat-nav-r3.1-collapse
Nov 13, 2026
+1,352
−163
Merged
Changes from all commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
49af5ec
Collapse the nav bar into a skinny sidebar
jmgraa 04b1814
Add tests for collapsed navigation bar
jmgraa 7000a6f
Move collapse fade inside FlatNavAccountStatus to prevent phantom gap
jmgraa d984cf3
Peek navigation bar on keyboard focus and remove redundant tooltips
jmgraa dc510d6
Merge remote-tracking branch 'upstream/main' into jmgraa/flat-nav-r3.…
jmgraa bce295e
Rename FlatNavigationBar callbacks to describe behavior
jmgraa 33caa5c
Preserve keyboard focus peeking when the Create menu closes
jmgraa ed81051
Select surface-specific boolean in collapse peek store snapshot
jmgraa 8d26a0f
Cleanup style helpers and prop comments
jmgraa a873c68
Shrink the Create button with the bar when collapsing
jmgraa 38e422e
End the peek only after the Create menu has fully closed
jmgraa b50a569
Start the peek only on keyboard focus
jmgraa eb42aa3
Rename FlatNavPeekableBody testID and drop unused cspell entry
jmgraa File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
57 changes: 57 additions & 0 deletions
57
src/components/Navigation/FlatNavigationBar/FlatNavCollapseToggle.tsx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,57 @@ | ||
| /** The flat navigation bar's toggle for collapsing it into an icon rail and expanding it back. */ | ||
| import SidebarLeftIcon from '@assets/images/sidebar-left.svg'; | ||
| import SidebarRightIcon from '@assets/images/sidebar-right.svg'; | ||
|
|
||
| import Icon from '@components/Icon'; | ||
| import {PressableWithFeedback} from '@components/Pressable'; | ||
| import Tooltip from '@components/Tooltip'; | ||
|
|
||
| import useLocalize from '@hooks/useLocalize'; | ||
| import useStyleUtils from '@hooks/useStyleUtils'; | ||
| import useTheme from '@hooks/useTheme'; | ||
| import useThemeStyles from '@hooks/useThemeStyles'; | ||
|
|
||
| import variables from '@styles/variables'; | ||
|
|
||
| import CONST from '@src/CONST'; | ||
|
|
||
| import React from 'react'; | ||
|
|
||
| type FlatNavCollapseToggleProps = { | ||
| isCollapsed: boolean; | ||
|
|
||
| onPress: () => void; | ||
| }; | ||
|
|
||
| function FlatNavCollapseToggle({isCollapsed, onPress}: FlatNavCollapseToggleProps) { | ||
| const styles = useThemeStyles(); | ||
| const StyleUtils = useStyleUtils(); | ||
| const theme = useTheme(); | ||
| const {translate} = useLocalize(); | ||
|
|
||
| const label = translate(isCollapsed ? 'reportActionCompose.expand' : 'reportActionCompose.collapse'); | ||
|
|
||
| return ( | ||
| <Tooltip text={label}> | ||
| <PressableWithFeedback | ||
| testID="FlatNavCollapseToggle" | ||
| role={CONST.ROLE.BUTTON} | ||
| accessibilityLabel={label} | ||
| accessibilityState={{expanded: !isCollapsed}} | ||
| sentryLabel={CONST.SENTRY_LABEL.NAVIGATION_TAB_BAR.COLLAPSE} | ||
| onPress={onPress} | ||
| style={[StyleUtils.getWidthAndHeightStyle(variables.iconSizeNormal), styles.alignItemsCenter, styles.justifyContentCenter]} | ||
| shouldUseAutoHitSlop | ||
| > | ||
| <Icon | ||
| src={isCollapsed ? SidebarRightIcon : SidebarLeftIcon} | ||
| fill={theme.icon} | ||
| width={variables.iconSizeNormal} | ||
| height={variables.iconSizeNormal} | ||
| /> | ||
| </PressableWithFeedback> | ||
| </Tooltip> | ||
| ); | ||
| } | ||
|
|
||
| export default FlatNavCollapseToggle; | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.