Answer the pointer from the reaction, not from the link
The last commit widened the wrong widget's answer: `link` and `reaction` ended their bodies with the same line, and it was `link` that started handing back an interaction map nobody reads while `reaction` went on answering a bare click. So the pill reported no hover and the card the commit exists for never appeared. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
ae799a2 parent: 65272e3 modified
jvui/src/jvui/widgets.clj +7 -7 | @@ -633,12 +633,7 @@ | ||
| 633 | 633 | ([s {:keys [key]}] |
| 634 | 634 | (let [id (c/next-id key) |
| 635 | 635 | rect (label s {:colour (c/th :accent)})] |
| 636 | - ;; The whole interaction and not just the click: a reaction is the one | |
| 637 | - ;; chip that answers the pointer resting on it as well as pressing it — | |
| 638 | - ;; who put it there is what the pill's number will not say — so the | |
| 639 | - ;; caller needs `:hover?` too. It also needs the rectangle, to know | |
| 640 | - ;; where to hang the card. | |
| 641 | - (assoc (c/interact! id rect) :rect rect)))) | |
| 636 | + (:clicked? (c/interact! id rect))))) | |
| 642 | 637 | |
| 643 | 638 | (defn emoji |
| 644 | 639 | "One emoji, drawn as a character and sized to sit level with the words |
| @@ -726,4 +721,9 @@ | ||
| 726 | 721 | (when tally |
| 727 | 722 | (c/draw-text! tally (+ x pad (double gw)) (+ y (/ (- h (double ch)) 2.0)) |
| 728 | 723 | sz (c/th :text))) |
| 729 | - (:clicked? (c/interact! id rect))))) | |
| 724 | + ;; The whole interaction and not just the click: a reaction is the one | |
| 725 | + ;; chip that answers the pointer resting on it as well as pressing it — | |
| 726 | + ;; who put it there is what the pill's number will not say — so the | |
| 727 | + ;; caller needs `:hover?` too, and the rectangle, to know where to hang | |
| 728 | + ;; the card that answers it. | |
| 729 | + (assoc (c/interact! id rect) :rect rect)))) | |
| @@ -633,12 +633,7 @@ | |||
| 633 | ([s {:keys [key]}] | 633 | ([s {:keys [key]}] |
| 634 | (let [id (c/next-id key) | 634 | (let [id (c/next-id key) |
| 635 | rect (label s {:colour (c/th :accent)})] | 635 | rect (label s {:colour (c/th :accent)})] |
| 636 | - ;; The whole interaction and not just the click: a reaction is the one | 636 | + (:clicked? (c/interact! id rect))))) |
| 637 | - ;; chip that answers the pointer resting on it as well as pressing it — | ||
| 638 | - ;; who put it there is what the pill's number will not say — so the | ||
| 639 | - ;; caller needs `:hover?` too. It also needs the rectangle, to know | ||
| 640 | - ;; where to hang the card. | ||
| 641 | - (assoc (c/interact! id rect) :rect rect)))) | ||
| 642 | 637 | ||
| 643 | (defn emoji | 638 | (defn emoji |
| 644 | "One emoji, drawn as a character and sized to sit level with the words | 639 | "One emoji, drawn as a character and sized to sit level with the words |
| @@ -726,4 +721,9 @@ | |||
| 726 | (when tally | 721 | (when tally |
| 727 | (c/draw-text! tally (+ x pad (double gw)) (+ y (/ (- h (double ch)) 2.0)) | 722 | (c/draw-text! tally (+ x pad (double gw)) (+ y (/ (- h (double ch)) 2.0)) |
| 728 | sz (c/th :text))) | 723 | sz (c/th :text))) |
| 729 | - (:clicked? (c/interact! id rect))))) | 724 | + ;; The whole interaction and not just the click: a reaction is the one |
| 725 | + ;; chip that answers the pointer resting on it as well as pressing it — | ||
| 726 | + ;; who put it there is what the pill's number will not say — so the | ||
| 727 | + ;; caller needs `:hover?` too, and the rectangle, to know where to hang | ||
| 728 | + ;; the card that answers it. | ||
| 729 | + (assoc (c/interact! id rect) :rect rect)))) | ||