From 681ab555b265df2fe9c91fa7eb86ecdab9c07780 Mon Sep 17 00:00:00 2001 From: shilangyu Date: Tue, 6 Apr 2021 15:23:57 +0200 Subject: [PATCH 1/7] Swap instanceHost/username placement, fixes #167 --- lib/pages/manage_account.dart | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/pages/manage_account.dart b/lib/pages/manage_account.dart index 1b4bb21..f7a549f 100644 --- a/lib/pages/manage_account.dart +++ b/lib/pages/manage_account.dart @@ -39,7 +39,7 @@ class ManageAccountPage extends HookWidget { return Scaffold( appBar: AppBar( - title: Text('@$instanceHost@$username'), + title: Text('$username@$instanceHost'), ), body: FutureBuilder( future: userFuture, From c847a3aaa64a8c2bfd95712466ad10226cf997c0 Mon Sep 17 00:00:00 2001 From: shilangyu Date: Tue, 6 Apr 2021 15:39:19 +0200 Subject: [PATCH 2/7] Add more bottom padding for BAB, fixes #174 --- lib/main.dart | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/lib/main.dart b/lib/main.dart index f22dfe7..ebbe6e6 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -94,9 +94,16 @@ class MyHomePage extends HookWidget { return Scaffold( extendBody: true, - body: IndexedStack( - index: currentTab.value, - children: pages, + body: Column( + children: [ + Expanded( + child: IndexedStack( + index: currentTab.value, + children: pages, + ), + ), + const SizedBox(height: kMinInteractiveDimension / 2), + ], ), floatingActionButton: const CreatePostFab(), floatingActionButtonLocation: FloatingActionButtonLocation.centerDocked, From 63486e0c885be095aa9cf610f5f3cc88cf3070f2 Mon Sep 17 00:00:00 2001 From: shilangyu Date: Tue, 6 Apr 2021 15:42:12 +0200 Subject: [PATCH 3/7] Make text selectable when writing comments, fixes #157 --- lib/widgets/write_comment.dart | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/lib/widgets/write_comment.dart b/lib/widgets/write_comment.dart index 6e82513..7044f2f 100644 --- a/lib/widgets/write_comment.dart +++ b/lib/widgets/write_comment.dart @@ -31,13 +31,17 @@ class WriteComment extends HookWidget { final body = () { final text = comment?.content ?? post.body; if (text == null) return const SizedBox.shrink(); - return MarkdownText(text, instanceHost: post.instanceHost); + return MarkdownText( + text, + instanceHost: post.instanceHost, + selectable: true, + ); }(); if (post != null) { return Column( children: [ - Text( + SelectableText( post.name, style: const TextStyle(fontSize: 15, fontWeight: FontWeight.w600), ), From 3609570df840fc27e1459670b92383b1b42d5e26 Mon Sep 17 00:00:00 2001 From: shilangyu Date: Tue, 6 Apr 2021 15:48:56 +0200 Subject: [PATCH 4/7] Make post body selectable, fixes #190 --- lib/widgets/post.dart | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/lib/widgets/post.dart b/lib/widgets/post.dart index 39f17a2..0e27866 100644 --- a/lib/widgets/post.dart +++ b/lib/widgets/post.dart @@ -415,9 +415,13 @@ class PostWidget extends HookWidget { linkPreview(), if (post.post.body != null && fullPost) Padding( - padding: const EdgeInsets.all(10), - child: MarkdownText(post.post.body, - instanceHost: instanceHost)), + padding: const EdgeInsets.all(10), + child: MarkdownText( + post.post.body, + instanceHost: instanceHost, + selectable: true, + ), + ), if (post.post.body != null && !fullPost) LayoutBuilder( builder: (context, constraints) { From fba51bb3647366e39e1c1faec0309c1f20b05182 Mon Sep 17 00:00:00 2001 From: shilangyu Date: Tue, 6 Apr 2021 15:52:59 +0200 Subject: [PATCH 5/7] Update changelog --- CHANGELOG.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6484909..3e623ad 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,8 @@ ### Fixed - Some actions would pass the wrong user id around causing infinite spinners, this is now fixed +- When writing a comment the parent text is now selectable +- Text of a post is now selectable ## v0.4.0 - 2021-04-05 From d2dd3882287aa3f920223ad42b0a90b4c7c86861 Mon Sep 17 00:00:00 2001 From: shilangyu Date: Tue, 6 Apr 2021 16:06:07 +0200 Subject: [PATCH 6/7] Disable commenting on locked posts, fixes #159 --- lib/pages/full_post.dart | 9 ++++++--- lib/widgets/comment.dart | 4 +++- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/lib/pages/full_post.dart b/lib/pages/full_post.dart index dc8ca1e..3986224 100644 --- a/lib/pages/full_post.dart +++ b/lib/pages/full_post.dart @@ -115,9 +115,12 @@ class FullPostPage extends HookWidget { onPressed: () => PostWidget.showMoreMenu(context, post)), ], ), - floatingActionButton: FloatingActionButton( - onPressed: loggedInAction((_) => comment()), - child: const Icon(Icons.comment)), + floatingActionButton: post.post.locked + ? null + : FloatingActionButton( + onPressed: loggedInAction((_) => comment()), + child: const Icon(Icons.comment), + ), body: RefreshIndicator( onRefresh: refresh, child: ListView( diff --git a/lib/widgets/comment.dart b/lib/widgets/comment.dart index a4577a6..57304ad 100644 --- a/lib/widgets/comment.dart +++ b/lib/widgets/comment.dart @@ -297,7 +297,9 @@ class CommentWidget extends HookWidget { tooltip: L10n.of(context).more, ), _SaveComment(commentTree.comment), - if (!isDeleted.value && !comment.comment.removed) + if (!isDeleted.value && + !comment.comment.removed && + !comment.post.locked) TileAction( icon: Icons.reply, onPressed: loggedInAction((_) => reply()), From b35507c3ad68a01c1936df581e3146a7f8d52266 Mon Sep 17 00:00:00 2001 From: shilangyu Date: Tue, 6 Apr 2021 16:07:25 +0200 Subject: [PATCH 7/7] Update changelog --- CHANGELOG.md | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 3e623ad..ef40cc9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,10 +1,19 @@ +## Unreleased + +### Changed + +- Disable commenting on locked posts + +### Fixed + +- When writing a comment the parent text is now selectable +- Text of a post is now selectable + ## v0.4.1 - 2021-04-06 ### Fixed - Some actions would pass the wrong user id around causing infinite spinners, this is now fixed -- When writing a comment the parent text is now selectable -- Text of a post is now selectable ## v0.4.0 - 2021-04-05