From 5fb573e5f51b4cf7c646c8dfd0c54fdc382deae0 Mon Sep 17 00:00:00 2001 From: Hank Grabowski Date: Fri, 30 Aug 2024 22:46:14 -0400 Subject: [PATCH 1/5] Reduce padding of network capabilities table and put in horizontal scroll if overflowing Fixes Issue #102 --- CHANGELOG.md | 2 ++ lib/screens/settings_screen.dart | 22 ++++++++++++++-------- 2 files changed, 16 insertions(+), 8 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 660cdc3..bbd0621 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,8 @@ * Use the network data in the friendica extensions rather than the application data if available since the app data is the app name. * Fixes + * Fixes final column of network settings getting chopped off on smaller + screens ([Issue #102](https://gitlab.com/mysocialportal/relatica/-/issues/102)) * New Features * Focus Mode with ability to set duration and difficulty for unlocking beforehand. Focus mode in this release shows only the "My Posts" timeline and no bottom navigation bar. So one can't get to search, notifications, diff --git a/lib/screens/settings_screen.dart b/lib/screens/settings_screen.dart index e358eb0..8c84803 100644 --- a/lib/screens/settings_screen.dart +++ b/lib/screens/settings_screen.dart @@ -229,14 +229,20 @@ class NetworkCapabilitiesWidget extends StatelessWidget { ), ], ), - subtitle: DataTable( - columns: const [ - DataColumn(label: Text('Network')), - DataColumn(label: Text('React')), - DataColumn(label: Text('Reshare')), - DataColumn(label: Text('Comment')), - ], - rows: rows, + subtitle: SingleChildScrollView( + scrollDirection: Axis.horizontal, + child: DataTable( + columnSpacing: 10.0, + columns: const [ + DataColumn( + label: Text('Network'), + ), + DataColumn(label: Text('React')), + DataColumn(label: Text('Reshare')), + DataColumn(label: Text('Comment')), + ], + rows: rows, + ), )); } } From 487c8a04fe5a95de448166da899ed8e17ef90c6e Mon Sep 17 00:00:00 2001 From: Hank Grabowski Date: Sat, 31 Aug 2024 14:36:05 -0400 Subject: [PATCH 2/5] Updates to CHANGELOG.md --- CHANGELOG.md | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index bbd0621..4fa2f7f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,8 +11,10 @@ * New Features * Focus Mode with ability to set duration and difficulty for unlocking beforehand. Focus mode in this release shows only the "My Posts" timeline and no bottom navigation bar. So one can't get to search, notifications, - contacts, etc. One can create new posts, comments, and edits to those things though. - * Shows the Circles, Groups, and Channels timelines if connected to a Friendica server running 2024.08 or later. + contacts, etc. One can create new posts, comments, and edits to those things + though. ([Feature #95](https://gitlab.com/mysocialportal/relatica/-/issues/95)) + * Shows the Circles, Groups, and Channels timelines if connected to a Friendica server running 2024.08 or + later.([Feature #108](https://gitlab.com/mysocialportal/relatica/-/issues/108)) ## Version 0.11.0 (beta) From 12e811c947c50f98c420dec5450fd1a99f0df2cd Mon Sep 17 00:00:00 2001 From: Hank Grabowski Date: Sat, 31 Aug 2024 16:17:46 -0400 Subject: [PATCH 3/5] Fix D* image loading issue by adding client headers to requests for image Fixes Issue #105 --- lib/controls/html_text_viewer_control.dart | 29 ++++++++++++++++++++++ pubspec.lock | 4 +-- pubspec.yaml | 2 +- 3 files changed, 32 insertions(+), 3 deletions(-) diff --git a/lib/controls/html_text_viewer_control.dart b/lib/controls/html_text_viewer_control.dart index eed9ed0..aaa64ba 100644 --- a/lib/controls/html_text_viewer_control.dart +++ b/lib/controls/html_text_viewer_control.dart @@ -1,9 +1,12 @@ import 'dart:async'; +import 'package:cached_network_image/cached_network_image.dart'; import 'package:flutter/material.dart'; import 'package:flutter_widget_from_html_core/flutter_widget_from_html_core.dart'; import 'package:html/dom.dart' as dom; +import '../globals.dart'; + const _emojiSize = {'width': '20px', 'height': '20px', 'margin-left': '-3px'}; class HtmlTextViewerControl extends StatelessWidget { @@ -17,6 +20,7 @@ class HtmlTextViewerControl extends StatelessWidget { Widget build(BuildContext context) { return HtmlWidget( content, + factoryBuilder: () => MyWidgetFactory(), customStylesBuilder: _defaultStylesBuilder, onTapUrl: onTapUrl, ); @@ -30,3 +34,28 @@ class HtmlTextViewerControl extends StatelessWidget { return null; } } + +class MyWidgetFactory extends WidgetFactory { + @override + Widget? buildImageWidget(BuildMetadata meta, ImageSource src) { + final url = src.url; + if (!url.startsWith(RegExp('https?://'))) { + return super.buildImageWidget(meta, src); + } + + Map headers = {'user-agent': userAgent}; + + return CachedNetworkImage( + httpHeaders: headers, + errorWidget: (context, _, error) => + onErrorBuilder(context, meta, error, src) ?? widget0, + fit: BoxFit.fill, + imageUrl: url, + progressIndicatorBuilder: (context, _, progress) { + final t = progress.totalSize; + final v = t != null && t > 0 ? progress.downloaded / t : null; + return onLoadingBuilder(context, meta, v, src) ?? widget0; + }, + ); + } +} diff --git a/pubspec.lock b/pubspec.lock index 7f17bce..c37f5b5 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -556,10 +556,10 @@ packages: dependency: "direct main" description: name: flutter_widget_from_html_core - sha256: df7c7c9e5ea144f7ab0adfbad733b4d4f7d408ab733c94e6e9fdcb327af92aa1 + sha256: b1048fd119a14762e2361bd057da608148a895477846d6149109b2151d2f7abf url: "https://pub.dev" source: hosted - version: "0.15.1" + version: "0.15.2" freezed_annotation: dependency: transitive description: diff --git a/pubspec.yaml b/pubspec.yaml index 9a57157..93d8bab 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -24,7 +24,7 @@ dependencies: flutter_secure_storage: ^9.2.2 flutter_svg: ^2.0.10+1 flutter_web_auth_2: ^3.1.2 - flutter_widget_from_html_core: ^0.15.1 + flutter_widget_from_html_core: ^0.15.2 get_it: ^7.7.0 get_it_mixin: ^4.2.2 go_router: ^14.1.2 From 5fcf91d8d90ce3e45b2ce47d95cc00a55ca0dcaa Mon Sep 17 00:00:00 2001 From: Hank Grabowski Date: Sat, 31 Aug 2024 16:20:25 -0400 Subject: [PATCH 4/5] Always use url not uri field when getting link from status JSON Fixes Issue #109 --- .../mastodon/timeline_entry_mastodon_extensions.dart | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/lib/serializers/mastodon/timeline_entry_mastodon_extensions.dart b/lib/serializers/mastodon/timeline_entry_mastodon_extensions.dart index ff90599..ce274e7 100644 --- a/lib/serializers/mastodon/timeline_entry_mastodon_extensions.dart +++ b/lib/serializers/mastodon/timeline_entry_mastodon_extensions.dart @@ -6,7 +6,6 @@ import '../../models/engagement_summary.dart'; import '../../models/link_data.dart'; import '../../models/location_data.dart'; import '../../models/timeline_entry.dart'; -import '../../models/timeline_network_info.dart'; import '../../models/visibility.dart'; import '../../services/auth_service.dart'; import '../../services/connections_manager.dart'; @@ -107,10 +106,7 @@ extension TimelineEntryMastodonExtensions on TimelineEntry { const title = ''; final spoilerText = json['spoiler_text'] ?? ''; - final externalLink = switch (networkInfo.network) { - KnownNetworks.bluesky || KnownNetworks.threads => json['url'] ?? '', - _ => json['uri'] ?? '', - }; + final externalLink = json['url']; const actualLocationData = LocationData(); final modificationTimestamp = timestamp; From 9995f8c72021c9c9e64c81e41320ef4415f5bb41 Mon Sep 17 00:00:00 2001 From: Hank Grabowski Date: Sat, 31 Aug 2024 16:31:27 -0400 Subject: [PATCH 5/5] Update CHANGELOG.md --- CHANGELOG.md | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 4fa2f7f..a387d4b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,10 +4,16 @@ * Changes * Use the network data in the friendica extensions rather than the application data if available since the app data - is the app name. + is the app name. ([Feature #106](https://gitlab.com/mysocialportal/relatica/-/issues/106)) * Fixes * Fixes final column of network settings getting chopped off on smaller screens ([Issue #102](https://gitlab.com/mysocialportal/relatica/-/issues/102)) + * Only circles now appear in the Profile view for adding users to a circle. Previously groups and channels showed up + there too which was nonsensical. ([Issue #103](https://gitlab.com/mysocialportal/relatica/-/issues/103)) + * Fix broken embedded images in message HTML when servers are running block post post-Friendica + 2024.08.([Issue #105](https://gitlab.com/mysocialportal/relatica/-/issues/105)) + * Fix broken Diaspora links when using "Copy URL" or "Open in + Browser".([Issue #109](https://gitlab.com/mysocialportal/relatica/-/issues/109)) * New Features * Focus Mode with ability to set duration and difficulty for unlocking beforehand. Focus mode in this release shows only the "My Posts" timeline and no bottom navigation bar. So one can't get to search, notifications,