Main coves client
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

feat: add dual comment button behavior in post action bar

Split comment button functionality into two separate actions:
- Left button (comment input field): Opens reply composer
- Right button (comment count): Scrolls to comments section

This provides contextual behavior - users can either write a new
comment or quickly navigate to view existing comments.

Changes:
- Add onCommentInputTap and onCommentCountTap callbacks
- Maintain backward compatibility with deprecated onCommentTap
- Update documentation to clarify each button's purpose

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

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

+16 -4
+16 -4
lib/widgets/post_action_bar.dart
··· 10 10 /// Bottom bar with comment input and action buttons (vote, save, 11 11 /// comment count). 12 12 /// Displays: 13 - /// - Comment input field 13 + /// - Comment input field (opens composer when tapped) 14 14 /// - Heart icon with vote count 15 15 /// - Star icon with save count 16 - /// - Comment bubble icon with comment count 16 + /// - Comment bubble icon with comment count (scrolls to comments when tapped) 17 17 class PostActionBar extends StatelessWidget { 18 18 const PostActionBar({ 19 19 required this.post, 20 20 this.onCommentTap, 21 + this.onCommentInputTap, 22 + this.onCommentCountTap, 21 23 this.onVoteTap, 22 24 this.onSaveTap, 23 25 this.isVoted = false, ··· 26 28 }); 27 29 28 30 final FeedViewPost post; 31 + 32 + /// Deprecated: Use onCommentInputTap and onCommentCountTap instead 29 33 final VoidCallback? onCommentTap; 34 + 35 + /// Callback when comment input field is tapped (typically opens composer) 36 + final VoidCallback? onCommentInputTap; 37 + 38 + /// Callback when comment count button is tapped (typically scrolls to 39 + /// comments) 40 + final VoidCallback? onCommentCountTap; 41 + 30 42 final VoidCallback? onVoteTap; 31 43 final VoidCallback? onSaveTap; 32 44 final bool isVoted; ··· 49 61 // Comment input field 50 62 Expanded( 51 63 child: GestureDetector( 52 - onTap: onCommentTap, 64 + onTap: onCommentInputTap ?? onCommentTap, 53 65 child: Container( 54 66 height: 40, 55 67 padding: const EdgeInsets.symmetric(horizontal: 12), ··· 121 133 _ActionButton( 122 134 icon: Icons.chat_bubble_outline, 123 135 count: post.post.stats.commentCount, 124 - onTap: onCommentTap, 136 + onTap: onCommentCountTap ?? onCommentTap, 125 137 ), 126 138 ], 127 139 ),