Skip to content

feat: add splash screen editor for B&W/grayscale radios - #153

Draft
pfeerick wants to merge 2 commits into
mainfrom
feature/splash-screen-editor
Draft

feat: add splash screen editor for B&W/grayscale radios#153
pfeerick wants to merge 2 commits into
mainfrom
feature/splash-screen-editor

Conversation

@pfeerick

@pfeerick pfeerick commented Aug 5, 2026

Copy link
Copy Markdown
Member

Summary

  • Adds a splash screen editor for B&W/grayscale radios (128x64 mono: X7/X9-Lite/Zorro-class; 212x64 grayscale: X9D/X9D+/X9E), reachable from the GitHub, Local file, and CloudBuild firmware tabs
  • Upload an image, preview it dithered (Floyd-Steinberg or plain threshold, fit/fill, invert) at the radio's real resolution, then save the patched firmware or flash it directly
  • shared/splash: isomorphic marker-search/RLE/pack codec ported from EdgeTX Companion's FirmwareInterface, verified against real released firmware and cross-checked against a verbatim copy of Companion's own RLE decoder
  • New patchFirmwareSplash/splashCapability/firmwareSplashInfo GraphQL operations, reusing the existing local-firmware registry so patched results flow into the existing flash/download machinery unchanged
  • CloudBuild tab support triggers a build via the same flow DownloadCloudbuildButton uses, then hands off to the same local-firmware editing path used by the other two tabs

Follow-up fixes

  • "Apply and continue" is now restricted to the Local file tab. From GitHub/CloudBuild, applying silently overwrote the original release/target selection with no easy way back, and if you didn't save first the edit was lost entirely (the local firmware registry isn't persisted to disk). Local file keeps the source on disk, so it's the only origin where re-selecting it is trivial.
  • Shows the currently-embedded splash screen, decoded from the firmware itself, before you replace it - not just a preview of the new image.
  • Fixed the 212x64 grayscale preview overflowing its container - it was using a fixed 3x zoom (636px) regardless of format; now it's format-aware (3x mono / 2x grayscale).
  • All three tabs now eagerly register real firmware before opening the editor, so splash capability (and the compressed-size limit shown in the UI) is derived from the actual firmware bytes rather than assumed from a static per-target table.

Screenshots

bw212
grayscale-x9dp2019-1-current-splash
grayscale-x9dp2019-2-dithered
bw128
mono-x7-1-current-splash
mono-x7-2-dithered

Test plan

  • Unit tests for the splash codec (marker search, RLE encode/decode, packing) - src/shared/splash/__tests__
  • Round-trip test against real X7 Access and X9D+2019 firmware downloaded from GitHub releases, confirming no bytes outside the splash payload change
  • Independent cross-check: compiled a standalone tool using a verbatim copy of Companion's RleBitmap class and confirmed it decodes patched firmware identically to this implementation
  • Unit tests for the build/fetch→register→edit flow per tab origin, including that "Apply and continue" is only offered for Local file (EditSplashButton.spec.tsx, MockedProvider/nock)
  • Live browser verification (Playwright) against the real dev server: uploaded real mono and grayscale firmware fixtures, confirmed the current-splash preview decodes and renders, and verified canvas sizing directly (384x192 for mono, 424x128 for grayscale) rather than just visually
  • yarn test:types, yarn lint, yarn fmt:check, full vitest suite all clean

Manual Tests

  • Loading a customised splash screen correctly shows the custom splash image (bw212)
  • Loading a customised splash screen correctly shows the custom splash image (bw128)
  • Customising, saving and flashing a custom splash screen works and radio boots (bw212 - x9d+2019)
  • Customising, saving and flashing a custom splash screen works and radio boots (bw128 - t14)

🤖 Generated with Claude Code

@pfeerick
pfeerick marked this pull request as draft August 5, 2026 11:45
@codecov

codecov Bot commented Aug 5, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 57.05645% with 213 lines in your changes missing coverage. Please review.
✅ Project coverage is 38.43%. Comparing base (9cbe78d) to head (7058069).

Files with missing lines Patch % Lines
.../renderer/components/splash/SplashEditorDialog.tsx 35.38% 35 Missing and 7 partials ⚠️
src/renderer/components/splash/imageProcessing.ts 6.06% 31 Missing ⚠️
src/shared/splash/codec.ts 69.89% 21 Missing and 7 partials ⚠️
src/shared/backend/graph/firmware/splash.ts 30.00% 21 Missing ⚠️
...rc/renderer/components/splash/EditSplashButton.tsx 70.31% 14 Missing and 5 partials ⚠️
...renderer/components/splash/SplashPreviewCanvas.tsx 0.00% 18 Missing ⚠️
...rc/renderer/components/splash/SplashUploadArea.tsx 40.90% 11 Missing and 2 partials ⚠️
src/renderer/hooks/useCloudbuildFirmwareBytes.ts 78.72% 7 Missing and 3 partials ⚠️
src/shared/splash/rle.ts 79.59% 10 Missing ⚠️
...c/renderer/components/firmware/saveFirmwareFile.ts 40.00% 4 Missing and 2 partials ⚠️
... and 4 more
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #153      +/-   ##
==========================================
+ Coverage   36.25%   38.43%   +2.18%     
==========================================
  Files         115      129      +14     
  Lines        4281     4769     +488     
  Branches     1034     1127      +93     
==========================================
+ Hits         1552     1833     +281     
- Misses       2523     2703     +180     
- Partials      206      233      +27     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@github-actions

github-actions Bot commented Aug 5, 2026

Copy link
Copy Markdown

EdgeTX Buddy has been automatically deployed to Cloudflare.
✅ Preview: https://1296fc1a.buddy-7a6.pages.dev
✅ Storybook: https://1296fc1a.buddy-7a6.pages.dev/storybook

pfeerick and others added 2 commits August 5, 2026 23:56
Lets users select firmware for X7/X9-Lite/Zorro-class (128x64 mono)
and X9D/X9D+/X9E (212x64 grayscale) radios from the Cloud, Local
file, or CloudBuild tabs, embed a custom splash image (dithered
preview with Floyd-Steinberg or plain threshold, fit/fill, invert),
and save the patched firmware or flash it directly.

- shared/splash: isomorphic marker-search/RLE/pack codec ported from
  EdgeTX Companion's FirmwareInterface, with unit tests plus a
  round-trip check against real released firmware and a cross-check
  against a verbatim copy of Companion's own RLE decoder
- new patchFirmwareSplash/splashCapability/firmwareSplashInfo GraphQL
  operations, reusing the existing local-firmware registry so patched
  results flow into the existing flash/download machinery unchanged
- CloudBuild tab support triggers a build via the same flow
  DownloadCloudbuildButton uses, then hands off to the same
  local-firmware editing path used by the other two tabs

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
…ayscale preview sizing

Applying from the GitHub/CloudBuild tabs silently overwrote the
original release/target selection with no easy way back, and doing
so without saving first meant losing the edit entirely (the local
firmware registry isn't persisted to disk). "Apply and continue" is
now only offered when editing from the Local file tab, where the
source stays on disk and is trivial to reselect.

All three tabs now eagerly register real firmware before opening the
editor, so the dialog always has real bytes to work with. This also
lets the dialog derive verified splash capability (and the
compressed-size ceiling) directly from those bytes instead of a
static per-target table, and adds a "current splash screen" preview
decoded from the firmware. Fixes the 212x64 grayscale preview
overflowing its container by using a format-aware zoom instead of a
fixed 3x.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant