fix(frontend): code-review polish — replaceState, arrow-key nav, TabId, comment

Fix 4: useHashTab navigate() uses history.replaceState instead of
window.location.hash assignment — no spurious history entries, no
anchor-jump scroll side-effect.
Fix 5: Tabs ArrowLeft/ArrowRight keyboard nav (WAI-ARIA tabs pattern).
Fix 6: TabId union type in EngagementDetailPage, cast from string for
type-safe switch on activeTab without breaking Tabs.onChange signature.
Fix 7: intentional comment on UsersAdminPage reset-password aerated row.
Tests: 236/236 (+2 arrow-key assertions in Tabs.test.tsx).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Knacky
2026-06-21 22:20:51 +02:00
parent 790ced4204
commit 11ce3cfb86
6 changed files with 36 additions and 4 deletions

View File

@@ -13,6 +13,8 @@ import { BackLink } from '@/components/BackLink';
import { Tabs } from '@/components/Tabs';
import { Link } from 'react-router-dom';
type TabId = 'schedule' | 'description' | 'simulations';
export function EngagementDetailPage(): JSX.Element {
const { id } = useParams<{ id: string }>();
const numericId = id ? Number(id) : undefined;
@@ -21,7 +23,8 @@ export function EngagementDetailPage(): JSX.Element {
const detail = useEngagement(numericId);
const simsQuery = useEngagementSimulations(numericId);
const [activeTab, setActiveTab] = useHashTab('schedule');
const [activeTabRaw, setActiveTab] = useHashTab('schedule');
const activeTab = activeTabRaw as TabId;
if (detail.isLoading) return <LoadingState label="Loading engagement…" />;
if (detail.isError) {