diff --git a/.changeset/itchy-bugs-brush.md b/.changeset/itchy-bugs-brush.md new file mode 100644 index 00000000..40b7a65a --- /dev/null +++ b/.changeset/itchy-bugs-brush.md @@ -0,0 +1,8 @@ +--- +'playroom': minor +--- + +Improve frame filtering UX. + +- Allow users to select all checkboxes in a frame filter section, rather than automatically unselecting all checkboxes when all are selected. +- Rename the "Show all" button to "Clear" to reinforce the filtering pattern. diff --git a/cypress/e2e/toolbar.cy.ts b/cypress/e2e/toolbar.cy.ts index dfc184c6..929c8e6f 100644 --- a/cypress/e2e/toolbar.cy.ts +++ b/cypress/e2e/toolbar.cy.ts @@ -4,6 +4,7 @@ import { typeCode, gotoPreview, loadPlayroom, + getResetButton, selectWidthPreference, } from '../support/utils'; @@ -19,6 +20,9 @@ describe('Toolbar', () => { assertFramesMatch(frames); selectWidthPreference(frames[widthIndexToSelect]); assertFramesMatch([frames[widthIndexToSelect]]); + + getResetButton().click(); + assertFramesMatch(frames); }); it('preview', () => { diff --git a/cypress/support/utils.ts b/cypress/support/utils.ts index dc8ce39b..49205357 100644 --- a/cypress/support/utils.ts +++ b/cypress/support/utils.ts @@ -33,6 +33,8 @@ export const selectWidthPreference = (width: number) => { cy.findByRole('checkbox', { name: `${width}` }).click(); }; +export const getResetButton = () => cy.findByRole('button', { name: 'Clear' }); + export const togglePreviewPanel = () => cy.findByRole('button', { name: 'Preview playroom' }).click(); diff --git a/src/Playroom/FramesPanel/FramesPanel.tsx b/src/Playroom/FramesPanel/FramesPanel.tsx index 35f1c9ac..2f20a693 100644 --- a/src/Playroom/FramesPanel/FramesPanel.tsx +++ b/src/Playroom/FramesPanel/FramesPanel.tsx @@ -47,7 +47,7 @@ interface FrameHeadingProps { const FrameHeading = ({ showReset, onReset, children }: FrameHeadingProps) => (
{children} - {showReset && Show all} + {showReset && Clear}
); @@ -55,14 +55,12 @@ interface FrameOptionProps