From f8c5f07e9f25a5030f364369e1762acffd2033bb Mon Sep 17 00:00:00 2001 From: Jon Rogers <67245+devnullvoid@users.noreply.github.com> Date: Fri, 23 Jan 2026 19:39:13 -0500 Subject: [PATCH] Fix: Add view mode persistence for xdg-open picker modals (#1465) * fix: Add browserPickerViewMode persistence to settings spec The BrowserPickerModal (used by xdg-open feature) was not persisting view mode selection between sessions. While the modal had code to save the view mode preference, the browserPickerViewMode property was not registered in SettingsSpec.js, preventing it from being saved to disk. Added browserPickerViewMode and browserUsageHistory to SettingsSpec.js to ensure user's view preference (list/grid) is properly persisted. Fixes view mode reverting to grid after restarting DMS/QuickShell. * fix: Add view mode persistence for both browser and file pickers Extended the fix to include both picker modals used by xdg-open: BrowserPickerModal (URLs): - Added browserPickerViewMode and browserUsageHistory to SettingsSpec.js - Already had save logic in BrowserPickerModal.qml AppPickerModal/filePickerModal (files): - Added appPickerViewMode and filePickerUsageHistory to SettingsSpec.js - Added appPickerViewMode and filePickerUsageHistory properties to SettingsData.qml - Added viewMode binding and onViewModeChanged handler to filePickerModal Both modals now properly persist user's view preference (list/grid) and usage history between sessions. Fixes view mode reverting to default grid after restarting DMS/QuickShell for both 'dms open https://...' and 'dms open file.pdf' workflows. --- quickshell/Common/SettingsData.qml | 2 ++ quickshell/Common/settings/SettingsSpec.js | 4 ++++ quickshell/DMSShell.qml | 5 +++++ 3 files changed, 11 insertions(+) diff --git a/quickshell/Common/SettingsData.qml b/quickshell/Common/SettingsData.qml index ab4e029c..676aae45 100644 --- a/quickshell/Common/SettingsData.qml +++ b/quickshell/Common/SettingsData.qml @@ -274,6 +274,8 @@ Singleton { property string spotlightModalViewMode: "list" property string browserPickerViewMode: "grid" property var browserUsageHistory: ({}) + property string appPickerViewMode: "grid" + property var filePickerUsageHistory: ({}) property bool sortAppsAlphabetically: false property int appLauncherGridColumns: 4 property bool spotlightCloseNiriOverview: true diff --git a/quickshell/Common/settings/SettingsSpec.js b/quickshell/Common/settings/SettingsSpec.js index 8a62a864..d720b89e 100644 --- a/quickshell/Common/settings/SettingsSpec.js +++ b/quickshell/Common/settings/SettingsSpec.js @@ -133,6 +133,10 @@ var SPEC = { appLauncherViewMode: { def: "list" }, spotlightModalViewMode: { def: "list" }, + browserPickerViewMode: { def: "grid" }, + browserUsageHistory: { def: {} }, + appPickerViewMode: { def: "grid" }, + filePickerUsageHistory: { def: {} }, sortAppsAlphabetically: { def: false }, appLauncherGridColumns: { def: 4 }, spotlightCloseNiriOverview: { def: true }, diff --git a/quickshell/DMSShell.qml b/quickshell/DMSShell.qml index 6af23e8d..0218c08c 100644 --- a/quickshell/DMSShell.qml +++ b/quickshell/DMSShell.qml @@ -550,6 +550,11 @@ Item { AppPickerModal { id: filePickerModal title: I18n.tr("Open with...") + viewMode: SettingsData.appPickerViewMode || "grid" + + onViewModeChanged: { + SettingsData.set("appPickerViewMode", viewMode) + } function shellEscape(str) { return "'" + str.replace(/'/g, "'\\''") + "'";