From d9f98709d2e194f5c50cf06756bb9425c1e2d8a3 Mon Sep 17 00:00:00 2001 From: David Montero Date: Sun, 31 May 2026 07:54:09 +0200 Subject: [PATCH] fix(examples): show STM32 boards in the gallery filter Add STM32 Blue Pill / Black Pill tabs to BOARD_TABS, and make getBoardFilter honor an explicit boardFilter before the boards[] check. The STM32 examples are authored with the multi-board boards[] format even when single-board, so they were all bucketed under "Multi-Board" and had no STM32 filter tab. Now they appear under their dedicated STM32 tabs (attiny85 single-board examples authored the same way get correctly bucketed too). Co-Authored-By: Claude Opus 4.7 --- frontend/src/components/examples/ExamplesGallery.tsx | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/frontend/src/components/examples/ExamplesGallery.tsx b/frontend/src/components/examples/ExamplesGallery.tsx index 8de4e064..c5f36d25 100644 --- a/frontend/src/components/examples/ExamplesGallery.tsx +++ b/frontend/src/components/examples/ExamplesGallery.tsx @@ -33,6 +33,8 @@ const BOARD_TABS: BoardTab[] = [ { id: 'esp32', label: 'ESP32 (Xtensa)', color: '#ffffff', bg: '#e77d11' }, { id: 'esp32-cam', label: 'ESP32-CAM', color: '#ffffff', bg: '#d35400' }, { id: 'esp32-c3', label: 'ESP32-C3 (RISC-V)', color: '#ffffff', bg: '#27ae60' }, + { id: 'stm32-bluepill', label: 'STM32 Blue Pill', color: '#ffffff', bg: '#0a7ea4' }, + { id: 'stm32-blackpill', label: 'STM32 Black Pill', color: '#ffffff', bg: '#2d3436' }, { id: 'attiny85', label: 'ATtiny85', color: '#ffffff', bg: '#5d4037' }, { id: 'multi', label: 'Multi-Board', color: '#ffffff', bg: '#7b2d8b' }, { id: 'analog', label: 'Analog', color: '#ffffff', bg: '#0ea5a5' }, @@ -40,8 +42,12 @@ const BOARD_TABS: BoardTab[] = [ ]; function getBoardFilter(example: ExampleProject): string { - if (example.boards) return 'multi'; + // An explicit boardFilter is the author's intent and wins — even for + // examples authored with the multi-board `boards[]` format (e.g. the STM32 + // single-board examples). Genuinely multi-board examples with no boardFilter + // still fall through to 'multi'. if ((example as any).boardFilter) return (example as any).boardFilter; + if (example.boards) return 'multi'; return example.boardType ?? 'arduino-uno'; }