feat(boards): unify homepage grid with flasher + clickable cards
Three changes, all from finally having working RAK4631 firmware and
noticing the homepage grid was hand-coded, stale, and disconnected from
the flasher.
1. RAK4631 display name. Silkscreen + RAK marketing call this module
'RAK4631'; 'WisBlock' is the ecosystem brand. The site was showing
'RAK WisBlock 4631', which matched neither the product name nor the
firmware commit message ('RAK4631 WisBlock bring-up'). It also
contradicted Uf2DownloadFlow.svelte, which already correctly told
users 'A USB drive named RAK4631 should appear'. Renamed to 'RAK4631
WisBlock' in boards.ts. Stable identifiers (board id, asset filename
pattern, driveName lookup) unchanged so v1.4.0 artifacts still
resolve.
2. Homepage grid is now data-driven from boards.ts. Previously a
hand-coded list that had silently drifted: missing the LilyGo T-Beam
classic, LilyGo T-Beam S3 Supreme, and the Heltec V3 UART variant.
Now maps over the same `boards` array the flasher uses, sorted
case-insensitively by display name. Adding a board in one place
updates both pages. `badgeText()` and `badgeColor()` lifted out of
BoardSelector.svelte into boards.ts so the label and accent color
have a single source of truth too.
3. Homepage cards are now links — clicking a card takes you to
/flash?board=<id> with that board pre-selected. Flasher.svelte reads
the param on mount and sets selectedBoard if the id resolves, so the
user lands on the version-picker step directly.
The flasher's BoardSelector keeps its richer UI (search filter,
MCU-family grouping) — only the simpler homepage grid was unified.
This commit is contained in:
4 files changed
+54
-54
No files matched your search
@@ -1,6 +1,6 @@
|
||||
<script lang="ts">
|
||||
import type { BoardDef } from "../lib/types";
|
||||
import { boards } from "../lib/boards";
|
||||
import { boards, badgeText, badgeColor } from "../lib/boards";
|
||||
|
||||
interface Props {
|
||||
selected: BoardDef | null;
|
||||
@@ -11,28 +11,6 @@
|
||||
|
||||
let query = $state("");
|
||||
|
||||
function badgeText(board: BoardDef): string {
|
||||
switch (board.flashMethod) {
|
||||
case "web-serial":
|
||||
return "Web Flash";
|
||||
case "uf2":
|
||||
return "UF2 Download";
|
||||
case "download-only":
|
||||
return "CLI Only";
|
||||
}
|
||||
}
|
||||
|
||||
function badgeColor(board: BoardDef): string {
|
||||
switch (board.flashMethod) {
|
||||
case "web-serial":
|
||||
return "text-accent";
|
||||
case "uf2":
|
||||
return "text-info";
|
||||
case "download-only":
|
||||
return "text-warn";
|
||||
}
|
||||
}
|
||||
|
||||
function matches(board: BoardDef, q: string): boolean {
|
||||
const needle = q.trim().toLowerCase();
|
||||
if (!needle) return true;
|
||||
|
||||
Reference in new issue
Block a user