Checkpoint 3: deliver playable samples and complete native authoring workflows

This commit is contained in:
Emil
2026-09-18 04:29:41 +03:00
parent fad5eb4e55
commit d834cfad67
92 changed files with 8335 additions and 353 deletions
+28
View File
@@ -229,6 +229,34 @@ int main() {
declarative.layout(200, 100);
click(declarative, *declarative.find("run"));
check(action == 1 && declarative.find("run")->text == "Run", "layout reload lost callback");
const auto initial_height = declarative.find("run")->layout.height;
const auto invalid_patch =
ui::Json{{"id", "root"},
{"children",
ui::Json::array({{{"id", "run"}, {"layout", {{"height", 99}}}},
{{"id", "bad-label"}, {"kind", "label"}, {"text", 123}}})}};
rejected = false;
try {
declarative.apply_layout(invalid_patch);
} catch (...) {
rejected = true;
}
check(rejected && declarative.find("run")->layout.height == initial_height &&
!declarative.find("bad-label"),
"Layout validation must reject all changes before mutation");
rejected = false;
try {
declarative.apply_layout(
{{"id", "root"},
{"children",
ui::Json::array({{{"id", "new-parent"},
{"kind", "column"},
{"children", ui::Json::array({{{"id", "run"}}})}}})}});
} catch (...) {
rejected = true;
}
check(rejected && !declarative.find("new-parent"),
"Hot layout must not duplicate/reparent a retained widget ID");
std::cout << "UI: UTF-8, shaping, text/IME/clipboard, focus, transactions, "
"layout, clipping, docking OK\n";
return 0;