Repository navigation
fix: make the whole popup block clickable - #139
Merged
Merged
Conversation
A popup block with onClick, onClickField, open or openField wrapped only its content in the button, while its padding and configured width and height sat outside it. A 42-point round play button around a 17-point symbol reacted only to clicks on the symbol, so most clicks on its circle did nothing. Put the padding and frames inside the button label and give it a rectangular content shape, as the bar's widget tiles already do.
This was referenced Oct 21, 2026
|
🎉 This PR is included in version 0.5.0 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀 |
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.
Problem
A popup block with
onClick,onClickField,openoropenFieldonly reacts to clicks on its symbol or text, not on the box its style gives it. The now-playing popup's play button is a 42-point circle around a 17-point symbol. Only about a 12 × 14-point area around the symbol responds, so most clicks on the circle do nothing. People take this for a slow first click, because they click again until one lands. The favorite, shuffle, ±15 s, previous/next, repeat and volume buttons, the artwork and the app row have the same problem.#46 fixed this for widget tiles in the bar. Popup blocks build their own button in
PopupBlockViewand still wrapped only the content: the padding and thewidth/heightframes came after the button, and nothing gave them a content shape.Changes
PopupBlockViewnow puts the block's padding and frames inside the button label and gives it a rectangular content shape, the same pattern as fix: make the whole widget tile clickable #46. The background, border, offset and opacity stay outside, so blocks look the same. Blocks without an action get the same box, which only means a click in their padding reaches a clickable parent row.PopupClickTestsclicks a 42-point symbol block, once withonClickand once withopen, at its center and at six points inside its box, and expects every click to run the action. The test uses a real, transparent on-screen window, because SwiftUI only hit-tests windows that are on screen.Testing
swift test --filter popupBlockActionsFireAcrossTheirStyledBoxfailed before the fix: for bothonClickandopen, the center click ran the action and all six clicks away from the symbol were dropped. It passes after the fix.Full
swift test: 246 XCTest and 366 Swift Testing tests passed, includinglayoutBlocksAreConcreteViews.A standalone SwiftUI repro of the same view stack, in a non-activating panel like
PopupPanel, mapped which points of the 42-point circle respond (#fires,ois inside the circle and ignored):Hit map, before and after
(rows sampled every few points; the remaining
os are where a 2-point grid meets the circle's edge)On the running beta, a trace of real clicks on the now-playing popup matched this: every click within about 3 points of the symbol's center ran
control.sh, and clicks 4 to 8 points away, still inside the circle, never ran it.No screenshots: blocks look the same at rest. I haven't clicked through the fixed build live; the automated test covers the hit area.
git diff --checkand commitlint pass.Merging
One commit. Any merge method works; the title matches the commit message.
Claude Opus 5.5 via Claude Code in T3 Code.