From 0e8cdd5335645811a0ad54cfc4f96c68adb59b5e Mon Sep 17 00:00:00 2001 From: The_miro Date: Mon, 6 Jul 2026 00:06:18 +0200 Subject: [PATCH] fix(astal-menu): play the quad-expand pop once, not on a loop MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The .quad-pop CSS animation stayed applied for the whole time a quad was expanded, so every re-layout of the expanded card (module content streaming in, the compact grid updating beneath the overlay) restarted the transform animation — making the pop repeat continuously. Remove the class ~340ms after expanding (just past the 300ms animation) so it plays exactly once and no later re-layout can retrigger it. Co-Authored-By: Claude Opus 4.8 Claude-Session: https://claude.ai/code/session_01XUWCXM4KhjRkwheaA3X7bP --- desktopenvs/hyprlua/astal-menu/ui/quadgrid.py | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/desktopenvs/hyprlua/astal-menu/ui/quadgrid.py b/desktopenvs/hyprlua/astal-menu/ui/quadgrid.py index a33aad3..355cd52 100644 --- a/desktopenvs/hyprlua/astal-menu/ui/quadgrid.py +++ b/desktopenvs/hyprlua/astal-menu/ui/quadgrid.py @@ -16,7 +16,7 @@ from __future__ import annotations import gi gi.require_version("Gtk", "4.0") -from gi.repository import Gtk # noqa: E402 +from gi.repository import GLib, Gtk # noqa: E402 from lib.border import bordered from module_base import ModuleSpec @@ -83,12 +83,19 @@ class QuadGrid(Gtk.Overlay): self._expand_holder.append(content) self._expanded_id = module_id self._expand_reveal.set_reveal_child(True) - # bouncy scale pop (CSS @keyframes); the class was cleared on collapse so - # re-adding it here replays the animation on every expand. + # bouncy scale pop (CSS @keyframes). Keep the class only for the animation's + # duration, then drop it: while it's applied, any re-layout of the card (module + # content streaming in, the grid updating underneath) restarts the transform + # animation, which made the pop loop forever. self._expand_card.add_css_class("quad-pop") + GLib.timeout_add(340, self._clear_pop) self.grid.add_css_class("dimmed") card.on_show() + def _clear_pop(self) -> bool: + self._expand_card.remove_css_class("quad-pop") + return GLib.SOURCE_REMOVE + def request_collapse(self) -> None: self._expand_reveal.set_reveal_child(False) self._expand_reveal.set_visible(False)