Skip to content

Commit 27dfd89

Browse files
committed
tabsets-355 Merge filter widgets in openTabs view
1 parent 5e95d99 commit 27dfd89

File tree

4 files changed

+26
-16
lines changed

4 files changed

+26
-16
lines changed

commands/AddTabToTabsetCommand.ts

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ import { useFeaturesStore } from 'src/features/stores/featuresStore'
1515
import { useRequestsService } from 'src/requests/services/RequestsService'
1616
import { useRequestsStore } from 'src/requests/stores/requestsStore'
1717
import { useLogger } from 'src/services/Logger'
18-
import { useAuthStore } from 'src/stores/authStore'
1918
import { Tab } from 'src/tabsets/models/Tab'
2019
import { ChangeInfo, Tabset, TabsetSharing } from 'src/tabsets/models/Tabset'
2120
import { useTabsetService } from 'src/tabsets/services/TabsetService2'
@@ -107,15 +106,6 @@ export class AddTabToTabsetCommand implements Command<any> {
107106

108107
Analytics.fireEvent('tabset_tab_added', { tabsCount: tabset.tabs.length })
109108

110-
// Analysis not needed, remove
111-
if (useAuthStore().user.uid && this.tab.url?.startsWith('https://')) {
112-
const userId = useAuthStore().user.uid
113-
// setDoc(doc(FirebaseServices.getFirestore(), 'users', userId, 'queue', uid()), {
114-
// event: 'new-tab',
115-
// url: this.tab.url,
116-
// })
117-
}
118-
119109
// Sharing
120110
if (tabset.sharing?.sharedId && tabset.sharing.sharing === TabsetSharing.PUBLIC_LINK && !this.activeFolder) {
121111
tabset.sharing.sharing = TabsetSharing.PUBLIC_LINK_OUTDATED
@@ -162,7 +152,7 @@ export class AddTabToTabsetCommand implements Command<any> {
162152
}
163153

164154
// add to search index via App Dispatcher
165-
AppEventDispatcher.dispatchEvent('add-to-search', {
155+
await AppEventDispatcher.dispatchEvent('add-to-search', {
166156
name: this.tab.name || '',
167157
title: this.tab.title || '',
168158
url: this.tab.url || '',

dialogues/AddUrlDialog.vue

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,13 @@
2323
:disable="url.trim().length === 0"
2424
v-close-popup
2525
@click="createNewUrl()" />
26+
<DialogButton
27+
label="Add URL"
28+
color="primary"
29+
@was-clicked="createNewUrl()"
30+
:disable="url.trim().length === 0"
31+
v-close-popup
32+
data-testid="add_url_submit" />
2633
</q-card-actions>
2734
</q-card>
2835
</q-dialog>
@@ -31,6 +38,7 @@
3138
<script lang="ts" setup>
3239
import { uid, useDialogPluginComponent } from 'quasar'
3340
import ChromeApi from 'src/app/BrowserApi'
41+
import DialogButton from 'src/core/dialog/buttons/DialogButton.vue'
3442
import { useUtils } from 'src/core/services/Utils'
3543
import { useAuthStore } from 'src/stores/authStore'
3644
import { Tab } from 'src/tabsets/models/Tab'

layouts/SidePanelPageTabList.vue

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,14 @@ watch(
8686
},
8787
)
8888
89+
watch(
90+
() => props.tabset?.tabs || [],
91+
(a: Tab[], b: Tab[]) => {
92+
console.log('--------', a)
93+
tabs.value = tabsForColumn()
94+
},
95+
)
96+
8997
const handleDragAndDrop = async (event: any, column: TabsetColumn) => {
9098
console.log('SidePanelPageTabList d&d event:', event)
9199
const { moved, added } = event

stores/tabsetsStore.ts

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,8 @@ import { computed, ref, watch } from 'vue'
2222
* Elements are persisted to the storage provided in the initialize function
2323
*/
2424
export const useTabsetsStore = defineStore('tabsets', () => {
25-
let loaded = ref(false)
25+
const loaded = ref(false)
26+
const lastUpdate = ref(new Date().getTime())
2627

2728
/**
2829
* the (internal) storage for this store to use
@@ -46,8 +47,8 @@ export const useTabsetsStore = defineStore('tabsets', () => {
4647

4748
const getCurrentTabsetId = async (): Promise<string | undefined> => {
4849
if (chrome && chrome.windows) {
49-
return useSelectedTabsetService().getSelectedTabsetId()
50-
}
50+
return useSelectedTabsetService().getSelectedTabsetId()
51+
}
5152
return currentTabsetId.value
5253
}
5354

@@ -190,7 +191,9 @@ export const useTabsetsStore = defineStore('tabsets', () => {
190191
ts.lastChange = changeInfo
191192
const tabsetWithType: Tabset = JSON.parse(JSON.stringify(ts))
192193
//console.log('--- storing tabset! ---', tabsetWithType.lastChange)
193-
return await storage.saveTabset(tabsetWithType)
194+
const res = await storage.saveTabset(tabsetWithType)
195+
lastUpdate.value = new Date().getTime()
196+
return res
194197
}
195198

196199
function deleteTabset(tsId: string) {
@@ -226,7 +229,7 @@ export const useTabsetsStore = defineStore('tabsets', () => {
226229
// selectCurrentTabset(tabsetId, true)
227230
// })
228231
// } else {
229-
console.debug(`did not find tabset ${tabsetId}, not trying to reload`)
232+
console.debug(`did not find tabset ${tabsetId}, not trying to reload`)
230233
// }
231234
}
232235
return undefined
@@ -435,5 +438,6 @@ export const useTabsetsStore = defineStore('tabsets', () => {
435438
removeReminder,
436439
activeReminders,
437440
loaded,
441+
lastUpdate,
438442
}
439443
})

0 commit comments

Comments
 (0)