Files
streamdeck-go/cmd/streamdeck/folder_test.go
Levi Woodard 4158165410 Add folder support: keys that open sub-pages with a back key
A key with `folder: NAME` swaps the deck to the keys defined under
`folders.NAME`. Every folder shows a back key (slot 0 by default, drawn
with a built-in chevron) that pops back to the parent; folders nest.

The daemon now runs one page at a time: per-key setup moved into
setupKey(), openPage() draws a page under its own context, and
page.stop() tears it down before the next page is drawn (and on exit,
so device death no longer waits on uncancelled goroutines).

streamdeck-ctl gains `key set -folder`, reports kind "folder", lists
every folder in status, and refuses to `key press` a navigation-only
key. The Omarchy grid shows a folder glyph.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012ARLa4moGb154fzc9TevgV
2026-10-01 18:39:24 -06:00

31 lines
634 B
Go

package main
import (
"image/color"
"testing"
)
// The built-in back arrow must leave the label band (bottom third) untouched
// and actually draw something above it.
func TestBackArrowLayout(t *testing.T) {
img := backArrow(96, 96, color.White)
lit := 0
for y := 0; y < 64; y++ {
for x := 0; x < 96; x++ {
if r, _, _, _ := img.At(x, y).RGBA(); r > 0 {
lit++
}
}
}
if lit < 200 {
t.Errorf("arrow region has only %d lit pixels", lit)
}
for y := 72; y < 96; y++ {
for x := 0; x < 96; x++ {
if r, _, _, _ := img.At(x, y).RGBA(); r > 0 {
t.Fatalf("label band pixel (%d,%d) is lit", x, y)
}
}
}
}