recording: query_and_hover (live readout follows the cursor)#15
Merged
Conversation
Seventh tutorial recording, and the last of the subject-interaction set. query_and_hover
reads the cursor LIVE: while the pointer is over the plot the example draws a vertical
crosshair at the cursor x and an (x, y) label in DATA coords (GetPlotMousePos). The
interaction it teaches is the HOVER - move the cursor and the readout follows, every
frame. Driven with a REAL synthetic cursor glide (center -> left -> right), voiced and
self-verifying: each beat waits for `hovered` to flip true, then asserts GetPlotMousePos
resolved into the band the cursor was aimed at (and moved right between beats), so a dead
hover or a frozen readout aborts at teardown.
Also tidies the example's cursor label (review): it printed full double precision -
(73.97119341563786, -0.19043977055449335). Formatted via fmt precision specifiers in the
interpolation - "({mp.x:.1f}, {mp.y:.2f})" - so it reads (74.0, -0.19). (`format(...)` is
deprecated in favor of `fmt`, whose spec is `:.1f`, not printf `%.1f`.)
- examples/tutorial/query_and_hover.das: format the cursor label to 1-2 decimals
(+ require strings for fmt).
- tests/integration/record_query_and_hover.das: the voiced driver (intro + glide left +
glide right), each verifying hovered + mouse-plot-x in the aimed band.
- doc/source/tutorials/query_and_hover.rst: + .. video:: query_and_hover.mp4, inline
snippet + prose synced to the formatted label.
- doc/source/_static/tutorials/query_and_hover.mp4: the recording (633 KB, 26.4s, 695
frames, 0 dropped, Emma voice + -16 dB bed).
The headless guard is the existing test_query_and_hover.das.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
There was a problem hiding this comment.
Pull request overview
Adds the final “subject-interaction” tutorial recording for query_and_hover, and tightens the example’s cursor readout formatting so the on-plot label is readable and consistent with the narrated walkthrough.
Changes:
- Add a new integration recording driver that glides a synthetic cursor and self-verifies hover + live
GetPlotMousePosreadout bands. - Format the on-plot
(x, y)cursor label to fixed decimals usingfmt-style precision specifiers. - Update the tutorial RST to include the walkthrough video and keep the inline snippet/prose in sync with the formatted label.
Reviewed changes
Copilot reviewed 3 out of 4 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| tests/integration/record_query_and_hover.das | New voiced recording driver that hovers and glides the cursor while asserting live plot-mouse readout behavior. |
| examples/tutorial/query_and_hover.das | Formats the cursor label to 1–2 decimals and adds the required module import for formatting. |
| doc/source/tutorials/query_and_hover.rst | Updates snippet + prose to match the formatted label and adds a walkthrough video section. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+48
to
+50
| move_to(app, (px + pw * 0.5f, py + ph * 0.5f), 700) | ||
| var hc = wait_for_hovered(s, true) | ||
| record_check(app, "the plot reports hovered while the cursor is over it", hc != null) |
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.
Seventh tutorial recording, and the last of the subject-interaction set.
query_and_hoverreads the cursor live: while the pointer is over the plot the example draws a vertical crosshair at the cursor x and an(x, y)label in data coords (GetPlotMousePos). The interaction it teaches is the hover — move the cursor and the readout follows, every frame. Driven with a real synthetic cursor glide (center → left → right), voiced and self-verifying: each beat waits forhoveredto flip true, then assertsGetPlotMousePosresolved into the band the cursor was aimed at (and moved right between beats), so a dead hover or a frozen readout aborts at teardown.Example tidy (from review)
The cursor label printed full double precision —
(73.97119341563786, -0.19043977055449335). Formatted viafmtprecision specifiers in the interpolation,"({mp.x:.1f}, {mp.y:.2f})", so it now reads(74.0, -0.19).Files
examples/tutorial/query_and_hover.das— format the cursor label to 1–2 decimals (+require stringsforfmt).tests/integration/record_query_and_hover.das— the voiced driver (intro + glide left + glide right), each verifyinghovered+ mouse-plot-x in the aimed band.doc/source/tutorials/query_and_hover.rst—.. video:: query_and_hover.mp4; inline snippet + prose synced to the formatted label.doc/source/_static/tutorials/query_and_hover.mp4— the recording (633 KB, 26.4 s, 695 frames, 0 dropped, Emma voice + −16 dB bed).Verification
ok:true, 695 frames, 0 dropped; all four gates pass (hovered + left band[8,40]+ right band[60,92]+ moved right).(21.9, 0.20)→ right(74.0, -0.19).The headless guard is the existing
test_query_and_hover.das.🤖 Generated with Claude Code