diff --git a/CHANGELOG.md b/CHANGELOG.md index 5837885..8234b1f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,13 +4,23 @@ * 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, - 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)) * Add resharing of Bluesky posts if connected to a Friendica server running 2024.08 or later. ## Version 0.11.0 (beta) 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/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, + ), )); } } 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; 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