Fix quoted posts not displaying on macOS (#2469)#2472
Open
SameerNadaf wants to merge 1 commit into
Open
Conversation
Wraps the .fixedSize(horizontal: false, vertical: true) modifier on StatusEmbeddedView inside a #if !targetEnvironment(macCatalyst) compile-time guard. This prevents the Spacer() from collapsing the view's height during the desktop layout pass, while keeping iOS behavior completely unchanged. Closes Dimillian#2469
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #2469
Problem
A post that quotes another post does not display the quoted content on macOS (Mac Catalyst), even when Show Quotes is enabled in Content Settings. The same post correctly shows the quoted content on iPhone.
Affected version: 2.1.3 (3244)
Platform: macOS only (iOS works correctly)
Root Cause
The issue is in
StatusRowContentView.swift, whereStatusEmbeddedView(the quoted post widget) had.fixedSize(horizontal: false, vertical: true)applied unconditionally on all platforms.StatusEmbeddedViewhas this layout structure:The
Spacer()inside theHStacktriggers a SwiftUI layout conflict when.fixedSize(horizontal: false, vertical: true)is applied:HStackfor its ideal height assuming infinite widthSpacer()collapses to 0, so text renders as a single lineWhy it works on iOS but not on macOS:
On iOS, UIKit's
UITableView-backedListabsorbs or avoids this measurement conflict. On macOS Catalyst'sNSTableView-backedList, the layout engine applies stricter size measurement semantics that expose the conflict directly.Fix
Wrap the
.fixedSize(horizontal: false, vertical: true)modifier in a compile-time#if !targetEnvironment(macCatalyst)guard, so it is only applied on iOS/visionOS where it is needed:This is applied to both branches in the block — the loaded status and the
.redactedplaceholder shown while loading — to prevent a height jump/pop-in during the loading state.Verification
No side effects:
#ifis compile-time; iOS code path is identicalos(visionOS)blocks are unaffectedStatusRowView.onAppear, independent of this modifier!isCompactcheck prevents recursive embeddingNotificationRowContentViewhad nofixedSizeon itsStatusEmbeddedViewStatusEmbeddedViewin aScrollView, not aListTimelineDatasourcebefore renderingPattern consistency:
#if targetEnvironment(macCatalyst)guards are used 30+ times throughout StatusKit following this exact same pattern (e.g.StatusRowCardView,StatusRowContextMenu,StatusRowActionsView). This fix follows the established convention.Files Changed
Packages/StatusKit/Sources/StatusKit/Row/Subviews/StatusRowContentView.swift— Added#if !targetEnvironment(macCatalyst)compile guard around.fixedSizeonStatusEmbeddedView(4 lines added)