Skip to content

armgit / ente

Public Imported from GitHub
0

πŸ’š End-to-end encrypted cloud for everything.

Remove abandoned Photos offline link sharing

AmanRajSinghMourya591519fa4586
diff --git a/mobile/apps/photos/lib/ui/sharing/offline_link_selection_sheet.dart b/mobile/apps/photos/lib/ui/sharing/offline_link_selection_sheet.dart
deleted file mode 100644
index 68e9b29565..0000000000
--- a/mobile/apps/photos/lib/ui/sharing/offline_link_selection_sheet.dart
+++ /dev/null
@@ -1,131 +0,0 @@
-import "package:ente_components/ente_components.dart";
-import "package:ente_strings/ente_strings.dart";
-import "package:flutter/material.dart";
-import "package:hugeicons/hugeicons.dart";
-import "package:photos/models/file/file.dart";
-import "package:photos/models/file_load_result.dart";
-import "package:photos/ui/viewer/gallery/gallery.dart";
-import "package:photos/ui/viewer/gallery/state/gallery_boundaries_provider.dart";
-import "package:photos/ui/viewer/gallery/state/gallery_files_inherited_widget.dart";
-
-class OfflineLinkSelectionSheet extends StatelessWidget {
- const OfflineLinkSelectionSheet({
- super.key,
- required this.files,
- this.onCreateLink,
- });
- final List<EnteFile> files;
- final Future<void> Function(List<EnteFile>)? onCreateLink;
-
- @override
- Widget build(BuildContext context) => FractionallySizedBox(
- heightFactor: 0.86,
- alignment: Alignment.bottomCenter,
- child: GalleryBoundariesProvider(
- child: Container(
- clipBehavior: Clip.antiAlias,
- decoration: BoxDecoration(
- color: context.componentColors.backgroundBase,
- borderRadius: const BorderRadius.vertical(
- top: Radius.circular(Radii.bottomSheet),
- ),
- ),
- child: SafeArea(
- top: false,
- child: Column(
- crossAxisAlignment: CrossAxisAlignment.start,
- children: [
- const _SelectionHeader(),
- const SizedBox(height: Spacing.lg),
- Expanded(
- child: GalleryFilesState(
- child: Gallery(
- initialFiles: files,
- asyncLoader: (_, _, {limit, asc}) async =>
- FileLoadResult(files, false),
- tagPrefix: "offline_link_selection",
- enableFileGrouping: false,
- showSelectAll: false,
- disablePinnedGroupHeader: true,
- disableVerticalPaddingForScrollbar: true,
- footer: const SizedBox.shrink(),
- emptyState: Center(
- child: Padding(
- padding: const EdgeInsets.all(Spacing.xl),
- child: Text(
- pendingTranslation(
- "No selected files are available on this device.",
- ),
- textAlign: TextAlign.center,
- ),
- ),
- ),
- ),
- ),
- ),
- Center(
- child: ConstrainedBox(
- constraints: const BoxConstraints(maxWidth: 428),
- child: Padding(
- padding: const EdgeInsets.fromLTRB(
- Spacing.xl,
- Spacing.lg,
- Spacing.xl,
- Spacing.sm,
- ),
- child: ButtonComponent(
- key: const ValueKey("offline-link-create-option"),
- label: pendingTranslation("Create link"),
- shouldSurfaceExecutionStates: false,
- leading: const HugeIcon(
- icon: HugeIcons.strokeRoundedLink02,
- size: IconSizes.small,
- ),
- isDisabled: files.isEmpty,
- // Remains disabled until real link creation is wired.
- onTap: onCreateLink == null
- ? null
- : () => onCreateLink!(files),
- ),
- ),
- ),
- ),
- ],
- ),
- ),
- ),
- ),
- );
-}
-
-class _SelectionHeader extends StatelessWidget {
- const _SelectionHeader();
-
- @override
- Widget build(BuildContext context) => Padding(
- padding: const EdgeInsets.fromLTRB(Spacing.xl, Spacing.xl, Spacing.xl, 0),
- child: Row(
- children: [
- Expanded(
- child: Text(
- pendingTranslation("Share link"),
- style: TextStyles.h2.copyWith(
- color: context.componentColors.textBase,
- ),
- ),
- ),
- const SizedBox(width: Spacing.md),
- IconButtonComponent(
- tooltip: context.strings.close,
- variant: IconButtonComponentVariant.circular,
- shouldSurfaceExecutionStates: false,
- icon: const HugeIcon(
- icon: HugeIcons.strokeRoundedCancel01,
- size: IconSizes.small,
- ),
- onTap: () => Navigator.of(context).pop(),
- ),
- ],
- ),
- );
-}
diff --git a/mobile/apps/photos/lib/ui/viewer/actions/file_selection_actions_widget.dart b/mobile/apps/photos/lib/ui/viewer/actions/file_selection_actions_widget.dart
index c31097f9ff..be00248a02 100644
--- a/mobile/apps/photos/lib/ui/viewer/actions/file_selection_actions_widget.dart
+++ b/mobile/apps/photos/lib/ui/viewer/actions/file_selection_actions_widget.dart
@@ -1,7 +1,6 @@
import "dart:async";
import "dart:io";
-import "package:ente_components/ente_components.dart";
import "package:ente_pure_utils/ente_pure_utils.dart";
import "package:ente_strings/ente_strings.dart";
import 'package:flutter/material.dart';
@@ -46,7 +45,6 @@ import "package:photos/ui/components/bottom_action_bar/selection_action_sheet.da
import 'package:photos/ui/components/buttons/button_widget.dart';
import 'package:photos/ui/components/models/button_type.dart';
import 'package:photos/ui/notification/toast.dart';
-import "package:photos/ui/sharing/offline_link_selection_sheet.dart";
import "package:photos/ui/tools/collage/collage_creator_page.dart";
import "package:photos/ui/viewer/actions/suggest_delete_sheet.dart";
import "package:photos/ui/viewer/date/edit_date_sheet.dart";
@@ -232,16 +230,6 @@ class _FileSelectionActionsWidgetState
);
}
- if (_canShowOfflineLinkOption(widget.selectedFiles.files)) {
- items.add(
- SelectionSheetAction(
- hugeIcon: HugeIcons.strokeRoundedLink02,
- labelText: pendingTranslation("(i) Offline link"),
- onTap: _showOfflineLinkShareSheet,
- ),
- );
- }
-
if (widget.type.showCreateLink()) {
if (_cachedCollectionForSharedLink != null && anyUploadedFiles) {
items.add(
@@ -627,24 +615,6 @@ class _FileSelectionActionsWidgetState
widget.selectedFiles.clearAll();
}
- Future<void> _showOfflineLinkShareSheet() async {
- final files = widget.selectedFiles.files
- .where((file) => file.localID != null)
- .toList(growable: false);
- await showBottomSheetComponent<void>(
- context: context,
- enableDrag: false,
- builder: (_) => OfflineLinkSelectionSheet(files: files),
- );
- }
-
- bool _canShowOfflineLinkOption(Iterable<EnteFile> files) {
- // TODO: Move this entry point to local-gallery mode when the feature is ready.
- return flagService.offlineLinkSharing &&
- !isLocalGalleryMode &&
- Configuration.instance.hasConfiguredAccount();
- }
-
Future<void> _moveFiles() async {
if (split.pendingUploads.isNotEmpty || split.ownedByOtherUsers.isNotEmpty) {
widget.selectedFiles.unSelectAll(
diff --git a/mobile/packages/feature_flag/lib/src/flag_service.dart b/mobile/packages/feature_flag/lib/src/flag_service.dart
index 93155bce5a..3bd7fd7168 100644
--- a/mobile/packages/feature_flag/lib/src/flag_service.dart
+++ b/mobile/packages/feature_flag/lib/src/flag_service.dart
@@ -54,8 +54,6 @@ class FlagService {
return (flags.internalUser || kDebugMode) && !isDisabled;
}
- bool get offlineLinkSharing => internalUser;
-
bool get librarySharing =>
internalUser || _isServerFlagEnabled(_librarySharingFlag);