Skip sidebar overlap when there is no remainingWidth, so it can’t produce nonpositive cell widths.

This commit is contained in:
Brent Simmons committed 2026-08-07 10:00:34 -07:00
1 parent 2dc650d449
commit d46e36d7dd
1 file changed
+3 -1
@@ -844,9 +844,11 @@ private extension MainTimelineModernViewController {
/// Note to future self: apply insets that affect cell width
/// calculations (leading swipe actions with sidebar visible)
let sidebarOverlapWidth = layoutEnvironment.container.contentInsets.leading
let remainingWidth = layoutEnvironment.container.effectiveContentSize.width - sidebarOverlapWidth
section.contentInsets = NSDirectionalEdgeInsets(
top: 0,
leading: layoutEnvironment.container.contentInsets.leading, // Sidebar width
leading: remainingWidth > 0 ? sidebarOverlapWidth : 0,
bottom: 0,
trailing: 0
)