Skip to content

feat: morph between popups smoothly and by default - #253

Merged
Seb-GRAF merged 2 commits into
mainfrom
feat/252-morph-popups-by-default
Oct 23, 2026
Merged

Seb-GRAF merged 2 commits into
mainfrom
feat/252-morph-popups-by-default

Conversation

@Seb-GRAF

Copy link
Copy Markdown
Collaborator

Problem

Morphing between popups stuttered, flickered and started about 150 ms after the click, so it stayed off by default. Fixes #251 and #252.

Changes

  • Core Animation moves the box. The morph window draws one background and border, and Core Animation moves and resizes its mask on the render server with the bar's motion curve, springs included. Work on the main thread no longer drops frames. The window shadow still follows the box through the display link.
  • No extra popups. The morph reuses the two popup windows already on screen instead of building two copies of their content without a background. The box starts once the new popup is built. While the morph runs, PopupBackgrounds.hidden hides both popups' own background and border without rebuilding their content, so translucent backgrounds don't stack.
  • Content fades in place. Each popup's content stays where it is, clipped by the moving box. The old content fades out over the first 40% of the duration and the new content fades in from 20% to 80%. The box is never empty, and the two never sit on top of each other at half opacity.
  • No jump on the first frame. The masks and the new popup's opacity are set before any window is ordered in, and the clock starts after the new popup has drawn.
  • On by default. bar.morphPopups now defaults to true in the decoder, the Settings toggle, the schema description and the guide. With it on, a left click elsewhere in the bar closes an open popup when the click ends rather than when it starts, as feat: morph the open popup into the next one when switching widgets #204 introduced for the setting. "morphPopups": false keeps close-then-open.
  • PopupMorphView and PopupView.drawsBackground are gone.

Testing

  • The full swift test run passes: 314 XCTest and 434 Swift Testing tests.
  • No automated test covers the morph. CI turns on Reduce Motion, which skips it.
  • The developer ran the earlier versions on their own bar (motion snappy, glass off, opaque fill) and recorded them. Read frame by frame, the SwiftUI version waited about 150 ms after the click, then moved in 33 ms steps with a 66 ms stall. The developer tried this version on their bar before asking for this pull request.
  • Known limits while a morph runs:
    • When the two popups have different background fills, the box takes the new fill at the click instead of blending.
    • With glass, the glass edge highlight is missing until the morph ends.
    • Popups without a fill may draw secondary text without vibrancy.
    • A popup that changes its own height during the morph jumps to that height when the morph ends.
    • Clicking a third widget before a morph ends jumps to the second popup, then morphs from there, as before.
  • Recordings to follow.

Merging

Merge commit, so the fix and the feat each get a changelog entry.

Claude Opus 5.5 via Claude Code (in T3 Code)

@Seb-GRAF
Seb-GRAF enabled auto-merge October 23, 2026 07:00
@Seb-GRAF
Seb-GRAF merged commit 6b0dae8 into main Oct 23, 2026
7 checks passed
@Seb-GRAF
Seb-GRAF deleted the feat/252-morph-popups-by-default branch October 23, 2026 07:04
@stablebar-releases

Copy link
Copy Markdown

🎉 This PR is included in version 0.6.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.

Morphing between popups stutters, flickers and starts late

1 participant