Commit Graph
35 Commits
Author SHA1 Message Date
NeilClack 11b25227d7 Rename app to radiantwave: embed and provision assets, drop proclamations 2026-08-03 01:54:27 -05:00
NeilClack 91711eef93 Replace AudioFile with AudioTrack, fix download+orphan+MD5 sync, always play original audio fallback
AudioTrack table replaces AudioFile (Filename, Name, AssignedFrequency,
MD5, Selected, Order) — fixes relative-path bug in scrollerPage.go that
caused "file not found" for single-track selection.

Download goroutine now:
  - Accepts *gorm.DB and updates AudioTrack.MD5 after each download.
  - Treats checksums.md5 as source of truth: removes local files and DB
    records not in the manifest (orphans).
  - Strips "./" prefix from manifest filenames (GNU md5sum format).

AudioOptions.go seeds 14 AudioTrack records matching server checksums.md5.
List background quad width matches the widest item (+ padding), centered.

scrollerPage.go switchAudioForFrequency falls back to original/selected
audio when a frequency has no matching track or file.  playOriginalAudio
is a no-op on repeat calls to avoid 5-second audio restart loop.

Fixes progress display: passes Max=0 during downloads so Home page shows
"x / X Files Downloaded" text instead of bogus "100.0%" percentage.

Downstream audio switching (DynamicAudio) verifies an AudioTrack exists
for the frequency before assigning it to a stream — frequencies without
a track (e.g. 528 Hz) gracefully use original audio instead.
2026-07-29 16:19:15 -05:00
NeilClack cbb10ecda3 Merge remote-tracking branch 'origin/main' into dev
# Conflicts:
#	internal/mixer/mixer.go
#	internal/page/home.go
2026-07-11 17:46:50 -05:00
NeilClack 2ef826fe63 Fix double-close panic on DownloadDone: skip re-navigation between HOME-mapped states
Primary fix: checkState() now detects when both old and new states map
to the HOME page (DOWNLOADING_ASSETS and READY) and skips re-navigation.
This prevents destroying and recreating the Home page, which would
close the already-closed DownloadDone channel.

Defense-in-depth: Home.downloadDone flag prevents close if a new Home
page somehow reaches the close path.

12 application tests, 4 page tests, 18 mixer tests (34 total).
Tests cover: prerequisite priority ordering, state blocking on
downloads, non-blocking channel read, double-close guard, download
failure path, and repeated computeState calls.
2026-07-11 16:43:16 -05:00
NeilClack 336f407499 Allow F2/F3 during DOWNLOADING_ASSETS state
F2 (scroller) and F3 (settings) now work while audio downloads are in
progress. Only blocked during early prerequisites: no wifi, no email,
no license key.
2026-07-11 15:27:01 -05:00
NeilClack 363e6f81f6 Fix CI: extract computeState() for testability; make network init non-fatal
network.init() no longer panics when D-Bus is unavailable (logs warning
instead). This allows go test to run in the nix build sandbox.

checkState() now calls computeState() which returns the target state
without triggering page navigation (which requires OpenGL). Tests call
computeState() directly, avoiding the SIGSEGV from gl.GenVertexArrays.

7 regression tests for state machine, all passing.
2026-07-11 14:42:49 -05:00
NeilClack 3f8144a708 Gate READY on download completion; move audio to ~/.radiantwave/audio
State machine now uses DOWNLOADING_ASSETS before READY. Downloads closing
the DownloadDone channel signals checkState() to proceed. Download failure
sets downloadFailed flag which prevents READY. Audio files moved from
~/.local/share/rhemawave/audio to ~/.radiantwave/audio/.

Regression tests in application_test.go (linux build-tagged due to
network package D-Bus init). Version 0.6.
2026-07-11 13:43:05 -05:00
NeilClack ff975aaf23 Reduce log level to INFO 2026-06-28 15:06:35 -05:00
NeilClack 46a00d2ad8 Remove config print 2026-06-28 15:06:06 -05:00
NeilClack 8ec1cbbc48 Log the app config in Debug 2026-06-27 14:50:50 -05:00
NeilClack 2c88b7ffc5 Add creation of audio directory and remove unused function in download package 2026-06-27 14:25:25 -05:00
NeilClack f00cb9efb6 Fix download progress and prevent re-downloading existing audio. 2026-06-27 13:59:22 -05:00
NeilClack 01b462fc74 Add visual queue to check updates are performed 2026-06-27 01:32:24 -05:00
NeilClack 3ef8f3db92 Resolve empty config issue 2026-06-26 23:35:29 -05:00
NeilClack 6274687fe8 Fix loading empty config 2026-06-26 23:21:05 -05:00
NeilClack 2735af5fbb refactor: remove cached AppConfig pointer and read configuration directly from DB
Replace in-memory atomic AppConfig caching with direct DB queries via db.GetConfig
across application and page layers. This simplifies state management and ensures
all components always operate on the latest persisted configuration.

Key changes:
- Remove Application.Config atomic cache and refreshCache mechanism
- Eliminate PageCtx.CfgPtr and pass DB handle instead
- Replace all cfg reads with db.GetConfig(app.DB)
- Update mixer, audio, UI pages, and initialization paths accordingly
- Explicitly set AppConfig table name to avoid GORM pluralization issues
- Reduce DB connection pooling (SetMaxIdleConns(1))
- Standardize application font to SpaceMonoNerdFont-Regular
- Lower default audio volume (1.0 → 0.2)
- Add Unicode checkmark glyph to font map

