From 2af22e007defb77e4f59f7afac6545a3ff0dae4f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Carsten=20Gr=C3=A4f?= Date: Fri, 6 Dec 2024 07:35:20 +0100 Subject: [PATCH] tabsets-294: (pw) --- src/components/SidePanelFooter.vue | 53 +------------- .../helper/SidePanelTabsetListMarkup.vue | 69 +++++++++++++++++++ src/core | 2 +- src/features | 2 +- src/pages/helper/AppearanceSettings.vue | 31 ++++++--- src/tabsets | 2 +- 6 files changed, 94 insertions(+), 65 deletions(-) create mode 100644 src/components/helper/SidePanelTabsetListMarkup.vue diff --git a/src/components/SidePanelFooter.vue b/src/components/SidePanelFooter.vue index ad2ed686..36800c3f 100644 --- a/src/components/SidePanelFooter.vue +++ b/src/components/SidePanelFooter.vue @@ -5,32 +5,7 @@ :style="offsetBottom()">
@@ -257,6 +232,7 @@ import {useTabsetsUiStore} from "../tabsets/stores/tabsetsUiStore"; import {useTabsetService} from "src/tabsets/services/TabsetService2"; import {MarkTabsetAsFavoriteCommand} from "src/tabsets/commands/MarkTabsetAsFavorite"; import {MarkTabsetAsDefaultCommand} from "src/tabsets/commands/MarkTabsetAsDefault"; +import SidePanelTabsetListMarkup from "components/helper/SidePanelTabsetListMarkup.vue"; const {handleSuccess, handleError} = useNotificationHandler() @@ -285,7 +261,6 @@ const animateSettingsButton = ref(false) const windowHolderRows = ref([]) const windowsToOpenOptions = ref([]) const tabsetsMangedWindows = ref([]) -const lastTabsets = ref[]>([]) onMounted(() => { windowHolderRows.value = calcWindowHolderRows() @@ -296,21 +271,6 @@ watch(() => useSpacesStore().space, (now: any, before: any) => { useTabsetsUiStore().load() }) -watchEffect(() => { - if (useTabsetsUiStore().lastUpdate) { - const lastTsIds = useTabsetsUiStore().lastUsedTabsets - console.log("got useTabsetsUiStore().lastUpdate", useTabsetsUiStore().lastUpdate, lastTsIds) - lastTabsets.value = lastTsIds.map((tsId: string) => { - const ts = useTabsetsStore().getTabset(tsId) - return { - id: ts?.id || "", - name: ts?.name || "???", - status: ts?.status || TabsetStatus.DEFAULT - } - }) - } -}) - watchEffect(() => { const windowId = useWindowsStore().currentChromeWindow?.id || 0 if (useWindowsStore().windowForId(windowId)?.open) { @@ -370,15 +330,6 @@ watchEffect(() => { } }) -const toggleFavorite = (t: Pick) => { - if (t.status !== TabsetStatus.FAVORITE) { - useCommandExecutor().executeFromUi(new MarkTabsetAsFavoriteCommand(t.id)) - } else { - useCommandExecutor().executeFromUi(new MarkTabsetAsDefaultCommand(t.id)) - } - useTabsetsUiStore().load() -} - const getAdditionalActions = (windowName: string) => { const additionalActions: WindowAction[] = [] if (!windowIsManaged(windowName)) { diff --git a/src/components/helper/SidePanelTabsetListMarkup.vue b/src/components/helper/SidePanelTabsetListMarkup.vue new file mode 100644 index 00000000..16d1a9b3 --- /dev/null +++ b/src/components/helper/SidePanelTabsetListMarkup.vue @@ -0,0 +1,69 @@ + + + diff --git a/src/core b/src/core index a086febe..906b874a 160000 --- a/src/core +++ b/src/core @@ -1 +1 @@ -Subproject commit a086febefc102e3fdfa8afa4b7034f7e242383e2 +Subproject commit 906b874a5c79cc9a85e53d1932331e8d4b39a0a1 diff --git a/src/features b/src/features index e1c23cab..929103f6 160000 --- a/src/features +++ b/src/features @@ -1 +1 @@ -Subproject commit e1c23cabf5a86c12f965c27ae99b52c28254fad9 +Subproject commit 929103f677029be48778d43d2c7bc757d142465d diff --git a/src/pages/helper/AppearanceSettings.vue b/src/pages/helper/AppearanceSettings.vue index 181db143..ee2c094b 100644 --- a/src/pages/helper/AppearanceSettings.vue +++ b/src/pages/helper/AppearanceSettings.vue @@ -6,17 +6,12 @@
- - - - - - - - - + + + + + + @@ -61,6 +56,10 @@ + + + + @@ -189,6 +188,9 @@ import {useUtils} from "src/core/services/Utils"; import {useSettingsStore} from "stores/settingsStore"; import {StaticSuggestionIdent, Suggestion} from "src/suggestions/models/Suggestion"; import {useSuggestionsStore} from "src/suggestions/stores/suggestionsStore"; +import {ActivateFeatureCommand} from "src/features/commands/ActivateFeatureCommand"; +import {useCommandExecutor} from "src/core/services/CommandExecutor"; +import {DeactivateFeatureCommand} from "src/features/commands/DeactivateFeatureCommand"; const { t } = useI18n() const {sendMsg} = useUtils() @@ -203,6 +205,7 @@ const detailLevelPerTabset = ref(LocalStorage.getItem('ui.detailsPerTabset') || const detailLevel = ref(LocalStorage.getItem('ui.detailLevel') || ListDetailLevel.MAXIMAL) const fullUrls = ref(LocalStorage.getItem('ui.fullUrls') || false) const hideIndicatorIcon = ref(LocalStorage.getItem('ui.hideIndicatorIcon') || false) +const showRecentTabsetsList = ref(useFeaturesStore().hasFeature(FeatureIdent.TABSET_LIST)) const contentScriptLoggingOff = ref(LocalStorage.getItem('ui.contentScriptLoggingOff') || false) const oldLayout = ref(LocalStorage.getItem('ui.sidepanel.oldLayout') || false) @@ -272,6 +275,12 @@ watch(() => hideIndicatorIcon.value, (a:any,b:any) => { sendMsg('settings-changed', {identifier: "ui.hideIndicatorIcon", value: hideIndicatorIcon.value}) }) +watch(() => showRecentTabsetsList.value, (now:boolean,before:boolean) => { + now + ? useCommandExecutor().execute(new ActivateFeatureCommand(FeatureIdent.TABSET_LIST.toString())) + : useCommandExecutor().execute(new DeactivateFeatureCommand(FeatureIdent.TABSET_LIST.toString())) +}) + watch(() => contentScriptLoggingOff.value, (a:any,b:any) => { LocalStorage.set('ui.contentScriptLoggingOff', contentScriptLoggingOff.value) sendMsg('settings-changed', {identifier: "ui.contentScriptLoggingOff", value: contentScriptLoggingOff.value}) diff --git a/src/tabsets b/src/tabsets index 6156a5ee..322502c9 160000 --- a/src/tabsets +++ b/src/tabsets @@ -1 +1 @@ -Subproject commit 6156a5eec53fc00cea5964daeeeecfc53662cb58 +Subproject commit 322502c99da21a76bcb23a662b34c5492150fa4e