current state

This commit is contained in:
dimitar committed 2026-05-28 15:20:02 +02:00
1 parent 42b58b02bf
commit 152ef17610
115 files changed
+2922 -704

No files matched your search

+1 -1
View File
@@ -88,7 +88,7 @@ fal_panel_generation_retries_network_error :: proc(t: ^testing.T) {
client.max_retries = 3
panel := core.Panel{panel_id = "panel_1", panel_number = 1, description = "Hero jumps over a gap"}
img, err := adapters.generate_panel_image(client, cfg, panel, nil, "manga", "proj_1")
img, err := adapters.generate_panel_image(client, cfg, panel, nil, "manga", "proj_1", "", "")
defer delete(img.prompt)
testing.expect(t, shared.is_ok(err), "fal panel generation should eventually succeed")
+17 -22
View File
@@ -16,29 +16,25 @@ import "../src/ui"
@test
layout_constants_match_hardcoded_values :: proc(t: ^testing.T) {
testing.expect(t, shared.LAYOUT.sidebar_width == 282, "sidebar_width should match historical 282")
testing.expect(t, shared.LAYOUT.right_margin == 20, "right_margin should match historical 20")
testing.expect(t, shared.LAYOUT.sidebar_width == 260, "sidebar_width should match 260")
testing.expect(t, shared.LAYOUT.right_margin == 16, "right_margin should match 16")
testing.expect(t, shared.LAYOUT.min_main_width == 960, "min_main_width should match historical 960")
testing.expect(t, shared.LAYOUT.top_reserved_height == 252, "top_reserved_height should match historical 252")
testing.expect(t, shared.LAYOUT.min_lower_y == 450, "min_lower_y should match historical 450")
testing.expect(t, shared.LAYOUT.compact_height == 860, "compact_height should match historical 860")
testing.expect(t, shared.LAYOUT.compact_height == 720, "compact_height should match 720")
}
@test
compute_main_width_formula :: proc(t: ^testing.T) {
// 1920x1080 standard
w := shared.compute_main_width(1920)
testing.expect(t, w == 1618, fmt.tprintf("1920px screen: expected 1618, got %d", w))
testing.expect(t, w == 1644, fmt.tprintf("1920px screen: expected 1644, got %d", w))
// 1366x768 compact
w2 := shared.compute_main_width(1366)
testing.expect(t, w2 == 1064, fmt.tprintf("1366px screen: expected 1064, got %d", w2))
testing.expect(t, w2 == 1090, fmt.tprintf("1366px screen: expected 1090, got %d", w2))
// Ultrawide 2560x1440
w3 := shared.compute_main_width(2560)
testing.expect(t, w3 == 2258, fmt.tprintf("2560px screen: expected 2258, got %d", w3))
testing.expect(t, w3 == 2284, fmt.tprintf("2560px screen: expected 2284, got %d", w3))
// Minimum floor
w4 := shared.compute_main_width(1200)
testing.expect(t, w4 == 960, fmt.tprintf("narrow screen: expected 960 floor, got %d", w4))
}
@@ -60,28 +56,27 @@ compute_lower_y_formula :: proc(t: ^testing.T) {
@test
screen_profile_classification :: proc(t: ^testing.T) {
// Compact: height < 860
p1 := shared.screen_profile(1366, 768)
testing.expect(t, p1 == .Compact, "1366x768 should be Compact")
p1 := shared.breakpoint(1366, 768)
testing.expect(t, p1 == .Standard, "1366x768 should be Standard")
// Standard: height >= 860, width < 1920
p2 := shared.screen_profile(1440, 900)
p2 := shared.breakpoint(1440, 900)
testing.expect(t, p2 == .Standard, "1440x900 should be Standard")
// Wide: width >= 1920
p3 := shared.screen_profile(1920, 1080)
p3 := shared.breakpoint(1920, 1080)
testing.expect(t, p3 == .Wide, "1920x1080 should be Wide")
// Ultrawide
p4 := shared.screen_profile(2560, 1440)
p4 := shared.breakpoint(2560, 1440)
testing.expect(t, p4 == .Wide, "2560x1440 should be Wide")
p5 := shared.breakpoint(1280, 600)
testing.expect(t, p5 == .Compact, "1280x600 should be Compact")
}
@test
is_compact_helper :: proc(t: ^testing.T) {
testing.expect(t, shared.is_compact(768), "768px should be compact")
testing.expect(t, shared.is_compact(859), "859px should be compact")
testing.expect(t, !shared.is_compact(860), "860px should not be compact")
testing.expect(t, shared.is_compact(600), "600px should be compact")
testing.expect(t, shared.is_compact(719), "719px should be compact")
testing.expect(t, !shared.is_compact(720), "720px should not be compact")
testing.expect(t, !shared.is_compact(1080), "1080px should not be compact")
}