From e7e40d3a9090a90e800552ddecee53e29806e665 Mon Sep 17 00:00:00 2001 From: Aleksei Savin Date: Sun, 14 Jun 2026 02:13:19 +0300 Subject: [PATCH] fix: keep compact rail clean with my story --- .../ChatListUI/Sources/ChatListControllerNode.swift | 9 +++------ .../Sources/StoryPeerListComponent.swift | 3 ++- 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/submodules/ChatListUI/Sources/ChatListControllerNode.swift b/submodules/ChatListUI/Sources/ChatListControllerNode.swift index cf0d4d1127..c31bcf8a32 100644 --- a/submodules/ChatListUI/Sources/ChatListControllerNode.swift +++ b/submodules/ChatListUI/Sources/ChatListControllerNode.swift @@ -1501,8 +1501,7 @@ final class ChatListControllerNode: ASDisplayNode, ASGestureRecognizerDelegate { var navigationHeaderPanels: AnyComponent? if self.controller?.tabContainerData != nil || !panels.isEmpty { var tabs: AnyComponent? - let hasFolderTabs = (self.controller?.tabContainerData?.0.count ?? 0) > 1 - let isDesktopLikeCompactSidebar = layout.deviceMetrics.type == .tablet && layout.size.width <= 160.0 && !hasFolderTabs + let isDesktopLikeCompactSidebar = layout.deviceMetrics.type == .tablet && layout.size.width <= 160.0 if let tabContainerData = self.controller?.tabContainerData, tabContainerData.0.count > 1, !isDesktopLikeCompactSidebar { let folderFilterIndex: (ChatListFilterTabEntryId, [ChatListFilterTabEntry]) -> Int? = { id, entries in var index = 0 @@ -1657,9 +1656,7 @@ final class ChatListControllerNode: ASDisplayNode, ASGestureRecognizerDelegate { } } - let hasFolderTabs = (self.controller?.tabContainerData?.0.count ?? 0) > 1 - let isCompactAvatarRail = layout.deviceMetrics.type == .tablet && layout.size.width <= 160.0 - let isDesktopLikeCompactSidebar = isCompactAvatarRail && !hasFolderTabs + let isDesktopLikeCompactSidebar = layout.deviceMetrics.type == .tablet && layout.size.width <= 160.0 if isDesktopLikeCompactSidebar { if let navigationBarComponentView = self.navigationBarView.view as? ChatListNavigationBar.View { navigationBarComponentView.isHidden = true @@ -1676,7 +1673,7 @@ final class ChatListControllerNode: ASDisplayNode, ASGestureRecognizerDelegate { strings: self.presentationData.strings, statusBarHeight: layout.statusBarHeight ?? 0.0, sideInset: layout.safeInsets.left, - search: ChatListNavigationBar.Search(isEnabled: !isCompactAvatarRail), + search: ChatListNavigationBar.Search(isEnabled: true), activeSearch: self.isSearchDisplayControllerActive, primaryContent: headerContent?.primaryContent, secondaryContent: headerContent?.secondaryContent, diff --git a/submodules/TelegramUI/Components/Stories/StoryPeerListComponent/Sources/StoryPeerListComponent.swift b/submodules/TelegramUI/Components/Stories/StoryPeerListComponent/Sources/StoryPeerListComponent.swift index 0b19bc56fc..5e5238bfa7 100644 --- a/submodules/TelegramUI/Components/Stories/StoryPeerListComponent/Sources/StoryPeerListComponent.swift +++ b/submodules/TelegramUI/Components/Stories/StoryPeerListComponent/Sources/StoryPeerListComponent.swift @@ -1145,7 +1145,8 @@ public final class StoryPeerListComponent: Component { unseenCount = itemSet.unseenCount var composeContentOffset: CGFloat? - if peer.id == component.context.account.peerId && collapsedState.sideAlphaFraction == 1.0 && self.scrollView.contentOffset.x < 0.0 { + let isCompactAvatarRail = itemLayout.containerSize.width <= 120.0 + if !isCompactAvatarRail && peer.id == component.context.account.peerId && collapsedState.sideAlphaFraction == 1.0 && self.scrollView.contentOffset.x < 0.0 { composeContentOffset = self.scrollView.contentOffset.x * -1.0 }