Skip to content

Commit 376dda8

Browse files
Refactor FilterControls labels
1 parent 6015629 commit 376dda8

2 files changed

Lines changed: 7 additions & 7 deletions

File tree

src/sidebar/components/search/FilterControls.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@ export default function FilterControls({
160160
<b>Filters</b>
161161
{hasSelection && (
162162
<FilterToggle
163-
label={`Remove ${selectedCount} selected annotation filter`}
163+
label={`Clear filter: ${selectedCount} selected`}
164164
description={`Show only the ${selectedCount} selected annotations. Press to clear this filter and show all annotations.`}
165165
active={true}
166166
setActive={() => store.clearSelection()}
@@ -170,7 +170,7 @@ export default function FilterControls({
170170
{focusFilters.user && (
171171
<FilterToggle
172172
icon={ProfileIcon}
173-
label={`By ${focusFilters.user.display}`}
173+
label={`Clear filter: by author ${focusFilters.user.display}`}
174174
description={`Show annotations by ${focusFilters.user.display}. Press to clear this filter.`}
175175
active={focusActive.has('user')}
176176
// When a selection exists, it replaces other filters.
@@ -182,7 +182,7 @@ export default function FilterControls({
182182
{focusFilters.page && (
183183
<FilterToggle
184184
icon={FileGenericIcon}
185-
label={`Pages ${focusFilters.page.display}`}
185+
label={`Clear filter: pages ${focusFilters.page.display}`}
186186
description={`Show annotations on pages ${focusFilters.page.display}. Press to clear this filter.`}
187187
active={focusActive.has('page')}
188188
disabled={hasSelection}
@@ -193,7 +193,7 @@ export default function FilterControls({
193193
{focusFilters.cfi && (
194194
<FilterToggle
195195
icon={FileGenericIcon}
196-
label="Selected chapter"
196+
label="Clear filter: selected chapter"
197197
description="Show annotations on selected book chapter(s). Press to clear this filter."
198198
active={focusActive.has('cfi')}
199199
disabled={hasSelection}

src/sidebar/components/search/test/FilterControls-test.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ describe('FilterControls', () => {
9595
display: 'Some User',
9696
},
9797
},
98-
label: 'By Some User',
98+
label: 'Clear filter: by author Some User',
9999
},
100100
{
101101
filterType: 'page',
@@ -104,7 +104,7 @@ describe('FilterControls', () => {
104104
display: '10-30',
105105
},
106106
},
107-
label: 'Pages 10-30',
107+
label: 'Clear filter: pages 10-30',
108108
},
109109
{
110110
filterType: 'cfi',
@@ -113,7 +113,7 @@ describe('FilterControls', () => {
113113
display: 'Chapter One',
114114
},
115115
},
116-
label: 'Selected chapter',
116+
label: 'Clear filter: selected chapter',
117117
},
118118
].forEach(({ filterType, focusFilters, label }) => {
119119
it(`displays ${filterType} toggle if there is a ${filterType} focus filter configured`, () => {

0 commit comments

Comments
 (0)