Repository navigation
Recorder: a box's label sits outside it and stops covering card titles - #261
Merged
Merged
Conversation
…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>
|
Thanks for the first pull request. Checks: every commit signed off ( |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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__sceneCalloutin the overlay.Where the label goes. The recorder tries these spots in order and takes the first clear one:
What counts as clear. A spot is passed over if any of these is true:
How text is found. For each spot, the recorder calls
document.elementsFromPointon 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:
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.jsongainslabel_box {x,y,w,h}on a pointedsaythat has a label. This is additive; nothing studio reads changes.HEADER_BAND_JS), used both for scrolling a box clear and for placing its label.scripts/scenes/README.mdsays 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: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):label_boxvalues are inside 1280×720, below the 200 px header (the highest is at y 213), above the caption bar and out of the corner.Checksums of all 155 files under
~/Work/gifs/course: only the 2.1 lesson folder andcourse.jsonchanged.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