Files
breeze/tests/theme_catalog_link_behavior.zi
waozi 017d3565d3 Build on Ziran 0.5.0 and Kryon's namespaced widgets, with the Tao picture page
Pin only pushed commits, with no local overrides: Ziran v0.5.0
(f9f92b46), Kryon b45cc524 (one lock entry, ref master, shared with the
Css and Plot master edges), Apps 352901e, Entity b30dd4a and practices
893e5b6f, whose sharpened banners and regenerated Lumi guide clips the
narration check now matches.

The Library opens each Tao Te Ching chapter on its own picture page: the
chapter art and its title, centered together; the text pages follow.
The reader keeps the picture page across reflow, and a chapter start or
a Contents pick opens it. The 81 approved chapter pictures are included.

Breeze now uses Kryon's namespaced widgets (Text.Draw/Text.Props,
Button, Image, Modal.ActionModal, Layout, TabBar, LoadingScreen,
LoadingIndicator, Shape.Circle) instead of the removed Kryon/Widgets
facades. Hosted apps import std/text explicitly, since a short "text"
import now names Kryon's widget. AGENTS.md and the Text/Button API checks
describe the namespaced forms; two unused test doubles are removed.

Build fixes for the new toolchain: the bundle runtime carries Ziran's
instruction engine (no BOOTSTRAP=1) and takes the pinned host zi2c for
cross builds; the Apps controller's lock context has the manifest's
module roots; the app codec generator lists Kryon's raw modules only;
the package scripts read ZX revision 28 bundle assets. The Apps
controller digest matches the Apps 352901e build.

Also included: the stopped lanes' work in this tree (Radio download,
Photos install, Lists, Lumi, Habits shop rewards, astral exercise
selection, appearance and download recovery) and the raylib-free desktop
lane's host modules (app_trace, host_input, host_window, host_clock),
inactive unless DESKTOP_HOST is defined.

Not included: the crash-recovery lane's picture-window and storage
crash-safety changes, which that lane commits itself.

Local tests: zi-check (510 modules), native and Android source checks,
hosted app checks, build-laws, clean-text-api-check, button-api-check,
library-reader-test, library-ui-test, storage-crash-zi-test and
native-image-decode-test pass. The bundled Arcade is still ZX revision 26
and waits for an Arcade build on these pins.
2026-11-16 14:20:12 -03:00

60 lines
2.8 KiB
Ziran

#import, file "../src/app/theme_catalog.zi";
#import, file "../src/app/parent_theme.zi";
#program_export
Answer :: () -> s32 {
if ThemeCount != 13 || ThemeDefaultId != 9 ||
ThemeScopeFor(8, false) != "ink_light" ||
ThemeScopeFor(9, true) != "default_dark" { return 1 }
light := ThemeCatalogLoad(0, false)
if !light.complete || light.background != cast(u32)0xE2EEFCFF ||
light.circle != cast(u32)0x7EB7E6FF { return 2 }
dark := ThemeCatalogLoad(0, true)
if !dark.complete || dark.background != cast(u32)0x182838FF ||
dark.link != cast(u32)0x60A0D0FF { return 3 }
fallback := ThemeCatalogLoad(99, false)
if !fallback.complete || fallback.background != cast(u32)0xC0C0C0FF {
return 4
}
for id: 0..12 {
if !ThemeCatalogLoad(cast(s32)id, false).complete ||
!ThemeCatalogLoad(cast(s32)id, true).complete { return 6 }
}
if ThemeCatalogParse("", 0, false).complete { return 5 }
clean_dark := ThemeCatalogLoad(ThemeDefaultId, true)
clean_light := ThemeCatalogLoad(ThemeDefaultId, false)
if clean_dark.background != cast(u32)0x14202bff ||
clean_dark.button != cast(u32)0x99deb8ff ||
clean_light.background != cast(u32)0xf5f8f6ff ||
clean_light.button_ink != cast(u32)0x18352aff { return 7 }
// Started on its own, Inbe has no host theme and keeps its own.
if ParentThemeCurrent().active || ParentThemeRevision() != 0 { return 8 }
if ThemeCatalogLoad(0, false).background != light.background { return 9 }
// Embedded, a host's light or dark theme replaces the chosen one.
host_dark: ParentTheme
host_dark.active = true
host_dark.dark = true
host_dark.background = 0x101418ff
host_dark.surface = 0x1a2026ff
host_dark.text = 0xe8ecf0ff
host_dark.accent = 0x6ab0f0ff
host_dark.accent_hover = ParentThemeMix(0x6ab0f0ff, 0xe8ecf0ff, 0.12)
embedded := ThemeCatalogFromParent(host_dark)
if !embedded.complete || embedded.background != host_dark.background ||
embedded.surface != host_dark.surface || embedded.text != host_dark.text ||
embedded.button != host_dark.accent || embedded.circle != host_dark.accent ||
embedded.link != host_dark.accent || embedded.icon != host_dark.text { return 10 }
if embedded.button_hover != cast(u32)0x79b7f0ff { return 11 }
host_light: ParentTheme
host_light.active = true
host_light.background = 0xfbf1e2ff
host_light.surface = 0xe8dccaff
host_light.text = 0x302820ff
host_light.accent = 0x704020ff
light_embedded := ThemeCatalogFromParent(host_light)
if light_embedded.background != host_light.background ||
light_embedded.text != host_light.text { return 12 }
if ParentThemeSame(host_dark, host_light) || !ParentThemeSame(host_light, host_light) { return 13 }
return 42
}