Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New StickyIndicator #248

Merged
merged 20 commits into from
Apr 2, 2022
Merged

New StickyIndicator #248

merged 20 commits into from
Apr 2, 2022

Conversation

bdlukaa
Copy link
Owner

@bdlukaa bdlukaa commented Mar 26, 2022

Update StickyNavigationIndicator to match the new Win 11 Design.

Fixes #173
Fixes #178

  • Renamed _NavigationBody to InheritedNavigationView
  • Removed NavigationIndicatorState.sizes. Size, if necessary, can be fetched using LayoutBuilder. offsets is untouched
  • Indicators are now handled inside of PaneItem instead of NavigationPane
  • Indicators are no longer created using a function
  • Added equality operators to NavigationPane

In general, the performance improvement is for both sticker and end indicators, since they no longer depends on global coordiantes to render. This also fixes the issue that the indicator was still shown even if the item was hidden by the pane scroll view.

I know this comes with limitations, but the gains are better than the losses.

Pre-launch Checklist

  • I have updated CHANGELOG.md with my changes
  • I have run "optimize/organize imports" on all changed files
  • I have added/updated relevant documentation

@bdlukaa bdlukaa marked this pull request as ready for review March 28, 2022 18:20
@klondikedragon
Copy link
Contributor

I can confirm with these changes the CPU performance issue is solved for me! Before these changes, even when app was idle but with the navbar displayed, it was in a constant build/render loop... using Chrome devtools to profile webpage performance on web platform, it was using up about 40% of one CPU core:
image

After building using these changes, the CPU usage is 0% and chrome profiling shows no build/render calls with the page idle. I only tested on the web platform, but the results should translate over into other platforms as well...

@bdlukaa bdlukaa merged commit 7c1842a into master Apr 2, 2022
@bdlukaa bdlukaa deleted the sticky-indicator branch April 2, 2022 15:09
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.

🐛 Indicator too tiny for displaymode = top 🐛 High CPU usage for NavigationPane
2 participants