Skip to content
7 changes: 6 additions & 1 deletion scripts/course/course.toml
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,12 @@ label = "1.4"
slug = "a-work-orders-day"
title = "Work orders — make this many of that, this way"
one_line = "Released to the floor, station to station; its good count is the last step's, not the sum."
scene = "scripts/scenes/04-work-orders-and-routings.toml"
outcomes = [
"Say what a work order is: this many of a material, made along its routing, from release to finish.",
"Create and release an order on the Orders page, and find it in the first machine's queue on its station screen.",
"Read an order's count as its last step's, and say why it stays open past its number until a person finishes it.",
]
scene = "scripts/scenes/course/02-04-a-work-orders-day.toml"

# ------------------------------------------------------------------ tier 2
[[module]]
Expand Down
16 changes: 11 additions & 5 deletions scripts/record-scene.py
Original file line number Diff line number Diff line change
Expand Up @@ -677,11 +677,17 @@ def clear_of_caption(self, selector: str) -> None:
pressed. When the thing is under the bar, room is added once below the
page's last row and the thing is put in the middle of the window. A
thing already clear is left where it is, so no other take moves.

The thing is found the way the click will find it, by Playwright's
own locator: a scene's selector may say `:has-text("Release")`, which
`document.querySelector` refuses as no selector at all (the first take
of class 1.4 stopped on its Release button for that reason).
"""
self.page.evaluate(
"""([selector, bar]) => {
const node = document.querySelector(selector);
if (!node) return;
found = self.page.locator(selector)
if not found.count():
return
found.first.evaluate(
"""(node, bar) => {
const box = node.getBoundingClientRect();
if (box.bottom <= window.innerHeight - bar) return;
if (!document.getElementById('fs-scene-room')) {
Expand All @@ -692,7 +698,7 @@ def clear_of_caption(self, selector: str) -> None:
}
node.scrollIntoView({ block: 'center', behavior: 'instant' });
}""",
[selector, CAPTION_HEIGHT * 2],
CAPTION_HEIGHT * 2,
)

def wait_for(self, step: dict, timeout: float) -> None:
Expand Down
Loading
Loading