Skip to content

Improve layout performance across components#797

Draft
Copilot wants to merge 3 commits intomainfrom
copilot/improve-layout-performance-components
Draft

Improve layout performance across components#797
Copilot wants to merge 3 commits intomainfrom
copilot/improve-layout-performance-components

Conversation

Copy link
Contributor

Copilot AI commented Feb 27, 2026

Description of Change

Layout performance audit and optimization across high-frequency components. Key changes:

AlertView – eliminate layout thrashing in OnSizeAllocated

  • Skip recalculation when width hasn't changed (tracked via m_lastAllocatedWidth)
  • Replace Remove/Add cycle with Grid.SetColumn/Grid.SetRow repositioning — avoids expensive platform handler disconnect/reconnect on every size pass
  • Remove Android InvalidateMeasure() workaround (no longer needed)
  • Temporarily hide buttons during measurement for accurate width calculation without the old remove-then-re-add pattern

ListItem – stop recreating dividers on every property change

  • Previously, toggling HasTopDivider/HasBottomDivider (including to false) created a new Divider, removed the old one, and re-added — happening twice per VerticalStackLayout size change in auto-divider mode
  • Now creates each divider once lazily, toggles IsVisible

Tab (iOS) – flatten nested layout containers

  • Replaced VerticalStackLayout > HorizontalStackLayout > Labels (5 levels deep) with a single Grid using Star/Auto/Auto/Star columns for centering. Nesting reduced from 5 to 3 levels, eliminating two measure+arrange passes.

InputTransparent on decorative elements

  • ListItem: icon image, title/subtitle container
  • NavigationListItem: arrow icon
  • AlertView: alert type icon
  • BottomSheetHeader: back button image

Todos

  • I have tested on an Android device.
  • I have tested on an iOS device.
  • I have supported accessibility

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • dl.google.com
    • Triggering command: /usr/bin/dotnet dotnet build src/library/DIPS.Mobile.UI/DIPS.Mobile.UI.csproj -f net10.0-android /p:TargetFrameworks=net10.0-android /usr/bin/chmod /usr/bin/chmod acy/getpagesize./usr/bin/chmod /usr/bin/chmod /usr/bin/chmod /usr/bin/chmod 755 4-10.0.3-extracted/tools/emscripten/system/include/emscripten/threading_legacy.h /usr/bin/chmod /usr/bin/chmod ernal/progname.c/usr/bin/chmod /usr/bin/chmod /usr/bin/chmod /usr/bin/chmod (dns block)

If you need me to access, download, or install something from one of these locations, you can either:


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

Copilot AI and others added 2 commits February 27, 2026 15:29
- AlertView: Skip redundant OnSizeAllocated, use Grid.SetRow/SetColumn instead of Remove/Add
- ListItem: Create dividers once and toggle IsVisible instead of recreating on property changes
- ListItem: Add InputTransparent to decorative icon and title/subtitle container
- NavigationListItem: Add InputTransparent to decorative arrow icon
- BottomSheetHeader: Add InputTransparent to decorative back button image
- AlertView: Add InputTransparent to decorative icon
- Tab (iOS): Flatten nested VerticalStackLayout + HorizontalStackLayout to single Grid

Co-authored-by: Vetle444 <35739538+Vetle444@users.noreply.github.com>
Co-authored-by: Vetle444 <35739538+Vetle444@users.noreply.github.com>
Copilot AI changed the title [WIP] Research methods to increase layout performance in components Improve layout performance across components Feb 27, 2026
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.

2 participants