Skip to content

libdmview: a box not seen takes no contact - #15

Merged
JohnAmadis merged 2 commits into
mainfrom
fix/unseen-contact
Oct 10, 2026
Merged

JohnAmadis merged 2 commits into
mainfrom
fix/unseen-contact

Conversation

@JaxCalder

Copy link
Copy Markdown

Summary

A box that isn't seen no longer takes touches.

A page's screens are boxes stacked on top of each other. dmvs_html converts the hidden ones (visibility: hidden, opacity: 0) to an OPACITY of 0, and the last screen in the page is on top. The hit test picked the topmost visible box under the contact even when it wasn't seen. Since that box handles nothing, the touch went to its parents, which also handle nothing, so the hidden screen on top swallowed every touch meant for the screen shown beneath it. On the board this broke the car HMI's playlist rows and climate buttons, while the sidebar outside the screens worked.

Each box now remembers the opacity it was last drawn with (its own OPACITY times its ancestors'). The hit test skips a box at 0, so the touch reaches what is visible beneath it, as with visibility: hidden in a browser. Boxes count as seen until they are first drawn.

Based on #14 (APPEND), which the board build includes. Merge that first.

Testing

test_libdmview passes 24/24 locally. The new step libdmview_hidden_boxes_take_no_contact uses a fixture with two screens:

  • while the top screen is hidden, the button beneath it is clicked through the top screen's covering box, and the top screen's own button doesn't respond;
  • once the top screen is shown, its cover blocks the button beneath and its own button is clicked.

The fixtures were assembled with the local todmv (#7), because run_tests.sh uses the registry's, which doesn't have APPEND yet. The car HMI is flashed with this build.

🤖 Generated with Claude Code

JohnAmadis and others added 2 commits October 10, 2026 08:55
APPEND $d, str appends a string - a literal or a string variable - to a
string variable, as much of it as the variable's size takes (in place,
without a buffer of that size). FORMAT formats one number; a number and
its unit, a name and its value need several pieces - what the JavaScript
compiler (dmvs_js) makes of innerText = `${speed} km/h`.

Views using it are version 0.5 (todmv marks them); the operand layout
has its entry (the offsets test checks it).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A page's screens are boxes one on another, the hidden ones with an
OPACITY of 0 (visibility: hidden) - the last one on top. The topmost
box under a contact was taken even when not seen, and as it handles
nothing its parents were asked: the screen hidden on top took every
touch of the one shown beneath it (the car HMI's playlist and climate
buttons did nothing). A box remembers its opacity times the boxes'
around it as last drawn; one of 0 is passed over.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@JohnAmadis
JohnAmadis merged commit 9517140 into main Oct 10, 2026
1 of 2 checks passed
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.

2 participants