From b0c60acaee4e7b660abfee2f85e64adc7eeca910 Mon Sep 17 00:00:00 2001 From: zarzet <42882290+zarzet@users.noreply.github.com> Date: Thu, 22 Oct 2026 15:34:16 +0700 Subject: [PATCH] feat(desktop): mark the desktop version as beta Desktop release builds show the version as "5.2.5 (beta)" wherever the display version appears: Settings, About, the update dialog and the version noted in backups. Mobile builds and the version used for update checks and logs are unchanged. --- lib/constants/app_info.dart | 10 +++++++++- test/app_info_version_test.dart | 17 +++++++++++++++++ 2 files changed, 26 insertions(+), 1 deletion(-) create mode 100644 test/app_info_version_test.dart diff --git a/lib/constants/app_info.dart b/lib/constants/app_info.dart index 52f6b3797..f4916660b 100644 --- a/lib/constants/app_info.dart +++ b/lib/constants/app_info.dart @@ -1,4 +1,5 @@ import 'package:flutter/foundation.dart'; +import 'package:mornye/utils/desktop_platform.dart'; class AppInfo { static const String version = '5.2.5'; @@ -8,7 +9,14 @@ class AppInfo { static String get shortGitCommit => gitCommit.length > 8 ? gitCommit.substring(0, 8) : gitCommit; - static String get displayVersion => kDebugMode ? 'Internal' : version; + /// The version shown to people; desktop builds are still in beta. + static String get displayVersion => versionLabel(); + + @visibleForTesting + static String versionLabel({bool debug = kDebugMode, bool? desktop}) { + if (debug) return 'Internal'; + return desktop ?? isDesktopPlatform ? '$version (beta)' : version; + } static const String appName = 'Mornye'; static const String copyright = '© 2026 Zarz Eleutherius'; diff --git a/test/app_info_version_test.dart b/test/app_info_version_test.dart new file mode 100644 index 000000000..90d21ec48 --- /dev/null +++ b/test/app_info_version_test.dart @@ -0,0 +1,17 @@ +import 'package:flutter_test/flutter_test.dart'; +import 'package:mornye/constants/app_info.dart'; + +void main() { + test('desktop release builds mark the version as beta', () { + expect( + AppInfo.versionLabel(debug: false, desktop: true), + '${AppInfo.version} (beta)', + ); + expect(AppInfo.versionLabel(debug: false, desktop: false), AppInfo.version); + }); + + test('debug builds stay internal on every platform', () { + expect(AppInfo.versionLabel(debug: true, desktop: true), 'Internal'); + expect(AppInfo.versionLabel(debug: true, desktop: false), 'Internal'); + }); +}