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
8 changes: 4 additions & 4 deletions src/sidebar/components/search/FilterControls.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ export default function FilterControls({
<b>Filters</b>
{hasSelection && (
<FilterToggle
label={`Remove ${selectedCount} selected annotation filter`}
label={`Clear filter: ${selectedCount} selected`}
description={`Show only the ${selectedCount} selected annotations. Press to clear this filter and show all annotations.`}
active={true}
setActive={() => store.clearSelection()}
Expand All @@ -170,7 +170,7 @@ export default function FilterControls({
{focusFilters.user && (
<FilterToggle
icon={ProfileIcon}
label={`By ${focusFilters.user.display}`}
label={`Clear filter: by author ${focusFilters.user.display}`}
description={`Show annotations by ${focusFilters.user.display}. Press to clear this filter.`}
active={focusActive.has('user')}
// When a selection exists, it replaces other filters.
Expand All @@ -182,7 +182,7 @@ export default function FilterControls({
{focusFilters.page && (
<FilterToggle
icon={FileGenericIcon}
label={`Pages ${focusFilters.page.display}`}
label={`Clear filter: pages ${focusFilters.page.display}`}
description={`Show annotations on pages ${focusFilters.page.display}. Press to clear this filter.`}
active={focusActive.has('page')}
disabled={hasSelection}
Expand All @@ -193,7 +193,7 @@ export default function FilterControls({
{focusFilters.cfi && (
<FilterToggle
icon={FileGenericIcon}
label="Selected chapter"
label="Clear filter: selected chapter"
description="Show annotations on selected book chapter(s). Press to clear this filter."
active={focusActive.has('cfi')}
disabled={hasSelection}
Expand Down
6 changes: 3 additions & 3 deletions src/sidebar/components/search/test/FilterControls-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ describe('FilterControls', () => {
display: 'Some User',
},
},
label: 'By Some User',
label: 'Clear filter: by author Some User',
},
{
filterType: 'page',
Expand All @@ -104,7 +104,7 @@ describe('FilterControls', () => {
display: '10-30',
},
},
label: 'Pages 10-30',
label: 'Clear filter: pages 10-30',
},
{
filterType: 'cfi',
Expand All @@ -113,7 +113,7 @@ describe('FilterControls', () => {
display: 'Chapter One',
},
},
label: 'Selected chapter',
label: 'Clear filter: selected chapter',
},
].forEach(({ filterType, focusFilters, label }) => {
it(`displays ${filterType} toggle if there is a ${filterType} focus filter configured`, () => {
Expand Down