feat: improve post detail screen UX and navigation

Enhance post detail screen with better organization and interaction:

Comment Navigation:
- Wire up dual comment button behavior:
- Input field opens reply composer
- Comment count button scrolls to comments section
- Add _scrollToComments() method with smooth animation
- Uses GlobalKey on CommentsHeader for precise scrolling

Visual Improvements:
- Add 1px border divider before comments section
- Replace blank spacing with clear visual separator
- Matches feed/comment divider styling for consistency
- 16px vertical margins for breathing room

Content Organization:
- Enable author footer in detail view (showAuthorFooter: true)
- Shows author info and timestamp above post title
- Enhanced typography: 20px title, 16px text, 1.6 line height
- Larger embeds (280px) for better content visibility

Changes:
- Add _commentsHeaderKey GlobalKey for scroll targeting
- Add _scrollToComments() method with Scrollable.ensureVisible
- Use onCommentInputTap and onCommentCountTap callbacks
- Add Container divider with AppColors.border
- Enable showAuthorFooter parameter

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

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

Changed files
+31 -1
lib
+31 -1
lib/screens/home/post_detail_screen.dart
···
class _PostDetailScreenState extends State<PostDetailScreen> {
final ScrollController _scrollController = ScrollController();
+
final GlobalKey _commentsHeaderKey = GlobalKey();
// Current sort option
String _currentSort = 'hot';
···
return PostActionBar(
post: displayPost,
isVoted: isVoted,
-
onCommentTap: _openCommentComposer,
+
onCommentInputTap: _openCommentComposer,
+
onCommentCountTap: _scrollToComments,
onVoteTap: () async {
// Check authentication
final authProvider = context.read<AuthProvider>();
···
);
},
);
+
}
+
+
/// Scroll to the comments section
+
void _scrollToComments() {
+
final context = _commentsHeaderKey.currentContext;
+
if (context != null) {
+
Scrollable.ensureVisible(
+
context,
+
duration: const Duration(milliseconds: 300),
+
curve: Curves.easeInOut,
+
);
+
}
}
/// Open the reply screen for composing a comment
···
currentTimeNotifier:
commentsProvider.currentTimeNotifier,
),
+
+
// Visual divider before comments section
+
Container(
+
margin: const EdgeInsets.symmetric(vertical: 16),
+
height: 1,
+
color: AppColors.border,
+
),
+
// Comments header with sort dropdown
CommentsHeader(
+
key: _commentsHeaderKey,
commentCount: comments.length,
currentSort: _currentSort,
onSortChanged: _onSortChanged,
···
showActions: false,
showHeader: false,
showBorder: false,
+
showFullText: true,
+
showAuthorFooter: true,
+
textFontSize: 16,
+
textLineHeight: 1.6,
+
embedHeight: 280,
+
titleFontSize: 20,
+
titleFontWeight: FontWeight.w600,
);
},
);