2b8d9275548bcc9bd161b68f24848b545e1069ef
braney
  Sun Sep 6 14:00:28 2026 -0700
docent: click raw:, and the first two scripts that do anything twice

Every one of the 29 scripts in the suite was a straight line: fresh cart, a few
steps, assert once.  A bug that only exists on the repeat was invisible to that
shape, and the closed-bug pool holds several.  These are the first two that
repeat a gesture.

rm36805  click a TOGA item, dismiss the pop-up, click the same item again.
One click passes on the broken build as happily as on the fixed one,
so the second click is the test.
rm27113  three clicks on the centre of the base-position ruler.  A single
click zooms 3x about the base under the cursor, and the bug drifted
that centre one base left each time.

Both needed a gesture the language could not express.  click: {track, item}
follows the item's own map-box href, which is right when the assertion is about
the hgc PAGE, but hgTracks answers a real click with an ajax DIALOG
(popUpHgcOrHgGene.hgc) and following the href never opens one.  raw: true
presses the mouse where a user presses it and lets the page answer -- a
navigation, a dialog, or a new image in place, whichever arrives, waited for
rather than slept through.  With no item name it is a bare point on the row,
which is the only way to click the ruler at all: the ruler carries no hgc map
boxes for areaXY to snap to.

Two things measured while writing these, both in the script comments.  jQuery UI
HIDES a dialog on close rather than removing it, so the assertion has to be
has: "#hgcDialog:visible" -- without :visible the second half of rm36805 passes
whether or not the pop-up ever comes back.  And one base is invisible at the
13kb windows the rest of the suite uses, where a pixel is fourteen bases, so
rm27113 starts at 100 bases and its three expected windows are arithmetic rather
than three observed strings: every one of them is centred on base 155,806,200.

#37014 is the other repeat-click bug in the pool and is deliberately NOT written.
Its reproducer no longer reaches the code it was about: 9e9ee32a4c8 (#37878)
later excluded crossTissue* tracks from the pop-up path altogether, and the
session's track is crossTissueMapsTissueCellType, so the click now navigates and
no dialog is involved.  Writing it against a different bar chart track would be
pinning the ticket to something it was never about.

refs #38252

diff --git src/hg/utils/docent/tests/regress/rm27113.docent.yaml src/hg/utils/docent/tests/regress/rm27113.docent.yaml
new file mode 100644
index 00000000000..5ac4dae5793
--- /dev/null
+++ src/hg/utils/docent/tests/regress/rm27113.docent.yaml
@@ -0,0 +1,56 @@
+# #27113 -- a single click on the base-position ruler drifted the view one base LEFT
+# instead of recentring symmetrically on the base that was clicked.
+#
+# Three things were fixed in 94f9b53d3db and one was taken back out again (b551f6c3ac8
+# reverted the "0 bases" -> "1 base" scale-bar wording after QA flagged it). What survives
+# is the click behaviour: a single click zooms in 3x, centred symmetrically on the base
+# under the cursor, and a click on the ruler's grey side-label strip no longer hijacks the
+# config pop-up to do a zoom. This script covers the first. The side-label strip is left
+# alone on purpose: posXY puts a fraction inside the DATA area by design, so reaching that
+# strip means addressing a raw pixel outside it and asserting on a second pop-up, which is
+# a different test.
+#
+# ONE BASE is the whole error, so the window has to be small enough for one base to be
+# visible. At the 13kb windows the rest of this suite uses, a pixel is fourteen bases and
+# the bug is not expressible at all. This starts at 100 bases, where a base is about eleven
+# pixels wide.
+#
+# THE ASSERTION IS ARITHMETIC, not three observed strings. The window starts centred on
+# base 155,806,200, every click zooms 3x about the clicked base, and the clicked base is
+# the centre one, so that base stays the centre of every window that follows:
+#
+#     start      155,806,151-155,806,250    100 bases   centre 155,806,200
+#     click 1    155,806,184-155,806,216     33 bases   centre 155,806,200
+#     click 2    155,806,195-155,806,205     11 bases   centre 155,806,200
+#     click 3    155,806,199-155,806,201      3 bases   centre 155,806,200
+#
+# A one-base drift at any click moves every window after it, and the last one is three
+# bases wide, so there is nowhere for it to hide. Each click is asserted separately so a
+# failure names the click that drifted rather than only the end of the chain.
+#
+# This is one of the two scripts here that does anything more than once (rm36805 is the
+# other). A drift of one base per click is not something anyone would file after a single
+# gesture; it is the accumulation that people saw, and a straight-line script cannot see it.
+#
+# raw: true, with no item name, is a bare point on a row. The ruler carries no hgc map boxes
+# at all, so docent's ordinary item click has nothing to follow and this is the only way to
+# express the gesture.
+#
+# Fixed and on the RR on 2026-07-28, so there is no build left to watch this fail on.
+target: genome-test
+db: hg38
+position: chr7:155806151-155806250
+reset: true
+fast: true
+steps:
+  - go: chr7:155806151-155806250
+  - expect: {rows: [ruler], text: "chr7:155,806,151-155,806,250"}
+
+  - click: {track: ruler, frac: 0.5, raw: true}
+  - expect: {text: "chr7:155,806,184-155,806,216"}
+
+  - click: {track: ruler, frac: 0.5, raw: true}
+  - expect: {text: "chr7:155,806,195-155,806,205"}
+
+  - click: {track: ruler, frac: 0.5, raw: true}
+  - expect: {rows: [ruler], text: "chr7:155,806,199-155,806,201"}