Skip to content

perf(ui): eliminate per-frame ImageFilter.blur sigma animation in showAppDialog backdrop #1341

Description

@ZhuchkaTriplesix

Problem

In lib/shared/widgets/app_dialog.dart, _DialogBackdrop renders the modal frosted backdrop with animated Gaussian blur sigma on every frame of the enter/exit transition (200 ms):

BackdropFilter(
  filter: ImageFilter.blur(sigmaX: sigma * t, sigmaY: sigma * t),
  child: ColoredBox(
    color: const Color(0xFF000000).withValues(alpha: tintAlpha * t),
  ),
)

While #886 / #977 successfully removed the enclosing Opacity widget (avoiding full-screen saveLayer offscreen compositing), animating sigmaX and sigmaY linearly from 0 to 8 across 24 frames (@ 120 Hz) forces the rasterizer (Skia / Impeller) to regenerate and execute a full-resolution Gaussian blur shader pass on every frame.

Code Location

  • lib/shared/widgets/app_dialog.dart (lines 152–159)

UI Kit Relationship

Impact on 120 Hz Frame Budget

On 120 Hz displays (8.3 ms frame budget), full-screen blur with varying sigma frequently causes raster thread spikes (10–18 ms), dropping frames on modal open/close on Linux (X11/Wayland) and macOS.

Proposed Solution

  1. Use a constant blur sigma (sigma: 8) whenever t > 0 and animate only the background tint alpha / overlay fade:
final t = progress.clamp(0.0, 1.0);
if (t <= 0) return const SizedBox.expand();
return ClipRect(
  child: BackdropFilter(
    filter: ImageFilter.blur(sigmaX: sigma, sigmaY: sigma),
    child: ColoredBox(
      color: const Color(0xFF000000).withValues(alpha: tintAlpha * t),
    ),
  ),
);
  1. When Motion is Off / Reduced, snap directly to full blur or skip the filter entirely.

Acceptance Criteria

  • Raster thread time during dialog enter/exit stays under 4.0 ms in DevTools Performance timeline @ 120 Hz.
  • No visual pop-in or harsh transition when opening any modal.

Activity

  1. added
    frontendTheme parser epic label: frontend
    performanceTheme parser epic label: performance
    motionAnimation system, transitions, motion tokens
    uiUser interface components and widgets
    P2Medium priority / Parity & Refactoring
    on Oct 10, 2026
  2. ZhuchkaTriplesix commented on Oct 11, 2026

    @ZhuchkaTriplesix
    MemberAuthor

    Done in #1429.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2Medium priority / Parity & RefactoringfrontendTheme parser epic label: frontendmotionAnimation system, transitions, motion tokensperformanceTheme parser epic label: performanceuiUser interface components and widgets

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions