From 2c152aeca321b208e96bdec42647d5cc36edafcd Mon Sep 17 00:00:00 2001 From: krawieck Date: Sat, 16 Jan 2021 15:20:30 +0100 Subject: [PATCH 1/4] add more properties to nerd stuff --- lib/widgets/comment.dart | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/lib/widgets/comment.dart b/lib/widgets/comment.dart index 70d4f0b1..4d62522e 100644 --- a/lib/widgets/comment.dart +++ b/lib/widgets/comment.dart @@ -47,7 +47,25 @@ class Comment extends HookWidget { final com = commentTree.comment; showInfoTablePopup(context, { 'id': com.id, + 'creatorId': com.creatorId, + 'postId': com.postId, + 'postName': com.postName, + 'parentId': com.parentId, + 'removed': com.removed, + 'read': com.read, + 'published': com.published, + 'updated': com.updated, + 'deleted': com.deleted, 'apId': com.apId, + 'local': com.local, + 'communityId': com.communityId, + 'communityActorId': com.communityActorId, + 'communityLocal': com.communityLocal, + 'communityName': com.communityName, + 'communityIcon': com.communityIcon, + 'banned': com.banned, + 'bannedFromCommunity': com.bannedFromCommunity, + 'creatorActirId': com.creatorActorId, 'userId': com.userId, 'upvotes': com.upvotes, 'downvotes': com.downvotes, @@ -55,8 +73,6 @@ class Comment extends HookWidget { '% of upvotes': '${100 * (com.upvotes / (com.upvotes + com.downvotes))}%', 'hotRank': com.hotRank, 'hotRankActive': com.hotRankActive, - 'published': com.published, - 'updated': com.updated, }); } From ccedb352595ae44dfe097cdf26640d31d9d68640 Mon Sep 17 00:00:00 2001 From: krawieck Date: Sat, 16 Jan 2021 15:20:49 +0100 Subject: [PATCH 2/4] add button for going to post --- lib/widgets/comment.dart | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/lib/widgets/comment.dart b/lib/widgets/comment.dart index 4d62522e..c45d6b96 100644 --- a/lib/widgets/comment.dart +++ b/lib/widgets/comment.dart @@ -25,6 +25,7 @@ class Comment extends HookWidget { final int indent; final int postCreatorId; final CommentTree commentTree; + final bool detatched; final bool wasVoted; @@ -40,6 +41,7 @@ class Comment extends HookWidget { this.commentTree, { this.indent = 0, @required this.postCreatorId, + this.detatched = false, }) : wasVoted = (commentTree.comment.myVote ?? VoteType.none) != VoteType.none; @@ -279,6 +281,14 @@ class Comment extends HookWidget { content: Text('comment copied to clipboard')))); }), const Spacer(), + if (detatched) + _CommentAction( + icon: Icons.link, + // onPressed: () {}, + onPressed: () => + goToPost(context, comment.instanceHost, comment.postId), + tooltip: 'go to post', + ), _CommentAction( icon: Icons.more_horiz, onPressed: () => _openMoreMenu(context), From 904e320e10903ee8a76f637abd8dbf3146127d29 Mon Sep 17 00:00:00 2001 From: krawieck Date: Sat, 16 Jan 2021 15:21:09 +0100 Subject: [PATCH 3/4] make all comments in infinitecommentlist detatched --- lib/widgets/sortable_infinite_list.dart | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/widgets/sortable_infinite_list.dart b/lib/widgets/sortable_infinite_list.dart index 75764f8f..a02745ed 100644 --- a/lib/widgets/sortable_infinite_list.dart +++ b/lib/widgets/sortable_infinite_list.dart @@ -75,6 +75,7 @@ class InfiniteCommentList extends StatelessWidget { builder: (comment) => Comment( CommentTree(comment), postCreatorId: null, + detatched: true, ), fetcher: fetcher, ); From 96d6c36fe91ffbbbd0524f7794040fb17af4f4de Mon Sep 17 00:00:00 2001 From: krawieck Date: Sat, 16 Jan 2021 16:32:45 +0100 Subject: [PATCH 4/4] fixes requested in code review * "detatched" -> "detached" * remove debug comment --- lib/widgets/comment.dart | 7 +++---- lib/widgets/sortable_infinite_list.dart | 2 +- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/lib/widgets/comment.dart b/lib/widgets/comment.dart index c45d6b96..ec45e3f5 100644 --- a/lib/widgets/comment.dart +++ b/lib/widgets/comment.dart @@ -25,7 +25,7 @@ class Comment extends HookWidget { final int indent; final int postCreatorId; final CommentTree commentTree; - final bool detatched; + final bool detached; final bool wasVoted; @@ -41,7 +41,7 @@ class Comment extends HookWidget { this.commentTree, { this.indent = 0, @required this.postCreatorId, - this.detatched = false, + this.detached = false, }) : wasVoted = (commentTree.comment.myVote ?? VoteType.none) != VoteType.none; @@ -281,10 +281,9 @@ class Comment extends HookWidget { content: Text('comment copied to clipboard')))); }), const Spacer(), - if (detatched) + if (detached) _CommentAction( icon: Icons.link, - // onPressed: () {}, onPressed: () => goToPost(context, comment.instanceHost, comment.postId), tooltip: 'go to post', diff --git a/lib/widgets/sortable_infinite_list.dart b/lib/widgets/sortable_infinite_list.dart index a02745ed..e313f517 100644 --- a/lib/widgets/sortable_infinite_list.dart +++ b/lib/widgets/sortable_infinite_list.dart @@ -75,7 +75,7 @@ class InfiniteCommentList extends StatelessWidget { builder: (comment) => Comment( CommentTree(comment), postCreatorId: null, - detatched: true, + detached: true, ), fetcher: fetcher, );