fix: restart periodic keys on device page switch, render display output in UI grid

- daemon.go: call stopPeriodicKeys/startPeriodicKeys after page switch
  from device gesture and auto-switch (was missing, causing goroutines
  to never restart for the correct page)
- app.js: forward display output background to /api/render preview URL
- index.html: show preview image and text from display output when key
  has no configured background/icon/label
This commit is contained in:
Maksim Totmin
2026-06-17 11:12:00 +07:00
parent cb52e639f0
commit 14a3cec4a3
3 changed files with 22 additions and 12 deletions
+4 -2
View File
@@ -114,8 +114,9 @@ func Run(ctx context.Context, cfg *config.Config, opts RunOptions) error {
if a.Type == "page" {
asm.NotifyManualPage(a.Page)
}
for _, pm := range pageMgrs[1:] {
pm.ActivatePage(newPage)
for _, pm := range pageMgrs {
pm.stopPeriodicKeys()
pm.startPeriodicKeys()
}
web.BroadcastPageChange(newPage)
}
@@ -195,6 +196,7 @@ func Run(ctx context.Context, cfg *config.Config, opts RunOptions) error {
if err := pm.ActivatePage(page); err != nil {
slog.Warn("auto-switch: activate page", "error", err)
}
pm.stopPeriodicKeys()
pm.startPeriodicKeys()
}
web.BroadcastPageChange(page)