From 0172df59a254c6d63aad1b2abbf35c85914b854d Mon Sep 17 00:00:00 2001 From: Jarred Wilson Date: Sun, 1 Feb 2026 07:15:13 -0600 Subject: [PATCH 1/5] fix(actionsqueue): use localized name --- lib/views/components/app_actions.dart | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/views/components/app_actions.dart b/lib/views/components/app_actions.dart index 3cfc27a..fdb6c99 100644 --- a/lib/views/components/app_actions.dart +++ b/lib/views/components/app_actions.dart @@ -65,8 +65,8 @@ class AppActions extends ConsumerWidget { "installTarget": app.getInstallTarget(), "remote": app.remote! }; - actionQueue.add("Installing ${app.name}", app.id, - _installWorker, data); + actionQueue.add("Installing ${app.getLocalizedName()}", + app.id, _installWorker, data); } }, style: const ButtonStyle( @@ -97,8 +97,8 @@ class AppActions extends ConsumerWidget { TextButton( onPressed: () async { final data = {"updateTarget": app.getUpdateTarget()}; - actionQueue.add( - "Updating ${app.name}", app.id, _updateWorker, data); + actionQueue.add("Updating ${app.getLocalizedName()}", + app.id, _updateWorker, data); }, style: const ButtonStyle( backgroundColor: From f170a223c3b46e893d1157595b31c4eeaa8a022f Mon Sep 17 00:00:00 2001 From: Jarred Wilson Date: Sun, 1 Feb 2026 07:26:36 -0600 Subject: [PATCH 2/5] fix(downloads): convert completed list to set using a set dedups the completed downloads list by not allowing duplicate app ids --- lib/providers/action_queue.dart | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/providers/action_queue.dart b/lib/providers/action_queue.dart index d6bd836..1100016 100644 --- a/lib/providers/action_queue.dart +++ b/lib/providers/action_queue.dart @@ -7,7 +7,7 @@ import 'package:outlet/providers/application_provider.dart'; class ActionQueueNotifier extends AutoDisposeNotifier { final Queue _queue = Queue(); - final List _completedActions = []; + final Set _completedActions = {}; Action? _currentAction; bool _isExecuting = false; From 51a52a1ed42f96bf61f10dbfc2c4260b69ac429f Mon Sep 17 00:00:00 2001 From: Jarred Wilson Date: Sun, 1 Feb 2026 07:35:55 -0600 Subject: [PATCH 3/5] fix(flatpak): set update target to bundle id --- lib/core/flatpak_application.dart | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/core/flatpak_application.dart b/lib/core/flatpak_application.dart index 6c9b0ad..dd59feb 100644 --- a/lib/core/flatpak_application.dart +++ b/lib/core/flatpak_application.dart @@ -158,7 +158,7 @@ class FlatpakApplication extends Application { } @override - getUpdateTarget() => id; + getUpdateTarget() => bundles.firstOrNull?.id ?? id; @override String launchCommand() { From 85f8b6bef22c3414fb9d344c807669673db72697 Mon Sep 17 00:00:00 2001 From: Jarred Wilson Date: Sun, 1 Feb 2026 12:53:03 -0600 Subject: [PATCH 4/5] fix(application): default current to true --- lib/core/application.dart | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/core/application.dart b/lib/core/application.dart index dc805e9..1c3176a 100644 --- a/lib/core/application.dart +++ b/lib/core/application.dart @@ -30,14 +30,14 @@ class Application extends AppstreamComponent { this.installed = false, this.remote, this.version, - this.current, + this.current = true, }) : super(name: name ?? {"C": id}); bool featured; bool installed; final String? remote; final String? version; - bool? current; + bool current; String getLocalizedName() { final key = bestLanguageKey(name); From 2272ac264b6035358c7b795c5ca1a62495c92d6e Mon Sep 17 00:00:00 2001 From: Jarred Wilson Date: Sun, 1 Feb 2026 13:06:31 -0600 Subject: [PATCH 5/5] fix(update): read installedRef for update - backends return Map for installed apps to determine update - update application provider to accept new data structure --- lib/backends/backend.dart | 8 ++++---- lib/backends/flatpak_backend.dart | 9 ++++++--- lib/providers/application_provider.dart | 16 ++++++++-------- 3 files changed, 18 insertions(+), 15 deletions(-) diff --git a/lib/backends/backend.dart b/lib/backends/backend.dart index 1eaa6c8..af0a70c 100644 --- a/lib/backends/backend.dart +++ b/lib/backends/backend.dart @@ -7,8 +7,8 @@ import 'package:outlet/core/flatpak_application.dart'; import 'package:outlet/appstream.dart/lib/appstream.dart'; interface class Backend { - List getInstalledPackages() { - return []; + Map getInstalledPackages() { + return {}; } Future> getAllRemotePackages() async { @@ -69,8 +69,8 @@ class TestBackend implements Backend { } @override - List getInstalledPackages() { - return ['app-3', 'app-7']; + Map getInstalledPackages() { + return {'app-3': true, 'app-7': false}; } @override diff --git a/lib/backends/flatpak_backend.dart b/lib/backends/flatpak_backend.dart index eb08660..ee0e486 100644 --- a/lib/backends/flatpak_backend.dart +++ b/lib/backends/flatpak_backend.dart @@ -40,13 +40,13 @@ class FlatpakBackend implements Backend { } @override - List getInstalledPackages() { + Map getInstalledPackages() { final FlatpakBindings bindings = FlatpakBindings(ffi.DynamicLibrary.open('libflatpak.so')); ffi.Pointer installationPtr = getFlatpakInstallation(); ffi.Pointer> error = pkg_ffi.calloc>(); - List apps = []; + Map apps = {}; final ffi.Pointer installedRefsPtr = bindings.flatpak_installation_list_installed_refs( installationPtr, ffi.nullptr, error); @@ -70,6 +70,9 @@ class FlatpakBackend implements Backend { error, ); if (error.value == ffi.nullptr) { + final current = + bindings.flatpak_installed_ref_get_is_current(installedRefPtr) == + 1; final int refAppSize = bindings.g_bytes_get_size(refAppPtr); final sizeP = pkg_ffi.malloc(); sizeP.value = refAppSize; @@ -96,7 +99,7 @@ class FlatpakBackend implements Backend { continue; } - apps.add(id); + apps[id] = current; } on XmlParserException catch (e) { logger.e('Error parsing XML: $e'); } diff --git a/lib/providers/application_provider.dart b/lib/providers/application_provider.dart index 6d375e2..0cc9eca 100644 --- a/lib/providers/application_provider.dart +++ b/lib/providers/application_provider.dart @@ -26,14 +26,14 @@ final remoteAppListProvider = }); final installedAppListProvider = - AutoDisposeNotifierProvider>( + AutoDisposeNotifierProvider>( InstalledAppListNotifier.new); -class InstalledAppListNotifier extends AutoDisposeNotifier> { - List _getInstalledPackages() { +class InstalledAppListNotifier extends AutoDisposeNotifier> { + Map _getInstalledPackages() { final backend = ref.read(backendProvider); Map env = Platform.environment; - List apps = []; + Map apps = {}; if (env['TEST_BACKEND_ENABLED'] != null) { return backend.getInstalledPackages(); @@ -46,7 +46,7 @@ class InstalledAppListNotifier extends AutoDisposeNotifier> { } @override - List build() { + Map build() { return _getInstalledPackages(); } @@ -79,10 +79,10 @@ final appListProvider = Provider((ref) { final installedApps = ref.watch(installedAppListProvider); final featuredApps = ref.watch(featuredAppList); - // if (installedApps.hasValue) - for (var app in installedApps) { + for (var app in installedApps.entries) { try { - remoteApps[app]!.installed = true; + remoteApps[app.key]!.installed = true; + remoteApps[app.key]!.current = app.value; } catch (e) { logger.w('Failed to find $app in installed list.'); }