Skip to content

perf(motion): offstage inactive workspace layers in QueryaSwitchingBody to prevent redundant layout (#901) - #954

Merged
ZhuchkaTriplesix merged 1 commit into
devfrom
issue/901-querya-switching-body-offstage
Sep 25, 2026
Merged

ZhuchkaTriplesix merged 1 commit into
devfrom
issue/901-querya-switching-body-offstage

Conversation

@ZhuchkaTriplesix

Copy link
Copy Markdown
Member

Closes #901

Summary

  • Converted _SwitchingLayer in QueryaSwitchingBody into a StatefulWidget that hides inactive children via Offstage(offstage: _offstage) once their opacity exit transition completes (or immediately if duration is instant/zero).
  • When a layer becomes active again or is updated while active, _offstage is immediately set to false so enter interpolation, layout, and painting proceed smoothly.
  • State preservation (scroll positions, text editing drafts, focus, widget state) is fully maintained across index switches while avoiding redundant layout passes on inactive complex workspaces.
  • Added comprehensive unit tests in querya_switching_body_test.dart verifying Offstage lifecycle transitions, exit animation visibility, and scroll/text draft state preservation.

@github-actions github-actions Bot added performance Theme parser epic label: performance motion Animation system, transitions, motion tokens labels Sep 25, 2026
@github-actions github-actions Bot added this to the 0.4.18 milestone Sep 25, 2026
@ZhuchkaTriplesix
ZhuchkaTriplesix merged commit 5ec5b91 into dev Sep 25, 2026
3 checks passed
@ZhuchkaTriplesix
ZhuchkaTriplesix deleted the issue/901-querya-switching-body-offstage branch September 28, 2026 08:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

motion Animation system, transitions, motion tokens performance Theme parser epic label: performance

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant