Commit Graph
100 Commits
Author SHA1 Message Date
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 a93e475899 Fix double-close panic on DownloadDone channel
When transitioning from DOWNLOADING_ASSETS to READY, checkState()
re-navigates to HOME. The new Home page sees the already-closed
MessageChannel and tries to close DownloadDone again, causing a
panic that restarts the process.

Guard the close with a downloadDone bool field on Home.
2026-07-11 16:36:15 -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 2cc5071731 ci: trigger dev build on push 2026-07-11 11:42:17 -05:00
NeilClack bb132ceeaf fix: resolve 4 critical audio mixer bugs (v0.5)
- SwitchDevice volume silently zeroed: Init uses cfg.SavedVolume,
  SwitchDevice restores saved volume after reopening device
- SwitchDevice not persisted to database: caller saves SelectedAudioDevice
- Device restore passes invalid 'system default' to SDL: now passes ''
- Stop() no-op when audio toggled off: removed AudioEnabled guard

Regression tests added for all 4 bugs. CI now runs go test before build.
2026-07-11 11:39:58 -05:00
NeilClack 72910e7006 fix: prevent Play() deadlock when device is not open
Play() held mu then called SwitchDevice() which also tried to acquire mu,
causing a deadlock. Replace with direct call to openDeviceLocked() which
does not lock.

Add regression test that verifies Play() returns an error (not deadlock)
when called on an uninitialized mixer.
2026-07-11 10:16:15 -05:00
NeilClack 141613f571 Update version string to indicate audio-bug-fixes 2026-07-11 09:01:05 -05:00
NeilClack fca6354829 Create Docker build pipeline for MacOS 2026-07-10 17:12:48 -05:00
NeilClack 313db8ccd1 fix: rewrite cmd_diagnose to use script upload instead of nested SSH quoting 2026-07-10 16:02:02 -05:00
NeilClack b88caa291d feat: test VM build/run script with SSH diagnostics
- nixos/vm.nix: enable PasswordAuthentication for kiosk user (SSH test access)
- scripts/test-vm.sh: one-command build → start → diagnose workflow
  - macOS: builds and runs on remote Linux server, SSH through server
  - Linux: builds and runs locally
  - Commands: --build, --start, --stop, --diagnose, --shell
  - Diagnostics: NetworkManager, PipeWire, wpctl, ALSA, pactl, processes, logs
- AGENTS.md: compact agent guide for the repo
2026-07-10 15:37:32 -05:00
NeilClack 779bc77c5b fix: use recursiveUpdate instead of // to preserve packages.default
The // operator does shallow merge, so packages.x86_64-linux.test-vm
overwrote the entire packages.x86_64-linux attrset, losing the default
package. nixpkgs.lib.recursiveUpdate properly merges nested attrsets.
2026-07-10 14:18:47 -05:00
NeilClack 3e3c174032 feat: expose test-vm as a package output for remote building 2026-07-10 14:15:46 -05:00
NeilClack 68b3680e32 fix: make wayland/X11 buildInputs Linux-only for macOS dev shell
wayland, wayland-protocols, libxkbcommon, libdecor, libx11, libxext
are Linux-only and prevent nix develop from working on macOS.
2026-07-10 14:00:48 -05:00
NeilClack 9bc0fd6820 fix: restore SDL volume to MAX after device switch
Remove dead 'currentVolume' variable that was never written to, causing
SwitchDevice to always restore volume to 0 after switching audio devices.

- Remove currentVolume from package state
- SwitchDevice now sets mix.MAX_VOLUME after reopening device
- GetVolume128 now queries SDL directly instead of reading stale variable
- Fix parseSinkLine not stripping trailing ']' from [vol: X.XX] (caused
  volume to silently parse as 0 for sinks without MUTED tag)
- Fix flake.nix: make wayland/X11 buildInputs Linux-only for macOS compat
- Add unit tests for parseSinks, parseSinkLine, and ConvertVolume
- Add changelog.txt tracking all audio bug fixes
2026-07-10 14:00:33 -05:00
NeilClack 2bcb36669f fix: restore SDL volume to MAX after device switch
Remove dead 'currentVolume' variable that was never written to, causing
SwitchDevice to always restore volume to 0 after switching audio devices.

- Remove currentVolume from package state
- SwitchDevice now sets mix.MAX_VOLUME after reopening device
- GetVolume128 now queries SDL directly instead of reading stale variable
- Add unit tests for parseSinks, parseSinkLine, and ConvertVolume
- Add changelog.txt tracking all audio bug fixes
2026-07-10 13:56:06 -05:00
NeilClack e7041894ba Merge pull request 'Fix network connection timeouts and security detection' (#59) from wifi-fix-06-28-2026 into dev
Reviewed-on: https://codeberg.org/RhemaWave-Technologies/RhemaWave/pulls/59
2026-06-28 02:04:52 -05:00
NeilClack 193ebbcb27 Fix network connection timeouts and security detection
- Fixed detectSecurity() where WPA2 (0x100/PSK) and WPA3 (0x400/SAE)
  flags were swapped, causing NM to reject connections silently
- Added missing AP path to AddAndActivateConnection call
- Added critical connection settings: UUID, interface-name,
  autoconnect, permissions
- Changed init() to fail fast with logger.Fatal instead of
  silent failure on NM connection error
- Added auth-alg and psk-flags to WPA/WPA2 security settings
2026-06-28 01:56:35 -05:00
NeilClack 3bcfce2617 use logger instead of printf 2026-06-27 17:06:14 -05:00
NeilClack 8567cd5bdb add extra case to waitForConnection 2026-06-27 17:04:34 -05:00
NeilClack b0947bd594 Fix bugs in WiFi page 2026-06-27 16:51:18 -05:00
NeilClack 7e598f191f Update Network package 2026-06-27 16:01:33 -05:00
NeilClack ba39ed85a9 Remove wal and shm deletion 2026-06-27 15:09:51 -05:00
NeilClack 8ec1cbbc48 Log the app config in Debug 2026-06-27 14:50:50 -05:00
NeilClack 0b43a98298 Remove unused function in download package 2026-06-27 14:25:51 -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 fce5286d86 Add production workflow and clean up development workflow 2026-06-27 14:04:07 -05:00
NeilClack f00cb9efb6 Fix download progress and prevent re-downloading existing audio. 2026-06-27 13:59:22 -05:00
NeilClack 18c57c9101 Remove calls to RefreshConfig 2026-06-27 12:57:29 -05:00
NeilClack cc7917b549 add log statement to debug crash in dev system 2026-06-27 12:30:35 -05:00
NeilClack 9fc72e0094 Move noisy logs to debug 2026-06-27 12:30:23 -05:00
NeilClack ca18000c8e Update version string for validation 2026-06-27 01:47:06 -05:00
NeilClack 01b462fc74 Add visual queue to check updates are performed 2026-06-27 01:32:24 -05:00
NeilClack 91f3afd517 Potentially fixed text input on kiosk machine 2026-06-27 01:08:55 -05:00
NeilClack 2fac3ab6a8 Replace textInputSupported flag 2026-06-27 00:37:07 -05:00
NeilClack 57fe627ad0 Update workflow to run on pull_requests rather than pushes 2026-06-26 23:38:37 -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 6fd5ec919c fix(db): stabilize connection settings and explicitly define AppConfig table name
- Set SQL connection idle limit to 1 to reduce resource usage
- Explicitly define AppConfig table name to prevent GORM pluralization issues
2026-06-26 22:49:51 -05:00
NeilClack f03d56d7ad Update vendor directory 2026-06-26 18:41:01 -05:00
NeilClack fc5c1dfe6d Update network manager to utilize gonetworkmanager for an easier life... 2026-06-26 18:40:56 -05:00
NeilClack 4dd78b5ade Update version number for visual validation 2026-06-26 18:07:12 -05:00
NeilClack f7b793d88a Remove unnecessary log 2026-06-26 18:07:03 -05:00
NeilClack a1bc7e1c1e Properly color logs 2026-06-26 18:06:38 -05:00
NeilClack 61b0fbd779 Remove annoying log message 2026-06-26 18:06:27 -05:00
NeilClack bc6894b79a Update logger to handle concurrent writes 2026-06-26 18:06:19 -05:00
NeilClack 9beeeb12f4 Test a different API endpoint for KioskConfig trigger 2026-06-26 00:37:52 -05:00
NeilClack db9c5cf340 Add action item to trigger KioskConfig workflow 2026-06-26 00:01:06 -05:00
NeilClack 7515027704 Fix indentation in action flie 2026-06-25 14:30:17 -05:00
NeilClack 9939c956b5 Update email addresses... 2026-06-25 14:29:07 -05:00
NeilClack d54833fb50 Add test notification 2026-06-25 14:28:01 -05:00
NeilClack c72cdfd7fb Remove artifact upload 2026-06-25 14:23:49 -05:00
NeilClack 828f8e1f4a Add cp command back, and upload the entire result directory instead of just the binary 2026-06-25 14:20:28 -05:00
NeilClack a9b0351b92 Force logs from nix build 2026-06-25 14:18:20 -05:00
NeilClack d385840e8e change on back to push for testing 2026-06-25 14:15:38 -05:00
NeilClack 09cd53fd25 Modify nix build command to print out output paths so we can copy binaries 2026-06-25 14:14:51 -05:00
NeilClack 17dbb759bd Copy binary to home directory and upload artifact to Codeberg 2026-06-25 14:07:47 -05:00
NeilClack af13d9a56c Update "Build" step
Updated nix command to utilize the nix-daemon
2026-06-25 13:34:53 -05:00
NeilClack f899b046e4 Fix action file... 2026-06-25 13:16:38 -05:00
NeilClack 5d8fe4d5b7 Update build steps to host instructions 2026-06-25 13:15:23 -05:00
NeilClack 2115a135e9 Update Install Nix - Uses
From cachix/nix-ci-action@V26
To https://github.com/cachix/install-nix-action@v27
2026-06-25 13:05:54 -05:00
NeilClack 70acdc2db5 Update runner name 2026-06-25 12:46:57 -05:00
NeilClack b499e16961 Start automating builds. v1 2026-06-25 11:25:16 -05:00
NeilClack f8e75194e8 Update version hash for visual verification 2026-06-24 23:20:57 -05:00
NeilClack cd79a6ffa1 Rename package files for consistency 2026-06-24 23:18:52 -05:00
NeilClack 57500308b0 Handle locked database cases 2026-06-24 23:18:32 -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 a7f551ccca Add extensive logging to networking package 2026-06-24 21:32:14 -05:00
NeilClack 953d0d8bc9 Rewrite entire network package and update wifi page 2026-06-24 18:29:59 -05:00
NeilClack 2d2069fd63 Remove ownership commands 2026-06-24 15:11:58 -05:00
NeilClack d903deabea Remove audio.wav and audio directory creation 2026-06-24 15:06:45 -05:00
NeilClack cc2887d2a0 Update version text and add more download logs 2026-06-24 14:57:42 -05:00
NeilClack 970b8ebf09 Add verbose logging to download.DownloadAudioFiles 2026-06-24 14:50:13 -05:00
NeilClack b018a79ecf Create a fallback for wen no audio is selected 2026-06-24 14:22:48 -05:00
NeilClack 0a9a33b87b Fix download URL mismatch 2026-06-24 14:17:06 -05:00
NeilClack 732bd7c9a0 Update audio options page to display outputs 2026-06-23 13:52:44 -05:00
NeilClack 30dd5ffdcb Create objects for tracking audio devices 2026-06-23 11:22:21 -05:00
NeilClack 6f8cfbffee Migrate scroller page to arrow pointer navigation
Change ENTER and SPACE to perform the same actions, and also save on every update.
2026-06-19 09:44:55 -05:00
NeilClack 4cd24375cd Add audio features
- Downloads all audio files in the background
- Tracks overall progress of audio downloads, keeping "position" when
  returning
- Scroller dynamically switches between audio tracks based on the
  solfeggio frequency of the currently playing proclamations
- Removed audio tracks list from Audio Options page
- Honestly a whole host of other stuff I forgot to mention
2026-06-19 00:13:25 -05:00
NeilClack 5bd2b75267 Auto play audio based on solfeggio frequencies 2026-06-19 00:11:48 -05:00
NeilClack 9ee7e8021a Remove track list from AudioOptions 2026-06-18 23:01:11 -05:00
NeilClack 1c814f4abb Reset default volume to MAX 2026-06-18 22:51:17 -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 7ecb90b63b Downloads are working and the goroutine is reporting updates appropriately. 2026-06-18 21:28:16 -05:00
NeilClack 397d4c9f19 Block skipping setup screens 2026-06-18 16:12:24 -05:00
NeilClack b11afe22f0 remove file downloads 2026-06-18 15:49:29 -05:00
NeilClack d8a9f6881a create scaffold for loading screen 2026-06-18 15:49:20 -05:00
NeilClack 1a67b97804 un-mask wifi password 2026-06-18 15:49:05 -05:00
NeilClack 60815ba001 Track FirstRun 2026-06-18 15:39:37 -05:00
NeilClack a5f9780f41 Add download package 2026-06-18 15:39:30 -05:00
NeilClack 26e84a4d23 Refactored the Networking package. D0.1B 2026-06-18 11:46:46 -05:00
NeilClack fe5543d50d Audio downloads when necessary 2026-06-18 11:29:45 -05:00
NeilClack d121ffdaa8 Ready to implement a loading bar 2026-06-18 08:11:33 -05:00
NeilClack 6b48679537 Add database logic 2026-06-18 08:02:21 -05:00
NeilClack 74874f97c5 audio selection works 2026-06-17 00:46:56 -05:00
NeilClack 4b7d2c13d5 Rename audio devices to audio options 2026-06-11 19:44:20 -05:00
NeilClack ddab8e446c Update version for visual preference during beta phase 2026-06-03 11:21:28 -05:00