Behavioral impact:
- Configuration is no longer cached in memory
- Every config access now hits the DB (more consistent, slightly more overhead)
2026-06-26 22:51:32 -05:00
NeilClack fc5c1dfe6d Update network manager to utilize gonetworkmanager for an easier life... 2026-06-26 18:40:56 -05:00
NeilClack a4eff17b77 fix(network): fix wifi page never scanning, never exiting, and UI freezes on connect
WiFiSetupPage never showed networks and could not be exited once entered.
Several compounding bugs were responsible across network.go and page.go.

Primary bugs fixed:

- WiFiSetupPage.Init() never assigned p.wifiDevice after FindDevices(),
  so startScan() always hit the nil guard and exited without launching
  a scan goroutine. No networks ever appeared in the list. A value copy
  of the Wi-Fi device is now taken from m.Devices immediately after
  FindDevices() returns, with an explicit error if no adapter is found.

- CheckInternetConnection() called FindDevices() on every tick, rebuilding
  m.Devices every 2 seconds. This caused [NET-030] log spam, invalidated
  any pointers held into the slice, and meant checkState()'s fresh Manager
  instances (which have an empty Devices slice) would never detect internet
  after Fix 2 was applied. CheckInternetConnection() now calls FindDevices()
  only when m.Devices is empty (fresh Manager), and does a cheaper per-device
  State property refresh when devices are already known (long-lived Manager).
  This satisfies both callers correctly.

- Connect() called WaitForInternet(30s, 5s) synchronously before returning,
  blocking the main UI thread for up to 35 seconds. It also returned an error
  if internet wasn't stable in time, even though AddAndActivateConnection had
  succeeded, causing the page to show "Failed to initiate connection" while NM
  was still negotiating in the background. WaitForInternet removed from
  Connect(); the page's existing checkConnectionStatusLoop and
  handleConnectionStatusUpdate already handle post-connection state tracking.

Additional bugs fixed:

- startScan() launched a new StartScan goroutine on every R-press without
  signalling the previous one to stop. Concurrent goroutines raced on
  resultsChan and accumulated indefinitely. stopScan is now closed and
  replaced before each scan, and checkConnectionStatusLoop is restarted
  with the new channel.

- Connect() always generated a new UUID and called AddAndActivateConnection
  without checking for an existing profile. Repeated connection attempts
  (e.g. wrong password then correct) accumulated duplicate stale profiles
  in NetworkManager. Existing profiles matching the SSID are now deleted
  via Settings.Connection.Delete before creating a new one.

- m.Devices was read and written concurrently from StartScan and
  CheckInternetConnection goroutines without synchronisation. A sync.RWMutex
  is added to Manager; state refreshes take a write lock, StartScan device
  lookup takes a read lock.

- Connect() checked wifiDevice.State using the caller's value copy taken at
  Init() time, which never updated. The current state is now read from
  m.Devices under lock at the point of connection.

- auth-alg: "open" was unconditionally set in the 802-11-wireless-security
  settings block. This field is only meaningful for WPA/WPA2-Personal and
  should be omitted for SAE (WPA3) and EAP variants. It is now only set
  when KeyMgmt is "wpa-psk".
2026-06-24 22:41:48 -05:00
NeilClack ac86864c72 Add downloading message to home screen.
Download files in the background and keep track of progress.
2026-06-18 22:43:47 -05:00
NeilClack 2af1aae885 Audio files download on application start. Home screen shows status message 2026-06-18 21:52:29 -05:00
NeilClack 397d4c9f19 Block skipping setup screens 2026-06-18 16:12:24 -05:00
NeilClack 74874f97c5 audio selection works 2026-06-17 00:46:56 -05:00
NeilClack 0ebc3adf4a Proclamations change colors! 2026-05-31 12:08:19 -05:00
NeilClack 3ea32e0eaa Add volume changing logic 2026-05-14 09:57:13 -05:00
NeilClack b6bf0f1873 Sync proclamations when entering proclamation list 2026-04-23 17:29:20 -05:00
NeilClack 95647334ee Add message page for displaying errors 2026-03-30 09:58:00 -05:00
NeilClack aea646f788 Set default volume to MAX
Set MAX volume for SDL2 Mixer, as well as the volume for all audio sinks via wpctl to 1.0.
This forces the computer to always be at absolute max volume, without creating scripts on the machine to run wpctl commands. Leaving the display or connected speakers to be in full control over the volume of music.
2026-03-30 00:08:52 -05:00
NeilClack 6e28b90ee8 Add wifi, license and email checks 2026-03-29 23:41:16 -05:00
NeilClack 205b068fbf Fix audio bug 2026-03-25 17:17:22 -05:00
NeilClack 57691e6b68 Fix font scaling issue 2026-03-25 13:53:05 -05:00
NeilClack 8d23841391 Pull Proclamations & Categories from API and store them in the database 2026-03-23 17:35:52 -05:00
NeilClack 17c088cc2f Update Database
Database is more usable now.
All pages have been updated to use the database, and share an application configuration.
Page Stack has been removed, no more pages hanging around in memory. Replaced with a 'Router' which uses an Enum to determine which page should be displayed, destroys the old page and initializes the new page all in one go. No more push, pop, rollback, etc. No more holding instances of pages.
Logger has been updated with proper timestamps and sorting now works as expected."
2026-03-23 15:02:07 -05:00
NeilClackandClaude Opus 4.6 df5e64d38a Fix text input on kiosk: add keycodeToChar fallback for email/license pages
The kiosk lacks an input method framework, so SDL2 never generates
TextInputEvent. The WiFi password page already had a keycodeToChar
fallback but email and license key pages did not — characters were
never appended to inputText. Also removes excessive debug logging
from the previous commit.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-13 19:27:28 -05:00
NeilClack 8b0cf81e85 Add input logging 2026-03-13 19:07:34 -05:00
NeilClack 403ec4db89 Initial release: RadiantWave v1.0 2026-03-12 08:05:10 -05:00