Conversation
- Backend: emit scan:scanning_firmware socket event per firmware - Frontend: track and display firmware per platform in scan results - Frontend: add firmware stats chip to scan stats bar - Frontend: update empty state message to mention firmware - i18n: add firmware-related translation keys Co-authored-by: gantoine <[email protected]>
…ith a count Instead of emitting scan:scanning_firmware once per firmware file, emit a single event per platform after all firmware is processed, carrying only the firmware_count. Frontend tracks firmware_count (int) on each ScanningPlatform instead of a full firmware list. Co-authored-by: gantoine <[email protected]>
☂️ Python Coverage
Overall Coverage
New FilesNo new covered files... Modified Files
|
Greptile SummaryThis PR improves firmware discoverability during scans by surfacing firmware counts in the scan UI — addressing the UX issue where scanning BIOS files showed no feedback. The backend emits
Confidence Score: 3/5
Important Files Changed
Sequence DiagramsequenceDiagram
participant BE as Backend (scan.py)
participant SM as SocketManager
participant FE as ScanBtn.vue
participant ST as scanning store
participant SV as Scan.vue / ScanPlatform.vue
BE->>BE: identify_platform()
BE->>BE: scan firmware files (loop _identify_firmware)
BE->>SM: emit scan:scanning_platform<br/>{id, name, display_name, slug,<br/>fs_slug, is_identified, firmware_count}
SM->>FE: scan:scanning_platform event
FE->>ST: push ScanningPlatform {firmware_count}
ST->>SV: reactive update → show platform chip<br/>+ firmware count chip (if > 0)
BE->>SM: emit scan:update_stats<br/>{scanned_firmware, new_firmware, ...}
SM->>FE: scan:update_stats event
FE->>ST: setScanStats()
ST->>SV: update sticky stats bar firmware chip
BE->>BE: scan ROMs (loop _identify_rom)
BE->>SM: emit scan:scanning_rom per ROM
SM->>FE: scan:scanning_rom
FE->>ST: push ROM to platform.roms
ST->>SV: reactive update → show ROM list items
BE->>SM: emit scan:done
SM->>FE: scan:done → setScanning(false)
Last reviewed commit: e9ac44c |
| v-if="platform.roms.length === 0 && platform.firmware_count === 0" | ||
| class="text-center my-2" | ||
| > | ||
| {{ t("scan.no-new-roms") }} |
There was a problem hiding this comment.
no-new-roms locale string not updated to mention firmware
The PR description explicitly states: "Updated: no-new-roms → 'No new/changed ROMs or firmware found'", but the locale key no-new-roms was never actually changed in any locale file (e.g. en_US/scan.json still reads "No new/changed ROMs found"). The condition was correctly updated to roms.length === 0 && firmware_count === 0, meaning this message only appears when there is truly nothing found — yet it still says "ROMs" only, silently dropping the firmware mention.
| {{ t("scan.no-new-roms") }} | |
| {{ t("scan.no-new-roms-or-firmware") }} |
Either rename the key and update all locale files:
"no-new-roms-or-firmware": "No new/changed ROMs or firmware found"or update the existing no-new-roms string value in all locale files to include firmware.
| <v-chip | ||
| color="secondary" | ||
| size="small" | ||
| text-color="white" | ||
| class="ml-1 my-1" | ||
| > | ||
| <v-icon left> mdi-memory </v-icon> | ||
| <span v-if="xs" class="ml-2">{{ | ||
| t("scan.firmware-scanned-n", scanStats.scanned_firmware) | ||
| }}</span> | ||
| <span v-else class="ml-2">{{ | ||
| t("scan.firmware-scanned-with-details", { | ||
| n_scanned_firmware: scanStats.scanned_firmware, | ||
| n_new_firmware: scanStats.new_firmware, | ||
| }) | ||
| }}</span> | ||
| </v-chip> |
There was a problem hiding this comment.
Firmware chip always visible even when no firmware is present
The new firmware chip is unconditionally rendered whenever scanningPlatforms.length > 0, so every scan session will show "Firmware: 0 scanned, with 0 new" even for library setups that have no firmware at all. This differs from the per-platform chip in ScanPlatform.vue which is correctly guarded with v-if="platform.firmware_count > 0".
Consider adding a conditional to hide the chip when no firmware has been scanned:
| <v-chip | |
| color="secondary" | |
| size="small" | |
| text-color="white" | |
| class="ml-1 my-1" | |
| > | |
| <v-icon left> mdi-memory </v-icon> | |
| <span v-if="xs" class="ml-2">{{ | |
| t("scan.firmware-scanned-n", scanStats.scanned_firmware) | |
| }}</span> | |
| <span v-else class="ml-2">{{ | |
| t("scan.firmware-scanned-with-details", { | |
| n_scanned_firmware: scanStats.scanned_firmware, | |
| n_new_firmware: scanStats.new_firmware, | |
| }) | |
| }}</span> | |
| </v-chip> | |
| <v-chip | |
| v-if="scanStats.scanned_firmware > 0" | |
| color="secondary" | |
| size="small" | |
| text-color="white" | |
| class="ml-1 my-1" | |
| > | |
| <v-icon left> mdi-memory </v-icon> | |
| <span v-if="xs" class="ml-2">{{ | |
| t("scan.firmware-scanned-n", scanStats.scanned_firmware) | |
| }}</span> | |
| <span v-else class="ml-2">{{ | |
| t("scan.firmware-scanned-with-details", { | |
| n_scanned_firmware: scanStats.scanned_firmware, | |
| n_new_firmware: scanStats.new_firmware, | |
| }) | |
| }}</span> | |
| </v-chip> |
| await socket_manager.emit( | ||
| "scan:scanning_platform", | ||
| PlatformSchema.model_validate(platform).model_dump( | ||
| include={ | ||
| "id", | ||
| "name", | ||
| "display_name", | ||
| "slug", | ||
| "fs_slug", | ||
| "is_identified", | ||
| "firmware_count", | ||
| } | ||
| ), | ||
| ) |
There was a problem hiding this comment.
Platform UI feedback is delayed until all firmware is processed
The scan:scanning_platform event was moved from before firmware scanning to after. Previously, the platform appeared in the scan UI immediately upon discovery. Now it only appears once all firmware files for that platform have been identified.
For platforms with many firmware files (or slow I/O), this means there is no UI feedback for the platform during the entire firmware scanning phase — the progress spinner could appear stuck from the user's perspective. The PR description acknowledged a new scan:scanning_firmware event, but that was never implemented.
Consider emitting the platform event at its original position (before firmware), and then emitting a follow-up update event once the firmware count is known, or accepting the trade-off and documenting it in a code comment.
Scanning firmware showed "No new/changed roms found" even when BIOS files were successfully detected, giving users no feedback that anything happened.
Backend
scan:scanning_firmwaresocket event is emitted once per platform (only when firmware is present) after all firmware for that platform has been processed, carryingplatform_id,platform_fs_slug,platform_slug,platform_display_name, andfirmware_countFrontend store (
scanning.ts)ScanningPlatformFirmwareEventinterface for the socket event payloadScanningPlatformgains afirmware_count: numberfield alongsideromsScanBtn.vuescan:scanning_firmwareevents, setting the firmware count on the matching platformfirmware_count: 0ScanPlatform.vuemdi-memoryicon) added to the platform header when firmware is detectedScan.vuemdi-memory, secondary color) added to the sticky stats bari18n (
en_US,en_GB)firmware-found,firmware-scanned-n,firmware-scanned-with-detailsno-new-roms→ "No new/changed ROMs or firmware found"Original prompt
💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.