Public: anyone can read this; the crew can change it.

Migrated from github.com/Trevato/SO-ARM100

Grow card: "Camera can't see the plants" hint when the camera's region is mostly blown out or black (split from #584) #597

opened this

Merged 40d 0h ago

The grow card on the workshop home now shows "Camera can't see the plants: move it inside or beside the box, below the light." with a link to Tune. It appears when the camera's box (look.region) is blown out or black.

Notes

opened this

The grow card on the workshop home now shows "Camera can't see the plants: move it inside or beside the box, below the light." with a link to Tune. It appears when the camera's box (look.region) is blown out or black. I ran the new test file plus stations.test.ts and the src/ui tests, and tsc shows no errors beyond a missing bun type definition. I did not look at the page in a browser or on a preview, and the full check hasn't run.

  • How it works: the server can't decode a JPEG, so the check runs in the browser. Once a grow card's snapshot has loaded, a small inline script runs visibility on it and fills in the hint when the verdict isn't "ok". The card carries the camera's region for the script to read. The relay serves the new module src/ui/grow-hint.js under a content-hashed /ui/ path.
  • Tune link: it goes to /admin/camera-list, because that page has no deep link to one camera's Tune panel yet.
  • Server-side hint path: renderWorkshop also renders the hint when a camera view carries a sight verdict of "blown" or "dark". The relay never sets that, so on the real page the script is the only thing that shows the hint. That path is what the tests render.
  • Tests: src/grow-hint.test.ts covers four things:
    • An overexposed fixture gives a "blown" verdict inside the region, but "ok" over the whole frame.
    • The rendered card shows the hint and the Tune link for that fixture.
    • A fine fixture shows no hint.
    • The card carries its region.
  • Not covered: the browser script itself has no automated test.

Closes #590

commented

The grow card on the workshop home now shows "Camera can't see the plants: move it inside or beside the box, below the light." with a link to Tune. It appears when the camera's box (look.region) is blown out or black. I ran the new test file plus stations.test.ts and the src/ui tests, and tsc shows no errors beyond a missing bun type definition. I did not look at the page in a browser or on a preview, and the full check hasn't run.

  • How it works: the server can't decode a JPEG, so the check runs in the browser. Once a grow card's snapshot has loaded, a small inline script runs visibility on it and fills in the hint when the verdict isn't "ok". The card carries the camera's region for the script to read. The relay serves the new module src/ui/grow-hint.js under a content-hashed /ui/ path.
  • Tune link: it goes to /admin/camera-list, because that page has no deep link to one camera's Tune panel yet.
  • Server-side hint path: renderWorkshop also renders the hint when a camera view carries a sight verdict of "blown" or "dark". The relay never sets that, so on the real page the script is the only thing that shows the hint. That path is what the tests render.
  • Tests: src/grow-hint.test.ts covers four things:
    • An overexposed fixture gives a "blown" verdict inside the region, but "ok" over the whole frame.
    • The rendered card shows the hint and the Tune link for that fixture.
    • A fine fixture shows no hint.
    • The card carries its region.
  • Not covered: the browser script itself has no automated test.
commented

The grow card on the workshop home now shows "Camera can't see the plants: move it inside or beside the box, below the light." with a link to Tune. It appears when the part of the still inside the camera's box is mostly blown out or black. I've pushed a fix for the review. The new tests and stations.test.ts pass, and tsc reports nothing beyond the missing bun type definition. I haven't run the full check or looked at the page in a browser.

  • One path only. I dropped the server-side sight field and the server-side hintHtml call. The page's script is now watchStills(doc) in src/ui/grow-hint.js, and the workshop page's inline script just calls it.
  • watchStills tests. They use a fake document, image, canvas and slot:
    • An overexposed still fills the hint, and a fine one leaves the slot empty.
    • A still that loads late gets checked when it loads.
    • A still the browser won't let us read, or a bad region, leaves the hint empty.
    • The rendered card carries an empty slot with its region.
  • Served with the arm unplugged. The test with no arm now asserts that / carries the watchStills script. It also asserts that /ui/__VERSION__/ is replaced by a 12-hex version and that grow-hint.js and still-frame.js at that URL return 200. In that test the simulation is the real startServer rather than a stub, because the relay hands /ui/ to the simulation (the stub had no /ui/).
  • Swallowed catch. It is commented: a hint we couldn't compute stays empty, so the owner isn't sent to Tune for nothing.
  • Contrast and layout shift. .cant-see is now an overlay on the foot of the still, white on #000d with a #9ecbff link, so it moves nothing when it appears. I did not use --accent as a text colour. I judged those contrasts by eye and did not measure them.
  • Terminal parity. The README now says the terminal and the JSON doors cannot show this hint, because they have no pixels to count.
  • Preview. I did not try this on a preview. None shows a grow station, and my sandbox can't drive a browser. What I have is the fake-DOM tests and the relay-level test above, not a look at the real page. A person should see it on a deployment that has a grow station with a camera.
Sign in to join this conversation.

Search
↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs