chore: migration continue button (#20000)

* feat: add toggle to switch between Isar and Sqlite

* reset sqlite on beta

* start sync on app open in new timeline

* fix lint

* migrate hashes when new timeline is selected

* migrate hashes immediately after beta is enabled

* show loading indicator in change timeline page

* some stylings

* fix some styling issue

* release resources on isolate close

* replace route and styling

* handle migration back to old timeline

* check if a provider is mounted before calling dispose on it

* styling

* styling and button

---------

Co-authored-by: shenlong-tanwen <139912620+shalong-tanwen@users.noreply.github.com>
This commit is contained in:
Alex 2025-07-17 15:58:55 -05:00 committed by GitHub
parent 8491fe459d
commit 546f841b2c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
5 changed files with 40 additions and 18 deletions

View File

@ -373,7 +373,7 @@
"admin_password": "Admin Password", "admin_password": "Admin Password",
"administration": "Administration", "administration": "Administration",
"advanced": "Advanced", "advanced": "Advanced",
"advanced_settings_beta_timeline_subtitle": "Try the new app experience.", "advanced_settings_beta_timeline_subtitle": "Try the new app experience",
"advanced_settings_beta_timeline_title": "Beta Timeline", "advanced_settings_beta_timeline_title": "Beta Timeline",
"advanced_settings_enable_alternate_media_filter_subtitle": "Use this option to filter media during sync based on alternate criteria. Only try this if you have issues with the app detecting all albums.", "advanced_settings_enable_alternate_media_filter_subtitle": "Use this option to filter media during sync based on alternate criteria. Only try this if you have issues with the app detecting all albums.",
"advanced_settings_enable_alternate_media_filter_title": "[EXPERIMENTAL] Use alternate device album sync filter", "advanced_settings_enable_alternate_media_filter_title": "[EXPERIMENTAL] Use alternate device album sync filter",

View File

@ -57,14 +57,6 @@ class _ChangeExperiencePageState extends ConsumerState<ChangeExperiencePage> {
await ref.read(backgroundSyncProvider).cancel(); await ref.read(backgroundSyncProvider).cancel();
} }
Future.delayed(const Duration(seconds: 3), () {
context.replaceRoute(
widget.switchingToBeta
? const TabShellRoute()
: const TabControllerRoute(),
);
});
if (mounted) { if (mounted) {
setState(() { setState(() {
HapticFeedback.heavyImpact(); HapticFeedback.heavyImpact();
@ -104,7 +96,7 @@ class _ChangeExperiencePageState extends ConsumerState<ChangeExperiencePage> {
duration: Durations.long4, duration: Durations.long4,
child: hasMigrated child: hasMigrated
? Text( ? Text(
"Migration success. Navigating to the new timeline...", "Migration success!",
style: context.textTheme.titleMedium, style: context.textTheme.titleMedium,
textAlign: TextAlign.center, textAlign: TextAlign.center,
) )
@ -115,6 +107,20 @@ class _ChangeExperiencePageState extends ConsumerState<ChangeExperiencePage> {
), ),
), ),
), ),
if (hasMigrated)
Padding(
padding: const EdgeInsets.only(top: 16.0),
child: ElevatedButton(
onPressed: () {
context.replaceRoute(
widget.switchingToBeta
? const TabShellRoute()
: const TabControllerRoute(),
);
},
child: const Text("Continue"),
),
),
], ],
), ),
), ),

View File

@ -143,7 +143,7 @@ class _MobileLayout extends StatelessWidget {
.toList(); .toList();
return ListView( return ListView(
physics: const ClampingScrollPhysics(), physics: const ClampingScrollPhysics(),
padding: const EdgeInsets.symmetric(vertical: 10.0), padding: const EdgeInsets.only(top: 10.0, bottom: 56),
children: [ children: [
const BetaTimelineListTile(), const BetaTimelineListTile(),
...settings, ...settings,

View File

@ -81,7 +81,9 @@ class AssetNotifier extends StateNotifier<bool> {
await _albumService.refreshDeviceAlbums(); await _albumService.refreshDeviceAlbums();
} finally { } finally {
_getAllAssetInProgress = false; _getAllAssetInProgress = false;
state = false; if (mounted) {
state = false;
}
} }
} }

View File

@ -100,13 +100,27 @@ class _BetaTimelineListTileState extends ConsumerState<BetaTimelineListTile>
[ChangeExperienceRoute(switchingToBeta: value)], [ChangeExperienceRoute(switchingToBeta: value)],
); );
}, },
child: const Text("Yes"), child: Text(
"YES",
style: TextStyle(
fontSize: 16,
fontWeight: FontWeight.w500,
color: context.primaryColor,
),
),
), ),
TextButton( TextButton(
onPressed: () { onPressed: () {
Navigator.of(context).pop(); context.pop();
}, },
child: const Text("No"), child: Text(
"NO",
style: TextStyle(
fontSize: 16,
fontWeight: FontWeight.w500,
color: context.colorScheme.outline,
),
),
), ),
], ],
); );
@ -116,18 +130,18 @@ class _BetaTimelineListTileState extends ConsumerState<BetaTimelineListTile>
final gradientColors = [ final gradientColors = [
Color.lerp( Color.lerp(
context.primaryColor.withValues(alpha: 0.5),
context.primaryColor.withValues(alpha: 0.3), context.primaryColor.withValues(alpha: 0.3),
context.primaryColor.withValues(alpha: 0.1),
_gradientAnimation.value, _gradientAnimation.value,
)!, )!,
Color.lerp( Color.lerp(
context.primaryColor.withValues(alpha: 0.2),
context.primaryColor.withValues(alpha: 0.4), context.primaryColor.withValues(alpha: 0.4),
context.primaryColor.withValues(alpha: 0.6),
_gradientAnimation.value, _gradientAnimation.value,
)!, )!,
Color.lerp( Color.lerp(
context.primaryColor.withValues(alpha: 0.1),
context.primaryColor.withValues(alpha: 0.3), context.primaryColor.withValues(alpha: 0.3),
context.primaryColor.withValues(alpha: 0.5),
_gradientAnimation.value, _gradientAnimation.value,
)!, )!,
]; ];