feat(post): support optimistic post navigation

Add isOptimistic flag to PostDetailScreen to skip initial comment
loading for newly created posts that haven't been indexed yet.

Also adds AlwaysScrollableScrollPhysics for consistent pull-to-refresh.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>

Changed files
+13 -3
lib
+13 -3
lib/screens/home/post_detail_screen.dart
···
/// - Loading, empty, and error states
/// - Automatic comment loading on screen init
class PostDetailScreen extends StatefulWidget {
-
const PostDetailScreen({required this.post, super.key});
+
const PostDetailScreen({required this.post, this.isOptimistic = false, super.key});
/// Post to display (passed via route extras)
final FeedViewPost post;
+
+
/// Whether this is an optimistic post (just created, not yet indexed)
+
/// When true, skips initial comment load since we know there are no comments
+
final bool isOptimistic;
@override
State<PostDetailScreen> createState() => _PostDetailScreenState();
···
// Listen for changes to trigger rebuilds
_commentsProvider.addListener(_onProviderChanged);
-
// Check if we already have cached data
-
if (_commentsProvider.comments.isNotEmpty) {
+
// Skip loading for optimistic posts (just created, not yet indexed)
+
if (widget.isOptimistic) {
+
if (kDebugMode) {
+
debugPrint('✨ Optimistic post - skipping initial comment load');
+
}
+
// Don't load comments - there won't be any yet
+
} else if (_commentsProvider.comments.isNotEmpty) {
// Already have data - restore scroll position immediately
if (kDebugMode) {
debugPrint(
···
color: AppColors.primary,
child: CustomScrollView(
controller: _scrollController,
+
physics: const AlwaysScrollableScrollPhysics(),
slivers: [
// Floating app bar that hides on scroll down,
// shows on scroll up