From 5883ab54f3f02687cce8a259586cef6099638bf8 Mon Sep 17 00:00:00 2001 From: Brian Love Date: Wed, 26 Aug 2026 12:35:46 -0700 Subject: [PATCH] refactor(website): one tabs implementation, shared by both homepage widgets MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The homepage had two tab widgets and only one implemented the pattern. `DemoShowcase` announced `role="tablist"` and `aria-selected` with no `aria-controls`, no roving tabindex, and no keyboard handling — worse than plain buttons, because the roles promise assistive technology a widget that then does not respond to arrow keys. It also had no tests at all. Extract `TabGroup` with the mechanics `MediumSwitcher` already got right — roving tabindex, arrow/Home/End keys, focus following selection, and active-pane-only mounting — and have both consume it. `MediumSwitcher` keeps only the medium semantics and its analytics, so `DemoShowcase` does not inherit a `cta_id` shape that means nothing for runtime tabs. `DemoShowcase` gains the six tests it never had, including the one that would have caught the original defect: arrow keys must move `document.activeElement`, not just `aria-selected`. All ten existing `MediumSwitcher` tests pass unchanged through the refactor, which is the regression signal that matters here. Active-pane-only now holds for this section too: it rendered one `