Skip to content

armgit / ente

Public Imported from GitHub
0

đź’š End-to-end encrypted cloud for everything.

Add Wrapped entry gating and discovery section

laurenspriemee0fae36852c
diff --git a/mobile/apps/photos/.docs/ente_wrapped_2025_engineering_plan.md b/mobile/apps/photos/.docs/ente_wrapped_2025_engineering_plan.md
index e489133841..d78cef9b1e 100644
--- a/mobile/apps/photos/.docs/ente_wrapped_2025_engineering_plan.md
+++ b/mobile/apps/photos/.docs/ente_wrapped_2025_engineering_plan.md
@@ -271,10 +271,12 @@ if (flagService.enteWrapped && wrappedResult != null && !localSettings.wrapped20
)
]
```
+ - Status: scaffolding present via `WrappedStateService`; replace the placeholder tap handler once the viewer is ready.
- Discovery Entry
- Add “Wrapped 2025” section below Locations when banner hidden, for ~1 month.
- Tap → same navigation as banner.
+ - Status: dedicated `SectionType.wrapped` drives the discovery card (rendered when results exist); navigation still points to placeholder.
- Viewer (autoplay, resume)
- Use a simple `PageView` + timer driving autoplay or repurpose `FullScreenMemory` mechanics.
@@ -331,6 +333,7 @@ Milestones & Checklist
- [x] Create `lib/services/wrapped/wrapped_engine.dart` with isolate compute stub
- [x] Implement candidate builders (stats, people, places, aesthetics, curation, narrative)
- [x] Wire feature flag getter (`flagService.enteWrapped`)
+- [x] Introduce `WrappedStateService` for entry gating
- [ ] Flesh out candidate builder implementations
- [x] StatsCandidateBuilder
- [ ] PeopleCandidateBuilder
diff --git a/mobile/apps/photos/.docs/ente_wrapped_2025_spec.md b/mobile/apps/photos/.docs/ente_wrapped_2025_spec.md
index f8396e523e..84e3d05db7 100644
--- a/mobile/apps/photos/.docs/ente_wrapped_2025_spec.md
+++ b/mobile/apps/photos/.docs/ente_wrapped_2025_spec.md
@@ -31,7 +31,7 @@ Success signals (local, privacy‑friendly)
- Entry points
- Home banner on top of home gallery: “Your 2025 Wrapped is ready” (if eligibility met and calculations done).
- Disappears after the user has seen the wrapped completely, or partially multiple times
- - After the home banner disappears, the Wrapped is added as a separate section to the discovery tab, right below locations.
+ - After the home banner disappears, the Wrapped is added as a separate section to the discovery tab, right above the locations section.
- It stays there for another month.
- Notifications (local): “We made you a 2025 recap.”
- Put all entry points initially behind a feature flag that points to `internalUsers`
diff --git a/mobile/apps/photos/lib/models/search/search_types.dart b/mobile/apps/photos/lib/models/search/search_types.dart
index 9ea97cbe82..74c3eeda1e 100644
--- a/mobile/apps/photos/lib/models/search/search_types.dart
+++ b/mobile/apps/photos/lib/models/search/search_types.dart
@@ -43,6 +43,7 @@ enum ResultType {
enum SectionType {
face,
magic,
+ wrapped,
location,
album,
// People section shows the files shared by other persons
@@ -58,6 +59,8 @@ extension SectionTypeExtensions on SectionType {
return AppLocalizations.of(context).people;
case SectionType.magic:
return AppLocalizations.of(context).discover;
+ case SectionType.wrapped:
+ return "Wrapped 2025";
case SectionType.location:
return AppLocalizations.of(context).locations;
case SectionType.contacts:
@@ -75,6 +78,8 @@ extension SectionTypeExtensions on SectionType {
return AppLocalizations.of(context).searchPersonsEmptySection;
case SectionType.magic:
return AppLocalizations.of(context).searchDiscoverEmptySection;
+ case SectionType.wrapped:
+ return "Check back soon for your 2025 highlights.";
case SectionType.location:
return AppLocalizations.of(context).searchLocationEmptySection;
case SectionType.contacts:
@@ -92,6 +97,7 @@ extension SectionTypeExtensions on SectionType {
switch (this) {
case SectionType.face:
case SectionType.magic:
+ case SectionType.wrapped:
case SectionType.fileTypesAndExtension:
return false;
case SectionType.location:
@@ -104,12 +110,14 @@ extension SectionTypeExtensions on SectionType {
bool get sortByName =>
this != SectionType.face &&
this != SectionType.magic &&
+ this != SectionType.wrapped &&
this != SectionType.contacts;
bool get isEmptyCTAVisible {
switch (this) {
case SectionType.face:
case SectionType.magic:
+ case SectionType.wrapped:
case SectionType.fileTypesAndExtension:
return false;
case SectionType.location:
@@ -127,6 +135,8 @@ extension SectionTypeExtensions on SectionType {
case SectionType.magic:
// todo: later
return "temp";
+ case SectionType.wrapped:
+ return "";
case SectionType.location:
return AppLocalizations.of(context).addNew;
case SectionType.contacts:
@@ -144,6 +154,8 @@ extension SectionTypeExtensions on SectionType {
return Icons.adaptive.arrow_forward_outlined;
case SectionType.magic:
return null;
+ case SectionType.wrapped:
+ return null;
case SectionType.location:
return Icons.add_location_alt_outlined;
case SectionType.contacts:
@@ -208,6 +220,8 @@ extension SectionTypeExtensions on SectionType {
await showGenericErrorDialog(context: context, error: result);
}
};
+ case SectionType.wrapped:
+ return () async {};
default:
{
return () async {};
@@ -229,6 +243,8 @@ extension SectionTypeExtensions on SectionType {
);
case SectionType.magic:
return SearchService.instance.getMagicSectionResults(context!);
+ case SectionType.wrapped:
+ return Future.value(const <SearchResult>[]);
case SectionType.location:
return SearchService.instance.getAllLocationTags(limit);
@@ -248,6 +264,8 @@ extension SectionTypeExtensions on SectionType {
switch (this) {
case SectionType.location:
return [Bus.instance.on<LocationTagUpdatedEvent>()];
+ case SectionType.wrapped:
+ return [];
case SectionType.album:
return [Bus.instance.on<CollectionUpdatedEvent>()];
case SectionType.face:
@@ -265,6 +283,8 @@ extension SectionTypeExtensions on SectionType {
return [Bus.instance.on<LocationTagUpdatedEvent>()];
case SectionType.magic:
return [Bus.instance.on<MagicCacheUpdatedEvent>()];
+ case SectionType.wrapped:
+ return [];
case SectionType.contacts:
return [Bus.instance.on<PeopleChangedEvent>()];
default:
diff --git a/mobile/apps/photos/lib/service_locator.dart b/mobile/apps/photos/lib/service_locator.dart
index cee522f1f2..77b09ccb54 100644
--- a/mobile/apps/photos/lib/service_locator.dart
+++ b/mobile/apps/photos/lib/service_locator.dart
@@ -21,6 +21,7 @@ import "package:photos/services/storage_bonus_service.dart";
import "package:photos/services/sync/trash_sync_service.dart";
import "package:photos/services/text_embeddings_cache_service.dart";
import "package:photos/services/update_service.dart";
+import "package:photos/services/wrapped/wrapped_state_service.dart";
import "package:photos/utils/local_settings.dart";
import "package:shared_preferences/shared_preferences.dart";
@@ -197,3 +198,9 @@ CollectionsService get collectionsService {
_collectionsService ??= CollectionsService.instance;
return _collectionsService!;
}
+
+WrappedStateService? _wrappedStateService;
+WrappedStateService get wrappedStateService {
+ _wrappedStateService ??= WrappedStateService.instance;
+ return _wrappedStateService!;
+}
diff --git a/mobile/apps/photos/lib/services/wrapped/wrapped_state_service.dart b/mobile/apps/photos/lib/services/wrapped/wrapped_state_service.dart
new file mode 100644
index 0000000000..2171a0f6e8
--- /dev/null
+++ b/mobile/apps/photos/lib/services/wrapped/wrapped_state_service.dart
@@ -0,0 +1,128 @@
+import "dart:async";
+
+import "package:flutter/foundation.dart";
+import "package:photos/service_locator.dart";
+import "package:photos/services/wrapped/models.dart";
+
+@immutable
+class WrappedEntryState {
+ const WrappedEntryState({
+ required this.resumeIndex,
+ required this.isComplete,
+ this.result,
+ });
+
+ final WrappedResult? result;
+ final int resumeIndex;
+ final bool isComplete;
+
+ bool get hasResult => result != null && result!.cards.isNotEmpty;
+
+ @override
+ bool operator ==(Object other) {
+ if (identical(this, other)) return true;
+ return other is WrappedEntryState &&
+ other.result == result &&
+ other.resumeIndex == resumeIndex &&
+ other.isComplete == isComplete;
+ }
+
+ @override
+ int get hashCode => Object.hash(result, resumeIndex, isComplete);
+}
+
+class WrappedStateService {
+ WrappedStateService._()
+ : _state = ValueNotifier<WrappedEntryState>(
+ WrappedEntryState(
+ result: null,
+ resumeIndex: 0,
+ isComplete: localSettings.wrapped2025Complete(),
+ ),
+ );
+
+ static final WrappedStateService instance = WrappedStateService._();
+
+ final ValueNotifier<WrappedEntryState> _state;
+
+ ValueListenable<WrappedEntryState> get stateListenable => _state;
+
+ WrappedEntryState get state => _state.value;
+
+ bool get isEnabled => flagService.enteWrapped;
+
+ bool get shouldShowHomeBanner =>
+ isEnabled && state.hasResult && !state.isComplete;
+
+ bool get shouldShowDiscoveryEntry =>
+ isEnabled &&
+ state.hasResult &&
+ state.isComplete &&
+ DateTime.now().millisecondsSinceEpoch <
+ DateTime(state.result!.year + 1, 01, 15, 23, 59, 59)
+ .millisecondsSinceEpoch;
+
+ void updateResult(WrappedResult? result) {
+ if (result == null || result.cards.isEmpty) {
+ unawaited(localSettings.setWrapped2025ResumeIndex(0));
+ unawaited(localSettings.setWrapped2025Complete(false));
+ _state.value = const WrappedEntryState(
+ result: null,
+ resumeIndex: 0,
+ isComplete: false,
+ );
+ return;
+ }
+
+ final int cardCount = result.cards.length;
+
+ int resumeIndex = localSettings.wrapped2025ResumeIndex();
+ if (resumeIndex < 0) {
+ resumeIndex = 0;
+ } else if (resumeIndex >= cardCount) {
+ resumeIndex = cardCount - 1;
+ }
+
+ final bool isComplete = localSettings.wrapped2025Complete();
+ if (resumeIndex != localSettings.wrapped2025ResumeIndex()) {
+ unawaited(localSettings.setWrapped2025ResumeIndex(resumeIndex));
+ }
+
+ _state.value = WrappedEntryState(
+ result: result,
+ resumeIndex: resumeIndex,
+ isComplete: isComplete,
+ );
+ }
+
+ void updateResumeIndex(int index) {
+ if (!state.hasResult) {
+ return;
+ }
+ final int safeIndex =
+ index.clamp(0, state.result!.cards.length - 1).toInt();
+ if (safeIndex == state.resumeIndex) {
+ return;
+ }
+
+ unawaited(localSettings.setWrapped2025ResumeIndex(safeIndex));
+ _state.value = WrappedEntryState(
+ result: state.result,
+ resumeIndex: safeIndex,
+ isComplete: state.isComplete,
+ );
+ }
+
+ void markComplete(bool isComplete) {
+ if (!state.hasResult && !isComplete) {
+ return;
+ }
+
+ unawaited(localSettings.setWrapped2025Complete(isComplete));
+ _state.value = WrappedEntryState(
+ result: state.result,
+ resumeIndex: state.resumeIndex,
+ isComplete: isComplete,
+ );
+ }
+}
diff --git a/mobile/apps/photos/lib/ui/home/header_widget.dart b/mobile/apps/photos/lib/ui/home/header_widget.dart
index 04ec237f37..e3d8746e6d 100644
--- a/mobile/apps/photos/lib/ui/home/header_widget.dart
+++ b/mobile/apps/photos/lib/ui/home/header_widget.dart
@@ -1,22 +1,64 @@
import 'package:flutter/widgets.dart';
import 'package:logging/logging.dart';
+import 'package:photos/service_locator.dart';
+import "package:photos/services/wrapped/wrapped_state_service.dart";
import "package:photos/ui/home/memories/memories_widget.dart";
import 'package:photos/ui/home/status_bar_widget.dart';
+import "package:photos/ui/wrapped/wrapped_home_banner.dart";
-class HeaderWidget extends StatelessWidget {
+class HeaderWidget extends StatefulWidget {
const HeaderWidget({
super.key,
});
+ @override
+ State<HeaderWidget> createState() => _HeaderWidgetState();
+}
+
+class _HeaderWidgetState extends State<HeaderWidget> {
+ final Logger _logger = Logger("Header");
+ late WrappedEntryState _wrappedState;
+
+ @override
+ void initState() {
+ super.initState();
+ _wrappedState = wrappedStateService.state;
+ wrappedStateService.stateListenable.addListener(_onWrappedStateChanged);
+ }
+
+ @override
+ void dispose() {
+ wrappedStateService.stateListenable.removeListener(_onWrappedStateChanged);
+ super.dispose();
+ }
+
+ void _onWrappedStateChanged() {
+ final WrappedEntryState next = wrappedStateService.state;
+ if (!mounted) {
+ return;
+ }
+ if (_wrappedState == next) {
+ return;
+ }
+ setState(() {
+ _wrappedState = next;
+ });
+ }
+
@override
Widget build(BuildContext context) {
- Logger("Header").info("Building header widget");
- return const Column(
+ _logger.info("Building header widget");
+ final bool showWrappedBanner = wrappedStateService.shouldShowHomeBanner;
+ final List<Widget> children = <Widget>[
+ const StatusBarWidget(),
+ const MemoriesWidget(),
+ ];
+ if (showWrappedBanner) {
+ children.add(WrappedHomeBanner(state: _wrappedState));
+ }
+ return Column(
crossAxisAlignment: CrossAxisAlignment.start,
- children: [
- StatusBarWidget(),
- MemoriesWidget(),
- ],
+ children: children,
);
}
}
diff --git a/mobile/apps/photos/lib/ui/viewer/search/result/no_result_widget.dart b/mobile/apps/photos/lib/ui/viewer/search/result/no_result_widget.dart
index 8546a692c0..3ce1569691 100644
--- a/mobile/apps/photos/lib/ui/viewer/search/result/no_result_widget.dart
+++ b/mobile/apps/photos/lib/ui/viewer/search/result/no_result_widget.dart
@@ -2,6 +2,7 @@ import 'package:flutter/material.dart';
import "package:photos/core/event_bus.dart";
import "package:photos/events/clear_and_unfocus_search_bar_event.dart";
import "package:photos/generated/l10n.dart";
+import "package:photos/models/search/search_result.dart";
import "package:photos/models/search/search_types.dart";
import "package:photos/states/all_sections_examples_state.dart";
import "package:photos/theme/ente_theme.dart";
@@ -21,7 +22,9 @@ class _NoResultWidgetState extends State<NoResultWidget> {
super.initState();
searchTypes = SectionType.values.toList(growable: true);
// remove face and content sectionType
- searchTypes.remove(SectionType.magic);
+ searchTypes.removeWhere(
+ (type) => type == SectionType.magic || type == SectionType.wrapped,
+ );
}
@override
@@ -32,13 +35,19 @@ class _NoResultWidgetState extends State<NoResultWidget> {
.then((value) {
if (value.isEmpty) return;
for (int i = 0; i < searchTypes.length; i++) {
+ final SectionType sectionType = searchTypes[i];
+ final int sectionIndex = SectionType.values.indexOf(sectionType);
+ if (sectionIndex < 0 || sectionIndex >= value.length) {
+ continue;
+ }
+ final List<SearchResult> sectionResults = value[sectionIndex];
final querySuggestions = <String>[];
- for (int j = 0; j < 2 && j < value[i].length; j++) {
- querySuggestions.add(value[i][j].name());
+ for (int j = 0; j < 2 && j < sectionResults.length; j++) {
+ querySuggestions.add(sectionResults[j].name());
}
if (querySuggestions.isNotEmpty) {
searchTypeToQuerySuggestion.addAll({
- searchTypes[i].sectionTitle(context): querySuggestions,
+ sectionType.sectionTitle(context): querySuggestions,
});
}
}
diff --git a/mobile/apps/photos/lib/ui/viewer/search_tab/search_tab.dart b/mobile/apps/photos/lib/ui/viewer/search_tab/search_tab.dart
index 6d2a1902e9..f4acbcfa42 100644
--- a/mobile/apps/photos/lib/ui/viewer/search_tab/search_tab.dart
+++ b/mobile/apps/photos/lib/ui/viewer/search_tab/search_tab.dart
@@ -10,16 +10,18 @@ import "package:photos/models/search/index_of_indexed_stack.dart";
import "package:photos/models/search/search_result.dart";
import "package:photos/models/search/search_types.dart";
import "package:photos/service_locator.dart";
+import "package:photos/services/wrapped/wrapped_state_service.dart";
import "package:photos/states/all_sections_examples_state.dart";
import "package:photos/ui/common/loading_widget.dart";
import "package:photos/ui/viewer/search/result/no_result_widget.dart";
import "package:photos/ui/viewer/search/search_suggestions.dart";
import "package:photos/ui/viewer/search/tab_empty_state.dart";
-import 'package:photos/ui/viewer/search_tab/albums_section.dart';
+import "package:photos/ui/viewer/search_tab/albums_section.dart";
import "package:photos/ui/viewer/search_tab/file_type_section.dart";
import "package:photos/ui/viewer/search_tab/locations_section.dart";
import "package:photos/ui/viewer/search_tab/magic_section.dart";
import "package:photos/ui/viewer/search_tab/people_section.dart";
+import "package:photos/ui/wrapped/wrapped_discovery_section.dart";
class SearchTab extends StatefulWidget {
const SearchTab({super.key});
@@ -78,6 +80,39 @@ class AllSearchSections extends StatefulWidget {
class _AllSearchSectionsState extends State<AllSearchSections> {
final Logger _logger = Logger('_AllSearchSectionsState');
+ late WrappedEntryState _wrappedState;
+ late bool _showWrappedDiscovery;
+
+ @override
+ void initState() {
+ super.initState();
+ _wrappedState = wrappedStateService.state;
+ _showWrappedDiscovery = wrappedStateService.shouldShowDiscoveryEntry;
+ wrappedStateService.stateListenable.addListener(_onWrappedStateChanged);
+ }
+
+ @override
+ void dispose() {
+ wrappedStateService.stateListenable.removeListener(_onWrappedStateChanged);
+ super.dispose();
+ }
+
+ void _onWrappedStateChanged() {
+ if (!mounted) {
+ return;
+ }
+ final WrappedEntryState nextState = wrappedStateService.state;
+ final bool nextShowDiscovery =
+ wrappedStateService.shouldShowDiscoveryEntry;
+ if (_wrappedState == nextState &&
+ _showWrappedDiscovery == nextShowDiscovery) {
+ return;
+ }
+ setState(() {
+ _wrappedState = nextState;
+ _showWrappedDiscovery = nextShowDiscovery;
+ });
+ }
@override
Widget build(BuildContext context) {
final searchTypes = SectionType.values.toList(growable: true);
@@ -128,6 +163,11 @@ class _AllSearchSectionsState extends State<AllSearchSections> {
snapshot.data!.elementAt(index)
as List<AlbumSearchResult>,
);
+ case SectionType.wrapped:
+ if (!_showWrappedDiscovery) {
+ return const SizedBox.shrink();
+ }
+ return WrappedDiscoverySection(state: _wrappedState);
case SectionType.location:
return LocationsSection(
snapshot.data!.elementAt(index)
@@ -176,8 +216,6 @@ class _AllSearchSectionsState extends State<AllSearchSections> {
),
);
}
- //Errors are handled and this else if condition will be false always
- //is the understanding.
return const Padding(
padding: EdgeInsets.only(bottom: 72),
child: EnteLoadingWidget(),
diff --git a/mobile/apps/photos/lib/ui/wrapped/wrapped_discovery_section.dart b/mobile/apps/photos/lib/ui/wrapped/wrapped_discovery_section.dart
new file mode 100644
index 0000000000..9858db9567
--- /dev/null
+++ b/mobile/apps/photos/lib/ui/wrapped/wrapped_discovery_section.dart
@@ -0,0 +1,102 @@
+import "package:flutter/material.dart";
+import "package:photos/service_locator.dart";
+import "package:photos/services/wrapped/wrapped_state_service.dart";
+import "package:photos/theme/ente_theme.dart";
+
+class WrappedDiscoverySection extends StatelessWidget {
+ const WrappedDiscoverySection({
+ required this.state,
+ super.key,
+ });
+
+ final WrappedEntryState state;
+
+ @override
+ Widget build(BuildContext context) {
+ final colorScheme = getEnteColorScheme(context);
+ final textTheme = getEnteTextTheme(context);
+
+ final bool hasProgress =
+ state.resumeIndex > 0 && state.resumeIndex < (state.result?.cards.length ?? 0);
+ final String subtitle = state.isComplete
+ ? "Replay the full story."
+ : hasProgress
+ ? "Continue watching from card ${state.resumeIndex + 1}."
+ : "Autogenerated highlights from your 2025.";
+
+ return Padding(
+ padding: const EdgeInsets.fromLTRB(12, 16, 12, 32),
+ child: Column(
+ crossAxisAlignment: CrossAxisAlignment.start,
+ children: [
+ Text(
+ "Wrapped 2025",
+ style: textTheme.largeBold,
+ ),
+ const SizedBox(height: 12),
+ Material(
+ color: colorScheme.backgroundElevated,
+ borderRadius: BorderRadius.circular(18),
+ child: InkWell(
+ borderRadius: BorderRadius.circular(18),
+ onTap: () => _handleTap(context),
+ child: Padding(
+ padding:
+ const EdgeInsets.symmetric(horizontal: 16, vertical: 18),
+ child: Row(
+ children: [
+ Icon(
+ Icons.play_circle_fill_rounded,
+ color: colorScheme.primary500,
+ size: 36,
+ ),
+ const SizedBox(width: 14),
+ Expanded(
+ child: Column(
+ crossAxisAlignment: CrossAxisAlignment.start,
+ children: [
+ Text(
+ state.isComplete
+ ? "Watch again"
+ : hasProgress
+ ? "Continue watching"
+ : "View your recap",
+ style: textTheme.largeBold,
+ ),
+ const SizedBox(height: 4),
+ Text(
+ subtitle,
+ style: textTheme.smallMuted,
+ ),
+ ],
+ ),
+ ),
+ const SizedBox(width: 8),
+ Icon(
+ Icons.chevron_right_rounded,
+ color: colorScheme.textMuted,
+ ),
+ ],
+ ),
+ ),
+ ),
+ ),
+ ],
+ ),
+ );
+ }
+
+ void _handleTap(BuildContext context) {
+ if (!wrappedStateService.shouldShowDiscoveryEntry &&
+ !wrappedStateService.shouldShowHomeBanner) {
+ return;
+ }
+
+ ScaffoldMessenger.of(context).showSnackBar(
+ const SnackBar(
+ content: Text("Wrapped viewer coming soon."),
+ duration: Duration(seconds: 2),
+ ),
+ );
+ }
+}
diff --git a/mobile/apps/photos/lib/ui/wrapped/wrapped_home_banner.dart b/mobile/apps/photos/lib/ui/wrapped/wrapped_home_banner.dart
new file mode 100644
index 0000000000..8ed1167ff7
--- /dev/null
+++ b/mobile/apps/photos/lib/ui/wrapped/wrapped_home_banner.dart
@@ -0,0 +1,107 @@
+import "package:flutter/material.dart";
+import "package:photos/service_locator.dart";
+import "package:photos/services/wrapped/wrapped_state_service.dart";
+import "package:photos/theme/ente_theme.dart";
+
+class WrappedHomeBanner extends StatelessWidget {
+ const WrappedHomeBanner({
+ required this.state,
+ super.key,
+ });
+
+ final WrappedEntryState state;
+
+ @override
+ Widget build(BuildContext context) {
+ final enteColorScheme = getEnteColorScheme(context);
+ final textTheme = getEnteTextTheme(context);
+ final bool hasProgress =
+ state.resumeIndex > 0 && state.resumeIndex < (state.result?.cards.length ?? 0);
+
+ final String title;
+ final String subtitle;
+ if (state.isComplete) {
+ title = "Replay your 2025 Wrapped";
+ subtitle = "Enjoy the full story again.";
+ } else if (hasProgress) {
+ title = "Continue your 2025 Wrapped";
+ subtitle = "Jump back to where you left off.";
+ } else {
+ title = "Your 2025 Wrapped is ready";
+ subtitle = "Tap to see your 2025 highlights.";
+ }
+
+ final int cardCount = state.result?.cards.length ?? 0;
+ final String detail =
+ cardCount > 0 ? "$cardCount card${cardCount == 1 ? '' : 's'}" : "Preview";
+
+ return Padding(
+ padding: const EdgeInsets.fromLTRB(12, 12, 12, 8),
+ child: Material(
+ color: enteColorScheme.backgroundElevated,
+ borderRadius: BorderRadius.circular(20),
+ child: InkWell(
+ borderRadius: BorderRadius.circular(20),
+ onTap: () => _handleTap(context),
+ child: Padding(
+ padding: const EdgeInsets.symmetric(horizontal: 18, vertical: 20),
+ child: Row(
+ children: [
+ Container(
+ width: 48,
+ height: 48,
+ decoration: BoxDecoration(
+ color: enteColorScheme.primary400.withValues(alpha: 0.16),
+ borderRadius: BorderRadius.circular(16),
+ ),
+ child: Icon(
+ Icons.auto_awesome,
+ color: enteColorScheme.primary500,
+ ),
+ ),
+ const SizedBox(width: 16),
+ Expanded(
+ child: Column(
+ crossAxisAlignment: CrossAxisAlignment.start,
+ mainAxisSize: MainAxisSize.min,
+ children: [
+ Text(
+ title,
+ style: textTheme.largeBold,
+ ),
+ const SizedBox(height: 4),
+ Text(
+ subtitle,
+ style: textTheme.smallMuted,
+ ),
+ ],
+ ),
+ ),
+ const SizedBox(width: 12),
+ Text(
+ detail,
+ style: textTheme.smallMuted.copyWith(
+ color: enteColorScheme.textMuted,
+ ),
+ ),
+ ],
+ ),
+ ),
+ ),
+ ),
+ );
+ }
+
+ void _handleTap(BuildContext context) {
+ if (!wrappedStateService.shouldShowHomeBanner &&
+ !wrappedStateService.shouldShowDiscoveryEntry) {
+ return;
+ }
+ ScaffoldMessenger.of(context).showSnackBar(
+ const SnackBar(
+ content: Text("Wrapped viewer coming soon."),
+ duration: Duration(seconds: 2),
+ ),
+ );
+ }
+}