Skip to content

fix(lighting): resolve dynamic lighting persistence on exit, startup reset, and reorganize effect cards - #2

Merged
0PeterAdel merged 1 commit into
mainfrom
fix/dynamic-lighting-persistence-and-ui
Oct 19, 2026
Merged

0PeterAdel merged 1 commit into
mainfrom
fix/dynamic-lighting-persistence-and-ui

Conversation

@0PeterAdel

Copy link
Copy Markdown
Owner

What changed?

  1. Dynamic Lighting Persistence in Root Daemon:

    • Moved the execution of software dynamic effects (sw_rainbow_flow, sw_cyberpunk_pulse, sw_matrix_rain, sw_cylon_scanner, sw_fire_ember, sw_police_strobe, sw_cpu_heatmap, sw_battery_fuel, sw_aurora) to a background daemon runner thread (DynamicEffectRunner in daemon/predatorsense_daemon.py).
    • The root daemon continues running active animations continuously even after the GUI is closed.
    • Dynamic effects communicate via IPC (set_dynamic_effect, stop_dynamic_effect, get_dynamic_effect).
    • GUI runs local UI visualizer simulation concurrently at 33 FPS without spamming the socket.
  2. Categorization & Two-Line Descriptive Effect Cards:

    • Global (General) Tab: Organized into 3 distinct sections:
      • Dynamic Animations (9 smart software modes)
      • Hardware Firmware (7 firmware modes, 0% CPU)
      • Static Color (1 solid color mode across 4 zones)
    • Area Tab: Organized into 3 distinct sections:
      • Custom & Algorithmic (Custom 4-Zone, Gradient Z1→Z4, Mirror Symmetry)
      • Gaming & Cyber (Cyberpunk 2077, Matrix Terminal, Predator Teal, Toxic Acid, Blood Moon)
      • Atmospheric & Nature (Vaporwave, Fire & Ice, Sunset Horizon, Arctic Frost, Rainbow, Deep Purple, Gold Dragon)
    • Each card in both tabs now features a clean two-line layout: bold title with icon + explanatory subtitle.
    • Clicking any card applies and activates the effect immediately.
  3. Resolved Startup Keyboard Reset to Default Static:

    • Added _isLoadingSettings guards across all color picker, slider, and theme event handlers.
    • Implemented SynchronizeActiveLightingModeOnStartup() to query the daemon's active dynamic effect or hardware mode upon startup, restoring UI state and card highlight without overwriting the running animation or resetting to default static cyan (#00F0FF).

Why?

  • When closing the GUI, software animations previously froze on their last frame because the C# Task running them was terminated with the GUI window.
  • The Global (17 effects) and Area (15 themes) tabs were flat and unstructured, mixing static, hardware, and dynamic modes without descriptive hints.
  • Opening the application previously triggered debounced change events during settings loading that forced the keyboard controller to reset to static cyan (#00F0FF).

How to review?

  1. Start the daemon: sudo systemctl restart predatorsense-daemon (or test with sudo python3 daemon/predatorsense_daemon.py).
  2. Launch GUI: dotnet run --project gui/PredatorSense.csproj.
  3. Switch to Global tab -> select a dynamic effect (e.g. Rainbow Flow or Cyberpunk Pulse). Confirm immediate activation.
  4. Close GUI -> observe keyboard lights continue animating seamlessly.
  5. Reopen GUI -> confirm keyboard keeps animating and does not reset to static cyan; the active card is highlighted.
  6. Check Global and Area tabs to inspect categorized sections and two-line cards.

🏷️ Type of Change

  • fix: Bug fix
  • style: Formatting or cosmetic changes
  • refactor: Code restructuring without behavior changes

✅ ShiftCore Engineering Checklist

  • Branch Naming: Branch follows type/short-task-name (fix/dynamic-lighting-persistence-and-ui).
  • Commit Messages: Commits follow type(scope): short message in lowercase.
  • Focused Scope: PR represents one logical task and changes only relevant files.
  • Local Build: Project builds cleanly (dotnet build gui/PredatorSense.csproj - 0 Errors).
  • No Secrets: Verified that no tokens, passwords, .env, or sensitive logs are included.
  • Attribution: Verified that author attribution headers and licenses are preserved.

@0PeterAdel
0PeterAdel merged commit 21b0438 into main Oct 19, 2026
3 checks passed
@0PeterAdel
0PeterAdel deleted the fix/dynamic-lighting-persistence-and-ui branch October 19, 2026 23:53
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