Skip to content

fix(macOS): coalesce composer menu refreshes and remove withAnimation wrappers#24337

Merged
siddseethepalli merged 1 commit into
mainfrom
sidd/composer-menu-refresh-scheduler
Apr 8, 2026
Merged

fix(macOS): coalesce composer menu refreshes and remove withAnimation wrappers#24337
siddseethepalli merged 1 commit into
mainfrom
sidd/composer-menu-refresh-scheduler

Conversation

@siddseethepalli
Copy link
Copy Markdown
Contributor

Summary

  • Introduce ComposerMenuRefreshScheduler to coalesce rapid onChange firings into a single deferred menu-state update, eliminating redundant work when inputText and cursorPosition change together
  • Remove all withAnimation(VAnimation.fast) wrappers from emoji picker and slash command menu state toggles — the animations were causing layout thrash and are no longer needed with the coalesced scheduler
  • Remove .animation(VAnimation.fast, value:) modifiers from the composer VStack since menu visibility changes are now immediate

… wrappers

Replace direct withAnimation(VAnimation.fast) wrappers on emoji/slash menu
state toggles with a ComposerMenuRefreshScheduler that defers updates to
the next run-loop tick. This coalesces rapid onChange firings (e.g. from
inputText + cursorPosition changing together) into a single menu state
update, eliminating redundant SwiftUI animation cycles and preventing
potential layout thrash.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@siddseethepalli siddseethepalli merged commit dd947af into main Apr 8, 2026
@siddseethepalli siddseethepalli deleted the sidd/composer-menu-refresh-scheduler branch April 8, 2026 17:29
noanflaherty pushed a commit that referenced this pull request Apr 8, 2026
… wrappers (#24337)

Replace direct withAnimation(VAnimation.fast) wrappers on emoji/slash menu
state toggles with a ComposerMenuRefreshScheduler that defers updates to
the next run-loop tick. This coalesces rapid onChange firings (e.g. from
inputText + cursorPosition changing together) into a single menu state
update, eliminating redundant SwiftUI animation cycles and preventing
potential layout thrash.

Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant