Skip to content

Commit fa35cb8

Browse files
committed
Fix
1 parent 268d6ba commit fa35cb8

1 file changed

Lines changed: 5 additions & 4 deletions

File tree

‎submodules/AttachmentUI/Sources/AttachmentPanel.swift‎

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2525,11 +2525,12 @@ final class AttachmentPanel: ASDisplayNode, ASScrollViewDelegate, ASGestureRecog
25252525
self.updateViews(transition: .immediate)
25262526

25272527
let glassPanelHeight: CGFloat = 62.0
2528+
let shouldCollapseTabRow = buttons.count == 1 || hideButtons
25282529
var bounds = CGRect(origin: CGPoint(), size: CGSize(width: layout.size.width, height: topAccessoryHeight + self.buttonSize.height + insets.bottom))
25292530
// With a single tab the button chips are removed entirely (see updateViews), so the button row is
2530-
// dead space: collapse it. When there's a media-accessory panel the bar shrinks to just that panel;
2531-
// with no accessory (topAccessoryHeight == 0) the whole panel collapses to zero.
2532-
if buttons.count == 1 || hideButtons {
2531+
// dead space. Keep its layout height while an action button is visible, since the action button uses
2532+
// that space even though the tab row itself remains hidden.
2533+
if shouldCollapseTabRow && !isAnyButtonVisible {
25332534
bounds.size.height -= self.buttonSize.height
25342535
}
25352536
var mediaAccessoryPanelFrame: CGRect?
@@ -2577,7 +2578,7 @@ final class AttachmentPanel: ASDisplayNode, ASScrollViewDelegate, ASGestureRecog
25772578

25782579
let basePanelHeight = isSelecting ? max(0.0, visualTextPanelHeight - 11.0) : glassPanelHeight
25792580
var panelSize = CGSize(width: isSelecting ? textPanelWidth : buttonsPanelWidth, height: basePanelHeight + topAccessoryHeight)
2580-
if !isSelecting && (buttons.count == 1 || hideButtons) {
2581+
if !isSelecting && shouldCollapseTabRow {
25812582
// Collapse the empty button row to the accessory height (zero when there's no accessory panel),
25822583
// so a single-tab picker doesn't render an empty glass bar.
25832584
panelSize.height = topAccessoryHeight

0 commit comments

Comments
 (0)