Skip to content

High performance self-hosted photo and video management solution.

feat(mobile): hide storage indicator outside main timeline (#19835)

Daimolean4ddd3764b494
diff --git a/mobile/lib/presentation/pages/dev/main_timeline.page.dart b/mobile/lib/presentation/pages/dev/main_timeline.page.dart
index 9ec8002463..7216b638e1 100644
--- a/mobile/lib/presentation/pages/dev/main_timeline.page.dart
+++ b/mobile/lib/presentation/pages/dev/main_timeline.page.dart
@@ -16,17 +16,18 @@ class MainTimelinePage extends ConsumerWidget {
return memoryLaneProvider.when(
data: (memories) {
return memories.isEmpty
- ? const Timeline()
+ ? const Timeline(showStorageIndicator: true)
: Timeline(
topSliverWidget: SliverToBoxAdapter(
key: Key('memory-lane-${memories.first.assets.first.id}'),
child: DriftMemoryLane(memories: memories),
),
topSliverWidgetHeight: 200,
+ showStorageIndicator: true,
);
},
- loading: () => const Timeline(),
- error: (error, stackTrace) => const Timeline(),
+ loading: () => const Timeline(showStorageIndicator: true),
+ error: (error, stackTrace) => const Timeline(showStorageIndicator: true),
);
}
}
diff --git a/mobile/lib/presentation/pages/drift_asset_selection_timeline.page.dart b/mobile/lib/presentation/pages/drift_asset_selection_timeline.page.dart
index df6211c338..7ac378e4f5 100644
--- a/mobile/lib/presentation/pages/drift_asset_selection_timeline.page.dart
+++ b/mobile/lib/presentation/pages/drift_asset_selection_timeline.page.dart
@@ -33,7 +33,7 @@ class DriftAssetSelectionTimelinePage extends ConsumerWidget {
final user = ref.watch(currentUserProvider);
if (user == null) {
throw Exception(
- 'User must be logged in to access recently taken',
+ 'User must be logged in to access asset selection timeline',
);
}
diff --git a/mobile/lib/presentation/widgets/timeline/fixed/segment.model.dart b/mobile/lib/presentation/widgets/timeline/fixed/segment.model.dart
index 14b1a4616d..70d8658b39 100644
--- a/mobile/lib/presentation/widgets/timeline/fixed/segment.model.dart
+++ b/mobile/lib/presentation/widgets/timeline/fixed/segment.model.dart
@@ -206,6 +206,9 @@ class _AssetTileWidget extends ConsumerWidget {
@override
Widget build(BuildContext context, WidgetRef ref) {
final lockSelection = _getLockSelectionStatus(ref);
+ final showStorageIndicator = ref.watch(
+ timelineArgsProvider.select((args) => args.showStorageIndicator),
+ );
return RepaintBoundary(
child: GestureDetector(
@@ -217,6 +220,7 @@ class _AssetTileWidget extends ConsumerWidget {
child: ThumbnailTile(
asset,
lockSelection: lockSelection,
+ showStorageIndicator: showStorageIndicator,
),
),
);
diff --git a/mobile/lib/presentation/widgets/timeline/timeline.state.dart b/mobile/lib/presentation/widgets/timeline/timeline.state.dart
index 629fac7831..30a4088ce2 100644
--- a/mobile/lib/presentation/widgets/timeline/timeline.state.dart
+++ b/mobile/lib/presentation/widgets/timeline/timeline.state.dart
@@ -14,12 +14,14 @@ class TimelineArgs {
final double maxHeight;
final double spacing;
final int columnCount;
+ final bool showStorageIndicator;
const TimelineArgs({
required this.maxWidth,
required this.maxHeight,
this.spacing = kTimelineSpacing,
this.columnCount = kTimelineColumnCount,
+ this.showStorageIndicator = false,
});
@override
@@ -27,7 +29,8 @@ class TimelineArgs {
return spacing == other.spacing &&
maxWidth == other.maxWidth &&
maxHeight == other.maxHeight &&
- columnCount == other.columnCount;
+ columnCount == other.columnCount &&
+ showStorageIndicator == other.showStorageIndicator;
}
@override
@@ -35,7 +38,8 @@ class TimelineArgs {
maxWidth.hashCode ^
maxHeight.hashCode ^
spacing.hashCode ^
- columnCount.hashCode;
+ columnCount.hashCode ^
+ showStorageIndicator.hashCode;
}
class TimelineState {
diff --git a/mobile/lib/presentation/widgets/timeline/timeline.widget.dart b/mobile/lib/presentation/widgets/timeline/timeline.widget.dart
index 6d3351e9c2..bc1b044044 100644
--- a/mobile/lib/presentation/widgets/timeline/timeline.widget.dart
+++ b/mobile/lib/presentation/widgets/timeline/timeline.widget.dart
@@ -26,11 +26,13 @@ class Timeline extends StatelessWidget {
super.key,
this.topSliverWidget,
this.topSliverWidgetHeight,
+ this.showStorageIndicator = false,
this.appBar,
});
final Widget? topSliverWidget;
final double? topSliverWidgetHeight;
+ final bool showStorageIndicator;
final Widget? appBar;
@override
@@ -46,6 +48,7 @@ class Timeline extends StatelessWidget {
columnCount: ref.watch(
settingsProvider.select((s) => s.get(Setting.tilesPerRow)),
),
+ showStorageIndicator: showStorageIndicator,
),
),
],