+ {/* The filter is usable before the list loads (no header shift). */}
+
+
+
+ setKeyword(e.target.value)}
+ className="pl-9 pr-9"
+ />
+ {!keyword && (
+
+ /
+
+ )}
+ {keyword && (
+
+ )}
+
+
+
{loading && (
{SKELETON_SECTIONS.map(({ cards, codenames }, section) => (
@@ -265,29 +297,6 @@ export default function OSList() {
-
-
-
- setKeyword(e.target.value)}
- className="pl-9 pr-9"
- />
- {keyword && (
-
- )}
-
-
-
{/* Mobile platform buttons - shown inline in content */}
{groups.map((group) => (
@@ -332,6 +341,7 @@ export default function OSList() {
className="list-none"
>
v.build === currentBuild || `${v.version}_${v.build}` === currentBuild
+ (v) =>
+ v.build === currentBuild || `${v.version}_${v.build}` === currentBuild,
);
const filteredVersions = versions.filter((v) =>
- `${v.version} ${v.build} ${v.name}`.toLowerCase().includes(filter.toLowerCase())
+ `${v.version} ${v.build} ${v.name}`
+ .toLowerCase()
+ .includes(filter.toLowerCase()),
);
const handleSelect = (os: OS) => {
@@ -66,7 +70,9 @@ export function VersionSwitcher({ currentOs }: { currentOs: string }) {
newParams.set("os", `${group}/${newTag}`);
// Strip basePath from pathname since router.push adds it automatically
- const pathWithoutBase = pathname.startsWith(basePath) ? pathname.slice(basePath.length) : pathname;
+ const pathWithoutBase = pathname.startsWith(basePath)
+ ? pathname.slice(basePath.length)
+ : pathname;
router.push(`${pathWithoutBase}?${newParams.toString()}`);
setOpen(false);
setFilter("");
@@ -79,6 +85,8 @@ export function VersionSwitcher({ currentOs }: { currentOs: string }) {
variant="outline"
role="combobox"
aria-expanded={open}
+ {...{ [VERSION_PICKER_ATTR]: "" }}
+ title="Switch version (v)"
className="justify-between min-w-[200px] font-mono"
>
{loading ? (
@@ -103,6 +111,14 @@ export function VersionSwitcher({ currentOs }: { currentOs: string }) {
placeholder="Filter versions..."
value={filter}
onChange={(e) => setFilter(e.target.value)}
+ autoFocus
+ onKeyDown={(e) => {
+ // Enter picks the first match, so "v 26.1 Enter" switches.
+ if (e.key === "Enter" && filteredVersions[0]) {
+ e.preventDefault();
+ handleSelect(filteredVersions[0]);
+ }
+ }}
className="h-8"
/>