Skip to content

fix: make the whole popup block clickable - #139

Merged
M4n0x merged 1 commit into
mainfrom
fix/popup-click-area
Oct 21, 2026
Merged

M4n0x merged 1 commit into
mainfrom
fix/popup-click-area

Conversation

@M4n0x

@M4n0x M4n0x commented Oct 21, 2026

Copy link
Copy Markdown
Collaborator

Problem

A popup block with onClick, onClickField, open or openField only 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 PopupBlockView and still wrapped only the content: the padding and the width/height frames came after the button, and nothing gave them a content shape.

Changes

  • PopupBlockView now 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.
  • PopupClickTests clicks a 42-point symbol block, once with onClick and once with open, 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.
  • The README's popup section says the whole block is clickable.

Testing

  • swift test --filter popupBlockActionsFireAcrossTheirStyledBox failed before the fix: for both onClick and open, 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, including layoutBlocksAreConcreteViews.

  • 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, o is inside the circle and ignored):

    Hit map, before and after
    Before                     After
    ........ooooooo........    ........o#####o........
    ......ooooooooooo......    ......o#########o......
    ...ooooooooooooooooo...    ...#################...
    .oooooooo######ooooooo.    .o###################o.
    .oooooooo######ooooooo.    .#####################.
    .oooooooo######ooooooo.    .#####################.
    .oooooooo######ooooooo.    .#####################.
    ...ooooooooooooooooo...    ...#################...
    ......ooooooooooo......    ......o#########o......
    ........ooooooo........    ........o#####o........
    

    (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 --check and 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.

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.
@M4n0x
M4n0x requested a review from Seb-GRAF as a code owner October 21, 2026 09:52
@M4n0x
M4n0x merged commit 34e8202 into main Oct 21, 2026
4 checks passed
@M4n0x
M4n0x deleted the fix/popup-click-area branch October 21, 2026 10:02
@stablebar-releases

Copy link
Copy Markdown

🎉 This PR is included in version 0.5.0 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant