Skip to content

Commit 671a067

Browse files
feat(preview-modernization): Update SidebarNav overflow separator (#4370)
* feat(preview-modernization): Update SidebarNav overflow separator * feat(preview-modernization): Add test --------- Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
1 parent 7e61a9c commit 671a067

File tree

3 files changed

+42
-1
lines changed

3 files changed

+42
-1
lines changed

src/elements/content-sidebar/SidebarNav.js

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
import * as React from 'react';
88
import { injectIntl } from 'react-intl';
99
import type { IntlShape } from 'react-intl';
10+
import classNames from 'classnames';
1011
import noop from 'lodash/noop';
1112
// $FlowFixMe
1213
import { BoxAiLogo } from '@box/blueprint-web-assets/icons/Logo';
@@ -83,6 +84,7 @@ const SidebarNav = ({
8384
const { enabled: hasBoxSign } = signSidebarProps || {};
8485
const { disabledTooltip: boxAIDisabledTooltip, showOnlyNavButton: showOnlyBoxAINavButton } =
8586
useFeatureConfig('boxai.sidebar');
87+
const { enabled: isPreviewModernizationEnabled } = useFeatureConfig('previewModernization');
8688

8789
const { focusPrompt } = usePromptFocus('.be.bcs');
8890

@@ -193,7 +195,12 @@ const SidebarNav = ({
193195
)}
194196

195197
{hasAdditionalTabs && (
196-
<div className="bcs-SidebarNav-overflow" data-testid="additional-tabs-overflow">
198+
<div
199+
className={classNames('bcs-SidebarNav-overflow', {
200+
'bcs-SidebarNav-overflow--modernized': isPreviewModernizationEnabled,
201+
})}
202+
data-testid="additional-tabs-overflow"
203+
>
197204
<AdditionalTabs key={fileId} tabs={additionalTabs} />
198205
</div>
199206
)}

src/elements/content-sidebar/SidebarNav.scss

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,22 @@
5858
}
5959
}
6060

61+
.bcs-SidebarNav-overflow--modernized {
62+
position: relative;
63+
64+
// Gradient overlay at bottom to indicate scrollable content
65+
&::after {
66+
position: absolute;
67+
bottom: 0;
68+
left: 0;
69+
width: 100%;
70+
height: 30px;
71+
background: linear-gradient(to top, $white, transparent);
72+
content: '';
73+
pointer-events: none;
74+
}
75+
}
76+
6177
.bcs-SidebarNav-footer {
6278
display: flex;
6379
flex: 0 0 60px;

src/elements/content-sidebar/__tests__/SidebarNav.test.js

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -163,6 +163,24 @@ describe('elements/content-sidebar/SidebarNav', () => {
163163
expect(placeholders).toHaveLength(5);
164164
});
165165

166+
test('should render additional tabs with modernized class when previewModernization is enabled', () => {
167+
renderSidebarNav({
168+
features: {
169+
previewModernization: {
170+
enabled: true,
171+
},
172+
},
173+
props: {
174+
additionalTabs: [],
175+
hasAdditionalTabs: true,
176+
},
177+
});
178+
179+
const overflowContainer = screen.getByTestId('additional-tabs-overflow');
180+
expect(overflowContainer).toBeInTheDocument();
181+
expect(overflowContainer).toHaveClass('bcs-SidebarNav-overflow--modernized');
182+
});
183+
166184
test('should render the Box Sign entry point if its feature is enabled', () => {
167185
renderSidebarNav({
168186
props: {

0 commit comments

Comments
 (0)