Skip to content

fix(ListView): flicker when repositioning item - #23168

Merged
Xiaoy312 merged 2 commits into
masterfrom
dev/xygu/20260430/listview-move-flicker
May 4, 2026
Merged

Xiaoy312 merged 2 commits into
masterfrom
dev/xygu/20260430/listview-move-flicker

Conversation

@Xiaoy312

@Xiaoy312 Xiaoy312 commented Apr 30, 2026 •

Copy link
Copy Markdown
Contributor

GitHub Issue: closes unoplatform/kahua-private#452

PR Type:

🐞 Bugfix

What changed? 🚀

When moving an item in a ListView, NotifyCollectionChangedAction.Move triggers a full panel refresh. FillLayout materializes new lines, but they are not arranged until the next layout pass. If a render pass occurs between materialization and arrangement, items appear clustered at (0,0) for one frame — visible as a brief flicker of broken layout.

This PR makes FillLayout return the number of lines it added, and forces an immediate OwnerPanel.UpdateLayout() after non-scroll refresh paths when new lines were materialized, ensuring items are arranged before the next render pass.

PR Checklist ✅

Copilot AI review requested due to automatic review settings April 30, 2026 20:29

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR targets a single-frame flicker in ListViewBase virtualization where newly materialized containers briefly render at (0,0) (top-left) after an item move triggers a refresh, by attempting to force layout/arrange immediately after FillLayout adds new lines.

Changes:

  • Changed FillLayout to return the number of newly materialized lines.
  • In non-scroll update paths, attempted to force an immediate layout pass when new lines were added via OwnerPanel.UpdateLayout().

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@ajpinedam ajpinedam left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Being a fix for a visual issue I imagine it's hard/impossible to be tested

@unodevops

Copy link
Copy Markdown
Contributor

@unodevops

Copy link
Copy Markdown
Contributor

⚠️⚠️ The build 210145 has failed on Uno.UI - CI.

OwnerPanel.UpdateLayout() inside VirtualizingPanelLayout.UpdateLayout
can trigger a nested ArrangeOverride which overwrites _availableSize
with a stale viewport height. Restore _availableSize after the call so
EstimatePanelSize uses the correct measure constraint.

Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
@unodevops

Copy link
Copy Markdown
Contributor

@Xiaoy312
Xiaoy312 merged commit b4e6d6d into master May 4, 2026
45 checks passed
@Xiaoy312
Xiaoy312 deleted the dev/xygu/20260430/listview-move-flicker branch May 4, 2026 13:30
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.

4 participants