Skip to content

Commit 20ad533

Browse files
authored
refactor: clarify show notifications setting (#948)
1 parent 08c7281 commit 20ad533

File tree

3 files changed

+29
-30
lines changed

3 files changed

+29
-30
lines changed

src/routes/Settings.test.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,7 @@ describe('routes/Settings.tsx', () => {
203203
getByLabelText = getByLabelTextLocal;
204204
});
205205

206-
fireEvent.click(getByLabelText('Show notifications'), {
206+
fireEvent.click(getByLabelText('Show system notifications'), {
207207
target: { checked: true },
208208
});
209209

src/routes/Settings.tsx

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -148,15 +148,6 @@ export const SettingsRoute: React.FC = () => {
148148
updateSetting('participating', evt.target.checked)
149149
}
150150
/>
151-
152-
<FieldCheckbox
153-
name="showNotifications"
154-
label="Show notifications"
155-
checked={settings.showNotifications}
156-
onChange={(evt) =>
157-
updateSetting('showNotifications', evt.target.checked)
158-
}
159-
/>
160151
<FieldCheckbox
161152
name="showBots"
162153
label="Show notifications from Bot accounts"
@@ -177,6 +168,14 @@ export const SettingsRoute: React.FC = () => {
177168
<legend id="system" className="font-semibold mt-2 mb-1">
178169
System
179170
</legend>
171+
<FieldCheckbox
172+
name="showNotifications"
173+
label="Show system notifications"
174+
checked={settings.showNotifications}
175+
onChange={(evt) =>
176+
updateSetting('showNotifications', evt.target.checked)
177+
}
178+
/>
180179
<FieldCheckbox
181180
name="playSound"
182181
label="Play sound"

src/routes/__snapshots__/Settings.test.tsx.snap

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -212,7 +212,7 @@ exports[`routes/Settings.tsx should render itself & its children 1`] = `
212212
<input
213213
checked=""
214214
class="focus:ring-indigo-500 h-4 w-4 text-indigo-600 border-gray-300 rounded"
215-
id="showNotifications"
215+
id="showBots"
216216
type="checkbox"
217217
/>
218218
</div>
@@ -221,9 +221,9 @@ exports[`routes/Settings.tsx should render itself & its children 1`] = `
221221
>
222222
<label
223223
class="font-medium text-gray-700 dark:text-gray-200"
224-
for="showNotifications"
224+
for="showBots"
225225
>
226-
Show notifications
226+
Show notifications from Bot accounts
227227
</label>
228228
</div>
229229
</div>
@@ -234,9 +234,8 @@ exports[`routes/Settings.tsx should render itself & its children 1`] = `
234234
class="flex items-center h-5"
235235
>
236236
<input
237-
checked=""
238237
class="focus:ring-indigo-500 h-4 w-4 text-indigo-600 border-gray-300 rounded"
239-
id="showBots"
238+
id="markAsDoneOnOpen"
240239
type="checkbox"
241240
/>
242241
</div>
@@ -245,21 +244,32 @@ exports[`routes/Settings.tsx should render itself & its children 1`] = `
245244
>
246245
<label
247246
class="font-medium text-gray-700 dark:text-gray-200"
248-
for="showBots"
247+
for="markAsDoneOnOpen"
249248
>
250-
Show notifications from Bot accounts
249+
Mark as done on open
251250
</label>
252251
</div>
253252
</div>
253+
</fieldset>
254+
<fieldset
255+
class="mb-3"
256+
>
257+
<legend
258+
class="font-semibold mt-2 mb-1"
259+
id="system"
260+
>
261+
System
262+
</legend>
254263
<div
255264
class="flex items-start mt-1 mb-3"
256265
>
257266
<div
258267
class="flex items-center h-5"
259268
>
260269
<input
270+
checked=""
261271
class="focus:ring-indigo-500 h-4 w-4 text-indigo-600 border-gray-300 rounded"
262-
id="markAsDoneOnOpen"
272+
id="showNotifications"
263273
type="checkbox"
264274
/>
265275
</div>
@@ -268,22 +278,12 @@ exports[`routes/Settings.tsx should render itself & its children 1`] = `
268278
>
269279
<label
270280
class="font-medium text-gray-700 dark:text-gray-200"
271-
for="markAsDoneOnOpen"
281+
for="showNotifications"
272282
>
273-
Mark as done on open
283+
Show system notifications
274284
</label>
275285
</div>
276286
</div>
277-
</fieldset>
278-
<fieldset
279-
class="mb-3"
280-
>
281-
<legend
282-
class="font-semibold mt-2 mb-1"
283-
id="system"
284-
>
285-
System
286-
</legend>
287287
<div
288288
class="flex items-start mt-1 mb-3"
289289
>

0 commit comments

Comments
 (0)