Merge "Add new heuristic for deciding whether we should add extra rows on grid migration to the bottom or top of the grid" into main