Persist CI Cargo caches and repair runtime regression coverage
Verify Tessera GUI / verify (push) Successful in 1m40s

This commit is contained in:
2026-10-23 22:35:00 +08:00
parent 7f77a4aa72
commit 864e57ce1f
9 changed files with 130 additions and 31 deletions
+7
View File
@@ -228,3 +228,10 @@ A waiting coroutine retains its evaluated operand and frames as managed edges; w
While a native tab drag is held over an overflow arrow area, the strip waits 350ms then reveals one hidden tab every 120ms, including in a compatible destination window. The preview scroll does not activate Pages or change business state. Drawing, hit testing and insertion gaps share the same transient visible range; release uses its full-order insertion index. Leaving the strip stops the timer; release, Escape, a new press or runtime generation change restores the normal active-tab-centered strip. A resize or changing tab count clamps the range. Native drag/mixed-DPI behavior still requires platform validation; application-exit lifecycle notifications remain unfinished.
CI regression fixtures use the published frame's session identity for input,
current Endor statement boundaries/type names and the retained runtime's actual
layout/paint pipeline. Failed first Console rendering discards unpublished Page
registrations through host-only cleanup, preventing the next successful query
from silently opening a previously failed pending render. Earlier ordinary
bindings remain live; explicit page.render can subsequently publish the Page.
+30 -21
View File
@@ -1505,7 +1505,7 @@ class Alternating: Column {
page=Page()
page.render(Alternating(0,0,RectBlock(120,60)))
"#;
let error = compile(source, "app.main", 1).unwrap_err();
let error = ReplSession::load(source, "app.main", 1, 1).err().unwrap();
assert!(
error.to_string().contains("did not converge (cycle)"),
"{error:#}"
@@ -1531,7 +1531,7 @@ class Invalid: TextBlock {
page=Page()
page.render(Invalid("invalid"))
"##;
let error = compile(source, "app.main", 1).unwrap_err();
let error = ReplSession::load(source, "app.main", 1, 1).err().unwrap();
assert!(error.to_string().contains("wrapHeight"), "{error:#}");
}
@@ -2231,7 +2231,7 @@ page.render(block)
);
session
.execute(
"cancelled=ui.after(ui,\"cancel\",0,first.apply) cancelled.cancel()",
"cancelled=ui.after(ui,\"cancel\",0,first.apply)\ncancelled.cancel()",
"app.main",
)
.unwrap();
@@ -2311,7 +2311,7 @@ page.render(block)
);
session
.execute(
"closing=ui.after(other,\"close\",0,action.apply) other.close()",
"closing=ui.after(other,\"close\",0,action.apply)\nother.close()",
"app.main",
)
.unwrap();
@@ -2351,7 +2351,7 @@ page.render(block)
session.execute("token.status()", "app.main").unwrap().value,
"\"cancelled\""
);
session.execute("broken=ui.after(ui,\"fail\",0,action.fail) later=ui.after(ui,\"later\",0,action.apply)","app.main").unwrap();
session.execute("broken=ui.after(ui,\"fail\",0,action.fail)\nlater=ui.after(ui,\"later\",0,action.apply)","app.main").unwrap();
assert!(session.poll_tasks().is_err());
assert!(session.is_faulted());
let globals = session.candidate.globals.unwrap();
@@ -2618,7 +2618,7 @@ page.render(block)
.vm
.dict_delete(globals, &Value::Text("other".into()))
.unwrap();
session.execute("nil", "app.main").unwrap();
session.execute("0", "app.main").unwrap();
session.candidate.vm.collect_cycles();
assert!(session.candidate.vm.upgrade(weak).unwrap().is_none());
// An externally retained old leaf Mount must not retain the window context.
@@ -2694,7 +2694,7 @@ page.render(block)
assert!(initial.frame.tabs[1].active);
let input = crate::events::Input {
window: crate::window::MAIN_WINDOW,
session: 120,
session: initial.frame.session,
layout_version: initial.frame.layout_version,
mount: initial.frame.tabs[0].id,
kind: "tab-activate".into(),
@@ -2724,7 +2724,7 @@ page.render(block)
let closed = session
.dispatch(&crate::events::Input {
window: crate::window::MAIN_WINDOW,
session: 120,
session: renamed.frame.session,
layout_version: renamed.frame.layout_version,
mount: renamed.frame.tabs[1].id,
kind: "tab-close".into(),
@@ -2892,11 +2892,7 @@ page.render(block)
page = Page()
page.render(BadRect(80,20,0,"#DDEEFF"))"##;
let error = ReplSession::load(source, "app.main", 114, 1).err().unwrap();
assert!(
error
.to_string()
.contains("window operations are forbidden")
);
assert!(error.to_string().contains("read-only"));
}
fn source_measure_stat(session: &mut ReplSession, name: &str) -> i64 {
@@ -3240,7 +3236,7 @@ page.render(block)
(
"return MeasureResult(parent.block.metrics.width, 60)",
"return Point(0,0)",
"wrong result type",
"measure return expects MeasureResult",
),
(
"positions.children.at(0).x = self.metrics.left",
@@ -3278,7 +3274,7 @@ page.render(block)
session
.dispatch(&crate::events::Input {
window: crate::window::MAIN_WINDOW,
session: 81,
session: initial.frame.session,
layout_version: initial.frame.layout_version,
mount: circle.id,
kind: "click".into(),
@@ -3306,7 +3302,7 @@ page.render(block)
#[test]
fn source_hit_rejects_wrong_result_and_business_writes_before_callbacks() {
for (body, message) in [
("return 1", "hitTest must return Bool"),
("return 1", "hitTest return expects Bool"),
(
"self.hits.increment()\nreturn point.inCircle(40, 40, 40)",
"read-only",
@@ -3324,7 +3320,7 @@ page.render(block)
let error = session
.dispatch(&crate::events::Input {
window: crate::window::MAIN_WINDOW,
session: 82,
session: initial.frame.session,
layout_version: initial.frame.layout_version,
mount: circle.id,
kind: "click".into(),
@@ -4203,7 +4199,7 @@ page.render(block)
session
.dispatch(&crate::events::Input {
window: crate::window::MAIN_WINDOW,
session: 41,
session: document.frame.session,
layout_version: document.frame.layout_version,
mount: mount.id,
kind: "click".into(),
@@ -4672,7 +4668,7 @@ page.render(block)
assert!(!session.is_faulted());
assert_eq!(
session.execute("token.status()", "app.main").unwrap().value,
"pending"
"\"pending\""
);
assert_eq!(source_measure_stat(&mut session, "layoutCancels"), 1);
}
@@ -5816,7 +5812,7 @@ returned = button.dispatch(dispatched)"#,
let mut session = ReplSession::new(233).unwrap();
session
.execute(
"rect = RectBlock(40, 20)\nroot = ColumnBlock(0, 0, rect)",
"rect = RectBlock(40, 20)\nroot = Column(0, 0, rect)",
"app.main",
)
.unwrap();
@@ -5881,7 +5877,7 @@ returned = button.dispatch(dispatched)"#,
"function present(self: WrongResult, window: Window): Number { marker.increment() return 7 }",
),
] {
let input = format!("class {name} {{ {method} }} ui.implement({name}, Presentable)");
let input = format!("class {name} {{ {method} }}\nui.implement({name}, Presentable)");
let error = session
.execute(&input, "app.main")
.err()
@@ -6398,6 +6394,19 @@ returned = button.dispatch(dispatched)"#,
let retained = session.execute("value", "app.main").unwrap();
assert_eq!(retained.value, "3");
assert!(retained.document.is_none());
// Failed publication leaves the Page/bindings usable, but it can only
// become visible through a later successful explicit render.
let recovered = session
.execute("page.render(ui.text(\"recovered\"))", "app.main")
.unwrap()
.document
.unwrap();
assert!(recovered.frame.commands.iter().any(|command| matches!(
command, RenderCommand::Text { value, .. } if value == "recovered"
)));
assert!(recovered.frame.commands.iter().all(|command| !matches!(
command, RenderCommand::Text { value, .. } if value == "discarded"
)));
session.execute("function local(value: Number): Number { result = value result = 42 return result }", "app.main").unwrap();
assert_eq!(
session.execute("local(40)", "app.main").unwrap().value,
+8
View File
@@ -2330,6 +2330,14 @@ impl UiBridge {
.map_err(|_| anyhow::anyhow!("UI session poisoned"))?;
for presentation in state.presentations.values_mut() {
let window = object(Some(&vm.get_attr(presentation.desktop, "window")?))?;
// A failed first render must not become visible on the next input
// merely because show() already registered its Page with the Window.
if presentation.active.is_none() && presentation.last_tabs.is_empty() {
let unpublished = crate::window::pages(vm.object_store(), window)?.to_vec();
for page in unpublished {
crate::window::unregister_page_host(vm, window, page)?;
}
}
let pages = crate::window::pages(vm.object_store(), window)?;
let next = if presentation.closing {
None
+15
View File
@@ -275,6 +275,21 @@ pub fn unregister_page(
cx.replace_payload(window, data)?;
Ok(())
}
/// Discard an unpublished Page registration without invoking guest callbacks.
pub fn unregister_page_host(
vm: &mut Vm,
window: ObjectRef,
page: ObjectRef,
) -> Result<(), VmError> {
let mut data = vm.payload::<ManagedWindow>(window, "Window")?.clone();
if data.pages.contains(&page) {
data.pages.retain(|value| *value != page);
vm.dict_delete(data.tabs, &Value::Text(page.to_string()))?;
vm.replace_payload(window, data)?;
}
Ok(())
}
pub fn move_page(
cx: &mut NativeContext<'_>,
window: ObjectRef,