Skip to content

armgit / ente

Public Imported from GitHub
0

πŸ’š End-to-end encrypted cloud for everything.

[mob][photos] Clarify justified tail balancing

ashil-pilotbfe505d2942d
diff --git a/mobile/apps/photos/lib/models/gallery/justified_layout.dart b/mobile/apps/photos/lib/models/gallery/justified_layout.dart
index 7082e0301c..e4ecde1642 100644
--- a/mobile/apps/photos/lib/models/gallery/justified_layout.dart
+++ b/mobile/apps/photos/lib/models/gallery/justified_layout.dart
@@ -282,8 +282,8 @@ class JustifiedLayoutCalculator {
}
}
- // Avoid leaving a single item at the end of a group when the last few
- // items can instead form full-width rows without creating a cramped row.
+ // Product decision: avoid one-item group tails by rebalancing the preceding
+ // row when the replacement rows meet tap-target, height, and density limits.
if (pendingRatios.length == 1 && rows.isNotEmpty) {
final tailRatios = <double>[...lastCommittedRatios, pendingRatios.single];
if (lastCommittedRatios.length < _maximumItemsPerRow &&