Skip to content
Merged
Show file tree
Hide file tree
Changes from all 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: 5 additions & 0 deletions .changeset/fuzzy-beans-push.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@primer/react": patch
---

chore(SelectPanel): put fullscreen functionality behind FF
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
11 changes: 8 additions & 3 deletions e2e/components/SelectPanel.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -109,10 +109,15 @@ test.describe('SelectPanel', () => {
)
})

test(`Default @vrt responsive width .modern-action-list--true`, async ({page}) => {
test(`Default @vrt responsive width .modern-action-list--true .fullscreen-on-narrow--true`, async ({page}) => {
await visit(page, {
id: 'components-selectpanel--default',
globals: {featureFlags: {primer_react_select_panel_with_modern_action_list: true}},
globals: {
featureFlags: {
primer_react_select_panel_with_modern_action_list: true,
primer_react_select_panel_fullscreen_on_narrow: true,
},
},
})

await page.setViewportSize({width: 767, height: 767})
Expand All @@ -125,7 +130,7 @@ test.describe('SelectPanel', () => {
}

expect(await page.screenshot({animations: 'disabled'})).toMatchSnapshot(
`SelectPanel-Default-responsive-width-light-modern-action-list--true.png`,
`SelectPanel-Default-responsive-width-light-modern-action-list--true-full-screen-on-narrow--true.png`,
)
})
})
1 change: 1 addition & 0 deletions packages/react/src/FeatureFlags/DefaultFeatureFlags.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,5 @@ export const DefaultFeatureFlags = FeatureFlagScope.create({
primer_react_select_panel_with_modern_action_list: false,
primer_react_overlay_overflow: false,
primer_react_segmented_control_tooltip: false,
primer_react_select_panel_fullscreen_on_narrow: false,
})
7 changes: 4 additions & 3 deletions packages/react/src/SelectPanel/SelectPanel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -440,6 +440,7 @@ export function SelectPanel({
}
}
const usingModernActionList = useFeatureFlag('primer_react_select_panel_with_modern_action_list')
const usingFullScreenOnNarrow = useFeatureFlag('primer_react_select_panel_fullscreen_on_narrow')

const iconForNoticeVariant = {
info: <InfoIcon size={16} />,
Expand All @@ -466,7 +467,7 @@ export function SelectPanel({
height={height}
width={width}
anchorId={id}
variant={{regular: 'anchored', narrow: 'fullscreen'}}
variant={usingFullScreenOnNarrow ? {regular: 'anchored', narrow: 'fullscreen'} : undefined}
pinPosition={!height}
>
<LiveRegionOutlet />
Expand Down Expand Up @@ -519,7 +520,7 @@ export function SelectPanel({
</Box>
) : null}
</div>
{onCancel && (
{onCancel && usingFullScreenOnNarrow && (
<IconButton
type="button"
variant="invisible"
Expand Down Expand Up @@ -579,7 +580,7 @@ export function SelectPanel({
>
{footer}
</Box>
) : isMultiSelectVariant(selected) ? (
) : isMultiSelectVariant(selected) && usingFullScreenOnNarrow ? (
/* Save and Cancel buttons are only useful for multiple selection, single selection instantly closes the panel */
<div className={clsx(classes.Footer, classes.ResponsiveFooter)}>
{/* we add a save and cancel button on narrow screens when SelectPanel is full-screen */}
Expand Down
Loading