Skip to content

Typing in comments freezes Safari: global keydown in drag_and_strum + heavy compositing #2926

Description

@vitalibondar

Summary: Typing in a card's comment box freezes Safari (macOS + iOS) for 5–10s. It worsens during a session and on cards with longer comment threads. Chrome is unaffected.

Profiling (Safari Web Inspector → Timelines, ~57s capture during the freeze):

  • Time is dominated by Compositing: ~9.8s total, with single composite frames up to 1.34s and rendering frames up to 2.9s. Scripting CPU is negligible (~0.27s), Layout/Paint minimal. So the cost is in the GPU/compositing layer, not JS or DOM morphing.
  • ~15 keydown events fire per typed character (2106 keydown vs 138 input), plus a MutationObserver storm (~3045 callbacks).
  • drag_and_strum_controller listens for keydown globally and, on each keydown, runs #preloadAudioFiles, constructing new Audio() in a loop (the top JS self-time) — firing even when focus is inside the lexxy comment editor.

Suggested fixes:

  1. drag_and_strum_controller should ignore keydown when focus is in an editor (e.g. event.target.closest('lexxy-editor') / isContentEditable), or preload audio once on connect instead of per keydown.
  2. The heavy compositing during typing points to large GPU layers (e.g. will-change / filter / transform on the board) being recomposited on every DOM mutation from the editor — worth narrowing the composited area.

Environment: fizzy:main, Safari on macOS + iOS.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions