Draw a chip.s card because it has one, not because of the pointer
The backend was gating the overlay on its own :hover? as well as on the child being there, which is the same question asked twice and answered by two different parties. The client is the one that knows: it is what hangs the card under the pill, and it may be tracking something other than this pointer to decide — a card raised by a keyboard, or one held open while the pointer crosses to it. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
db7ce9f parent: ae799a2 modified
glimmer-backends/glimmer-jvui/src/glimmer_jvui/core.clj +10 -4 | @@ -284,10 +284,16 @@ | ||
| 284 | 284 | (hover! n id (:hover? r)) |
| 285 | 285 | ;; Whatever the client hung under the pill is its hover |
| 286 | 286 | ;; card, and a card is drawn over the row rather than in |
| 287 | - ;; it — see c/overlay!. Under the pill and a little to its | |
| 288 | - ;; right, which is where a pointer that is on the pill is | |
| 289 | - ;; not. | |
| 290 | - (when (and (:hover? r) (seq (:children @n))) | |
| 287 | + ;; it — see c/overlay!. Just under the pill, which is | |
| 288 | + ;; where a pointer resting on the pill is not. | |
| 289 | + ;; | |
| 290 | + ;; On having children and not on :hover?. The client is | |
| 291 | + ;; the one that knows whether a card is wanted — it is | |
| 292 | + ;; already deciding, since it is what puts the child there | |
| 293 | + ;; — and a backend that asked the question a second time | |
| 294 | + ;; would be answering a pointer the client may not be | |
| 295 | + ;; tracking with a pointer of its own. | |
| 296 | + (when (seq (:children @n)) | |
| 291 | 297 | (let [[x y _ h] (:rect r)] |
| 292 | 298 | (c/overlay! id [x (+ y h 4.0)] |
| 293 | 299 | #(w/card* {:expand :none :key id} |
| @@ -284,10 +284,16 @@ | |||
| 284 | (hover! n id (:hover? r)) | 284 | (hover! n id (:hover? r)) |
| 285 | ;; Whatever the client hung under the pill is its hover | 285 | ;; Whatever the client hung under the pill is its hover |
| 286 | ;; card, and a card is drawn over the row rather than in | 286 | ;; card, and a card is drawn over the row rather than in |
| 287 | - ;; it — see c/overlay!. Under the pill and a little to its | 287 | + ;; it — see c/overlay!. Just under the pill, which is |
| 288 | - ;; right, which is where a pointer that is on the pill is | 288 | + ;; where a pointer resting on the pill is not. |
| 289 | - ;; not. | 289 | + ;; |
| 290 | - (when (and (:hover? r) (seq (:children @n))) | 290 | + ;; On having children and not on :hover?. The client is |
| 291 | + ;; the one that knows whether a card is wanted — it is | ||
| 292 | + ;; already deciding, since it is what puts the child there | ||
| 293 | + ;; — and a backend that asked the question a second time | ||
| 294 | + ;; would be answering a pointer the client may not be | ||
| 295 | + ;; tracking with a pointer of its own. | ||
| 296 | + (when (seq (:children @n)) | ||
| 291 | (let [[x y _ h] (:rect r)] | 297 | (let [[x y _ h] (:rect r)] |
| 292 | (c/overlay! id [x (+ y h 4.0)] | 298 | (c/overlay! id [x (+ y h 4.0)] |
| 293 | #(w/card* {:expand :none :key id} | 299 | #(w/card* {:expand :none :key id} |