Skip to content

Commit 5e38467

Browse files
graycreateclaude
andcommitted
feat: add placeholder height for topic content area
Add minimum height placeholder for NewsContentView while content is rendering: - Use full screen height as initial placeholder to hide reply section - Shrink to actual content height when rendering completes - Smooth animation transition using onRenderCompleted callback This prevents layout jumps and hides reply section until content is ready. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
1 parent 6f78e0f commit 5e38467

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

V2er/View/FeedDetail/NewsContentView.swift

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ struct NewsContentView: View {
1717
@State private var navigateToNode: String? = nil
1818
@State private var navigateToBrowserURL: URL? = nil
1919
@State private var navigateToSafariURL: URL? = nil
20+
@State private var contentReady = false
2021

2122
private var useBuiltinBrowser: Bool {
2223
store.appState.settingState.useBuiltinBrowser
@@ -39,8 +40,14 @@ struct NewsContentView: View {
3940
// Open image in SafariView for now
4041
openInSafari(url)
4142
}
43+
.onRenderCompleted { _ in
44+
withAnimation(.easeInOut(duration: 0.2)) {
45+
contentReady = true
46+
}
47+
}
4248
.padding(.horizontal, 12)
4349
.padding(.vertical, 8)
50+
.frame(minHeight: contentReady ? 0 : UIScreen.main.bounds.height)
4451

4552
Divider()
4653
}

0 commit comments

Comments
 (0)