Skip to content

libdmview: dragging a scroll box scrolls it - #16

Merged
JohnAmadis merged 3 commits into
mainfrom
feature/drag-scroll
Oct 10, 2026
Merged

JohnAmadis merged 3 commits into
mainfrom
feature/drag-scroll

Conversation

@JaxCalder

Copy link
Copy Markdown

Summary

Dragging a SCROLL box now scrolls it, as docs/assembly.md has always described. Until now it wasn't implemented: a scroll box could only move through SCROLLTO. The car HMI's song queue couldn't be scrolled because of this.

  • Taking over: once a contact moves more than .scrollslop (8 px by default), the scroll box around the point where it went down takes the contact over. That's the topmost box there, or the nearest ancestor that scrolls along the direction of the movement (the other direction as a fallback).
  • The pressed box gets RELEASE without CLICK, and stops looking pressed.
  • Following the contact: the content follows the contact from the offset it had at takeover, clamped to the content (scroll_to(), now view_scroll_to() for input.c).
  • What scrolls: only seen, visible boxes whose content is larger than the box along an allowed axis.

The docs for OPACITY 0 now say what #15 does: the box takes no contact.

Based on #15, which is based on #14. Merge them first.

Testing

test_libdmview passes 25/25 locally. The new step libdmview_drags_scroll_boxes uses a 20 px box of 40 px content: a red row that is a button, then a green row.

  • A tap clicks the button.
  • A move under the threshold still clicks it.
  • A drag past the threshold scrolls the list to the green row and doesn't click.

The fixture is assembled with the local todmv, because run_tests.sh uses the registry's, which doesn't have APPEND. The car HMI is flashed with this build, and the queue is a SCROLL 224, 314 box (dmvs_html).

🤖 Generated with Claude Code

JohnAmadis and others added 3 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>
As the format describes it: a contact moving past .scrollslop (8 px by
default) is taken over by the scroll box around where it went down - the
nearest one that scrolls that way - and the box pressed is released, not
clicked; the content follows the contact, clamped to it. It was not
done at all: a SCROLL box could only be scrolled by SCROLLTO. OPACITY
0's documentation says what a box not seen does now: it takes no contact.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@JohnAmadis
JohnAmadis merged commit 11fa620 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