Skip to content

Recorder: a box's label sits outside it and stops covering card titles - #261

Merged
kalwei merged 2 commits into
mainfrom
fix/recorder-label-outside
Nov 17, 2026
Merged

kalwei merged 2 commits into
mainfrom
fix/recorder-label-outside

Conversation

@kalwei

@kalwei kalwei commented Nov 17, 2026

Copy link
Copy Markdown
Contributor

What Scott will see

In the class films, the small cyan label ("Jobs due", "In spec", "No warning") now sits just outside its box and no longer covers the card's title. MAINTENANCE, RECENT RESULTS and BOOK OUTPUT can all be read. Class 2.1 is re-taken with this change: same words and same clicks, with only the labels moved.

Stills from the new take (take 5), in ~/Work/gifs/course/03-the-floor/01-the-station-screen/stills/:

  • 07-a-reading-in-spec.png: "In spec" sits at the right end, clear of RECENT RESULTS.
  • 08-what-maintenance-is-owed.png: "Jobs due" sits at the right end, clear of MAINTENANCE.
  • 11-a-figure-the-counter-contradicts-is-taken.png: "No warning" sits beside BOOK OUTPUT, not on it.
  • 09-the-next-order-is-planned.png: the one tight spot. "Only planned" sits on the box's edge and covers only the pill's own caption, STATUS.

What changed

The change is in scripts/record-scene.py, in __sceneCallout in the overlay.

Where the label goes. The recorder tries these spots in order and takes the first clear one:

  1. above the box, at its left end;
  2. above the box, at its right end;
  3. below the box, left end then right end;
  4. beside the box's right edge;
  5. beside the box's left edge.

What counts as clear. A spot is passed over if any of these is true:

  • it is off the frame;
  • it is under the sticky header;
  • it is on the caption bar;
  • it is in the narrator's corner (x > 1040 and y > 520);
  • it is on the box;
  • it covers any of the page's own text.

How text is found. For each spot, the recorder calls document.elementsFromPoint on a 5×3 grid of points. Then it checks the client rectangles of those elements' own text nodes against the spot. So an empty part of a heading row is fine; only the words count. I added "above, at its right end" ahead of "below": card titles are left-aligned, so the right end of the title row is usually free. The handoff's order otherwise holds.

When no spot is clear. On the first take, two targets had no clear spot:

  • the Characteristic list, 172 px wide at the frame's left edge;
  • the planned order's status pill, in a tight grid of figures.

In both cases the only free space was over the thing's own caption: "Characteristic" and STATUS. So there is a second pass. It uses the same spots, but sits on the box's edge like a tab, and may cover only the boxed thing's own caption. That caption is its <label for>, or the short words (30 letters or fewer) beside it in a field of two. The label is still never on the boxed content. If even that finds no spot, the take fails and names the step, the same way the corner rule does.

Other changes:

  • marks.json gains label_box {x,y,w,h} on a pointed say that has a label. This is additive; nothing studio reads changes.
  • The sticky-header band is now one shared JS function (HEADER_BAND_JS), used both for scrolling a box clear and for placing its label.
  • scripts/scenes/README.md says where the label goes.

The 2.1 scene file is unchanged.

How it was verified

  • New browser tests, tests/test_a_boxs_label_sits_outside_it_and_off_the_pages_own_writing.py, five in all:

    • a label on a box under a card title does not cover the title;
    • a box at the top of the frame gets its label below it;
    • a box beside the narrator's corner keeps its label out of the corner and off the title;
    • in a crowded grid, the label covers only the boxed value's own caption;
    • a box with no clear spot fails the take and names the step.

    Four of the five fail on main's recorder.

  • The 2.1 take ran to the end on a scratch cutlery plant (127.0.0.1:8040/4844, 10×, MES_OPS_FINISH_ORDERS=false):

    • I looked at all 13 stills.
    • All 21 label_box values are inside 1280×720, below the 200 px header (the highest is at y 213), above the caption bar and out of the corner.
    • The badge is in 286 of 286 GIF frames and 6685 of 6685 mp4 frames.
  • Checksums of all 155 files under ~/Work/gifs/course: only the 2.1 lesson folder and course.json changed. the-station-screen.script.txt (the captions) is byte-identical.

  • Fast suite: 4586 passed, 7 skipped. Browser scene/course/recorder/class tier: 121 passed. ruff check . is clean.

  • I checked this on loopback only. The label is placed once, when the box goes up, so timing does not change the result.

Not done: the other four classes are not re-shot; each has its own handoff. Their next takes may meet a label with no clear spot. If so, the take will fail and name the step, and the fix is a shorter label or a different at.

🤖 Generated with Claude Code

kalwei and others added 2 commits November 16, 2026 17:28
…ting

A box's label used to sit just above the box's top-left edge. On the station
screen the boxed thing sits under its card's title, so the label covered the
title's first words (class 2.1, 2026-11-15). The label now tries spots in
turn: above the box at its left end, then its right; below, the same; beside
its right edge, then its left. A spot off the frame, under the sticky header,
on the caption bar, in the narrator's corner, on the box, or over any line of
the page's text is passed over; the text is found from the elements under a
5 by 3 grid of points on the spot and the rectangles of their own text nodes.
A label with no clear spot refuses the take, naming the step. marks.json
gains label_box on a pointed say; the header band is one shared function.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: scottkalw <scottkalwei@gmail.com>
The first re-take of class 2.1 stopped twice: the Characteristic list and the
order's status pill sit in rows of fields so tight that every spot round them
holds a neighbour's words. Both times the only free space is over the thing's
own caption, the word that already names it. When no spot is clear, the label
now tries again on the box's edge, as a tab, allowed to cover that caption
(its <label for>, or the short words beside it in a field of two) and nothing
else; it still never sits on the boxed content. With no spot even then the
take is refused as before.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: scottkalw <scottkalwei@gmail.com>
@github-actions

Copy link
Copy Markdown

Thanks for the first pull request. Checks: every commit signed off (git commit -s), ruff and pytest green, and the house-rules checklist in the template. The maintainer reviews within a few days.

@kalwei
kalwei merged commit 3c60324 into main Nov 17, 2026
28 checks passed
@kalwei
kalwei deleted the fix/recorder-label-outside branch November 17, 2026 00:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant