pwa improvements: custom name and context selection

This commit is contained in:
Fabian Freund
2026-04-20 12:20:55 +02:00
parent 7af0f1d4e3
commit b699ef5fba
23 changed files with 1220 additions and 439 deletions
@@ -250,14 +250,25 @@ class TabTreeRoute extends GoRouteData with $TabTreeRoute {
class OpenSharedContentRoute extends GoRouteData with $OpenSharedContentRoute {
final String sharedUrl;
final String? contextId;
final String? containerMode;
const OpenSharedContentRoute({this.sharedUrl = 'about:blank'});
const OpenSharedContentRoute({
this.sharedUrl = 'about:blank',
this.contextId,
this.containerMode,
});
@override
Page<void> buildPage(BuildContext context, GoRouterState state) {
return BottomSheetPage(
builder: (_) => OpenSharedContent(
sharedUrl: Uri.tryParse(sharedUrl) ?? Uri.parse('about:blank'),
contextId: contextId,
containerMode: IntentContainerMode.fromWireValue(
containerMode,
contextId: contextId,
),
),
);
}
@@ -81,6 +81,7 @@ import 'package:weblibre/features/settings/presentation/screens/tracking_protect
import 'package:weblibre/features/settings/presentation/screens/web_content_settings.dart';
import 'package:weblibre/features/settings/presentation/screens/web_engine_hardening.dart';
import 'package:weblibre/features/settings/presentation/screens/web_engine_hardening_group.dart';
import 'package:weblibre/features/share_intent/domain/entities/intent_container_mode.dart';
import 'package:weblibre/features/sync/presentation/screens/sync_settings.dart';
import 'package:weblibre/features/tor/presentation/screens/country_picker.dart';
import 'package:weblibre/features/tor/presentation/screens/tor_proxy.dart';
@@ -860,6 +860,8 @@ mixin $OpenSharedContentRoute on GoRouteData {
static OpenSharedContentRoute _fromState(GoRouterState state) =>
OpenSharedContentRoute(
sharedUrl: state.uri.queryParameters['shared-url'] ?? 'about:blank',
contextId: state.uri.queryParameters['context-id'],
containerMode: state.uri.queryParameters['container-mode'],
);
OpenSharedContentRoute get _self => this as OpenSharedContentRoute;
@@ -869,6 +871,8 @@ mixin $OpenSharedContentRoute on GoRouteData {
'/browser/open_content',
queryParams: {
if (_self.sharedUrl != 'about:blank') 'shared-url': _self.sharedUrl,
if (_self.contextId != null) 'context-id': _self.contextId,
if (_self.containerMode != null) 'container-mode': _self.containerMode,
},
);