From afc2335be9b1b0885bc89e0b223ca925b8586cd6 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?L=27=C3=A9lectron=20rare?=
<108685187+electron-rare@users.noreply.github.com>
Date: Sat, 30 May 2026 12:36:04 +0200
Subject: [PATCH 1/2] chore(admin): fix pre-existing lint errors (CI green)
Clear the 13 long-standing biome errors that kept CI red (failure on
main since before this work):
- CampaignControls.tsx: modal backdrops were clickable
s with no
keyboard path. Add Escape-to-close onKeyDown + tabIndex (a11y/
useKeyWithClickEvents), mirroring the existing click-to-close; inner
content gets matching keydown stopPropagation. Click behaviour
unchanged.
- CampaignStatusCard.tsx: drop the redundant `case 'IDLE'` that fell
through to default with identical output (noUselessSwitchCase).
- biome safe autofixes (whitespace / import ordering) elsewhere in admin.
No behaviour change; typecheck + builds still pass.
---
.../src/components/CampaignControls.tsx | 14 +++++++++-----
.../src/components/CampaignDomainGrid.tsx | 13 +++----------
.../src/components/CampaignStatusCard.tsx | 18 ++++--------------
.../src/hooks/useStartCampaign.ts | 3 +--
.../src/routes/training.campaign.tsx | 18 +++++-------------
5 files changed, 22 insertions(+), 44 deletions(-)
diff --git a/apps/cockpit-admin/src/components/CampaignControls.tsx b/apps/cockpit-admin/src/components/CampaignControls.tsx
index 2192e13..a56ca6a 100644
--- a/apps/cockpit-admin/src/components/CampaignControls.tsx
+++ b/apps/cockpit-admin/src/components/CampaignControls.tsx
@@ -110,15 +110,19 @@ export function CampaignControls({ status }: Props) {
)}
{startOpen && (
+ // biome-ignore lint/a11y/useSemanticElements: backdrop overlay closes the modal on outside click; a native