Skip to content

Commit

Permalink
Merge pull request #59 from evandor/TAB-430-tabHistory
Browse files Browse the repository at this point in the history
TAB-430 "Last visited" back/forward feature: Idea: you jump from one …
  • Loading branch information
evandor authored Oct 30, 2023
2 parents cf319d0 + 51b48fc commit 338ecc6
Show file tree
Hide file tree
Showing 26 changed files with 349 additions and 313 deletions.
2 changes: 1 addition & 1 deletion src/components/SidePanelFooter.vue
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@

<SidePanelFooterLeftButton
:side-panel-view="SidePanelView.TABS_LIST" icon="o_playlist_add"
tooltip="List all open tabs in your browser"/>
tooltip="All your browser's open tabs"/>

<SidePanelFooterLeftButton :side-panel-view="SidePanelView.BOOKMARKS" icon="o_bookmark"
tooltip="Show the Bookmarks Browser"/>
Expand Down
16 changes: 16 additions & 0 deletions src/components/buttons/CloseSidePanelViewButton.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<template>
<q-btn
icon="close"
@click="useUiStore().sidePanelSetActiveView(SidePanelView.MAIN)"
color="black"
flat
class="q-ma-none q-pa-xs cursor-pointer"
style="max-width:20px"
size="10px">
<q-tooltip class="tooltip">Close this view</q-tooltip>
</q-btn>

</template>
<script setup lang="ts">
import {SidePanelView, useUiStore} from "stores/uiStore";
</script>
17 changes: 17 additions & 0 deletions src/components/buttons/ToolbarButton.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<template>
<q-btn
:icon="props.icon"
flat
class="q-ma-none q-pa-xs cursor-pointer"
style="max-width:20px"
size="13px">
<q-tooltip class="tooltip" v-if="props.tooltip">{{props.tooltip}}</q-tooltip>

Check failure on line 8 in src/components/buttons/ToolbarButton.vue

View workflow job for this annotation

GitHub Actions / Qodana for JVM

Unresolved TypeScript reference

Unresolved variable tooltip
</q-btn>
</template>
<script setup lang="ts">
const props = defineProps({
icon: {type: String, required: true},
tooltip: {type: String, required: false}
})
</script>
4 changes: 3 additions & 1 deletion src/components/helper/SidePanelFooterLeftButton.vue
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@
:color="isActive() ? 'secondary':'black'"
size="9px"
@click="toggleView()">
<q-tooltip v-if="props.tooltip" class="tooltip">{{ props.tooltip }}</q-tooltip>
<q-tooltip v-if="props.tooltip"
:delay="700"
anchor="top middle" self="bottom middle" class="tooltip-small">{{ props.tooltip }}</q-tooltip>

Check failure on line 11 in src/components/helper/SidePanelFooterLeftButton.vue

View workflow job for this annotation

GitHub Actions / Qodana for JVM

Unresolved TypeScript reference

Unresolved variable tooltip
</q-btn>

</template>
Expand Down
10 changes: 9 additions & 1 deletion src/components/layouts/OpenTabCard.vue
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ import {useSettingsStore} from "src/stores/settingsStore"
import {PropType} from "vue";
const props = defineProps({
tab: {type: Object as PropType<Tab>, required: true},
tab: {type: Object as PropType<chrome.tabs.Tab>, required: true},
useSelection: {type: Boolean, default: false}
})
Expand Down Expand Up @@ -119,6 +119,14 @@ const showAddToTabsetIcon = (tab: Tab) => {
const showSelectIcon = (tab: Tab) => props.useSelection && !useTabsetService().urlExistsInCurrentTabset(tab.url || '')
const historyIndex = (tabId: number | undefined) => {
if (!tabId) {
return ""
}
console.log("checking index", tabId, useTabsStore().chromeTabsHistory)
return _.findIndex(useTabsStore().chromeTabsHistory, e => e === tabId)
}
</script>

<style lang="sass" scoped>
Expand Down
2 changes: 2 additions & 0 deletions src/css/app.scss
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@
background-color: white;
color: black;
font-size: 12px;
margin: 2px;
padding: 3px 6px 3px 6px;
box-shadow: 0 2px 4px -1px rgba(0, 0, 0, 0.2), 0 4px 5px rgba(0, 0, 0, 0.14), 0 1px 10px rgba(0, 0, 0, 0.12);
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import Query from "src/domain/Query";
import {QueryResult} from "src/domain/QueryResult";
import {StatsEntry} from "src/models/StatsEntry";
import {useDB} from "src/services/usePersistenceService";

const {db} = useDB()
Expand Down
File renamed without changes.
14 changes: 0 additions & 14 deletions src/models/StatsEntry.ts

This file was deleted.

2 changes: 1 addition & 1 deletion src/pages/SidePanelPage.vue
Original file line number Diff line number Diff line change
Expand Up @@ -325,7 +325,6 @@ watchEffect(() => {
ts.status !== TabsetStatus.ARCHIVED),
getTabsetOrder, ["asc"])
}
console.log(" *** watchEffect ***")
})
Expand Down Expand Up @@ -556,6 +555,7 @@ const headerStyle = (tabset: Tabset) => {
}
return style
}
</script>

<style>
Expand Down
12 changes: 2 additions & 10 deletions src/pages/SidePanelSearchPage.vue
Original file line number Diff line number Diff line change
Expand Up @@ -35,16 +35,7 @@
:search-hits="tabsetHits.length"
:title="'Found ' + searchStore.term + ' ' + tabsetHits.length + ' time(s)'">
<template v-slot:iconsRight>
<q-btn
icon="close"
@click="useUiStore().sidePanelSetActiveView(SidePanelView.MAIN)"
color="black"
flat
class="q-ma-none q-pa-xs cursor-pointer"
style="max-width:20px"
size="10px">
<q-tooltip class="tooltip">Close this view</q-tooltip>
</q-btn>
<CloseSidePanelViewButton />
</template>
</FirstToolbarHelper>

Expand All @@ -71,6 +62,7 @@ import FirstToolbarHelper from "pages/sidepanel/helper/FirstToolbarHelper.vue";
import Analytics from "src/utils/google-analytics";
import {useTabsStore} from "stores/tabsStore";
import {Tabset} from "src/models/Tabset";
import CloseSidePanelViewButton from "components/buttons/CloseSidePanelViewButton.vue";
const route = useRoute()
const searchStore = useSearchStore()
Expand Down
24 changes: 14 additions & 10 deletions src/pages/sidepanel/SidePanelBookmarksPage.vue
Original file line number Diff line number Diff line change
Expand Up @@ -17,16 +17,14 @@
<FirstToolbarHelper title="Bookmarks">

<template v-slot:iconsRight>
<q-btn
icon="close"
@click="useUiStore().sidePanelSetActiveView(SidePanelView.MAIN)"
color="black"
flat
class="q-ma-none q-pa-xs cursor-pointer"
style="max-width:20px"
size="10px">
<q-tooltip class="tooltip">Close this view</q-tooltip>
</q-btn>

<SidePanelToolbarTabNavigationHelper />

<ToolbarButton
icon="close"
tooltip="Close this view"
@click="useUiStore().sidePanelSetActiveView(SidePanelView.MAIN)"
color="black" />
</template>

</FirstToolbarHelper>
Expand All @@ -44,6 +42,12 @@ import SecondToolbarHelper from "pages/sidepanel/helper/SecondToolbarHelper.vue"
import {SidePanelView, useUiStore} from "stores/uiStore";
import {onMounted} from "vue";
import Analytics from "src/utils/google-analytics";
import {useTabsStore} from "stores/tabsStore";
import NavigationService from "src/services/NavigationService";
import {usePermissionsStore} from "stores/permissionsStore";
import {FeatureIdent} from "src/models/AppFeature";
import ToolbarButton from "components/buttons/ToolbarButton.vue";
import SidePanelToolbarTabNavigationHelper from "pages/sidepanel/helper/SidePanelToolbarTabNavigationHelper.vue";
onMounted(() => {
Analytics.firePageViewEvent('SidePanelBookmarksPage', document.location.href);
Expand Down
14 changes: 4 additions & 10 deletions src/pages/sidepanel/SidePanelByDomainList.vue
Original file line number Diff line number Diff line change
Expand Up @@ -28,16 +28,8 @@
<FirstToolbarHelper title="Domain List">

<template v-slot:iconsRight>
<q-btn
icon="close"
@click="useUiStore().sidePanelSetActiveView(SidePanelView.MAIN)"
color="black"
flat
class="q-ma-none q-pa-xs cursor-pointer"
style="max-width:20px"
size="10px">
<q-tooltip class="tooltip">Close this view</q-tooltip>
</q-btn>
<SidePanelToolbarTabNavigationHelper/>
<CloseSidePanelViewButton />
</template>

</FirstToolbarHelper>
Expand All @@ -56,6 +48,8 @@ import {SidePanelView, useUiStore} from "src/stores/uiStore";
import FirstToolbarHelper from "pages/sidepanel/helper/FirstToolbarHelper.vue";
import Analytics from "src/utils/google-analytics";
import ByDomainListWidget from "components/widgets/ByDomainListWidget.vue";
import SidePanelToolbarTabNavigationHelper from "pages/sidepanel/helper/SidePanelToolbarTabNavigationHelper.vue";
import CloseSidePanelViewButton from "components/buttons/CloseSidePanelViewButton.vue";
const router = useRouter()
Expand Down
15 changes: 5 additions & 10 deletions src/pages/sidepanel/SidePanelNewestTabsPage.vue
Original file line number Diff line number Diff line change
Expand Up @@ -34,16 +34,8 @@
<FirstToolbarHelper title="Newest Tabs">

<template v-slot:iconsRight>
<q-btn
icon="close"
@click="useUiStore().sidePanelSetActiveView(SidePanelView.MAIN)"
color="black"
flat
class="q-ma-none q-pa-xs cursor-pointer"
style="max-width:20px"
size="10px">
<q-tooltip class="tooltip">Close this view</q-tooltip>
</q-btn>
<SidePanelToolbarTabNavigationHelper/>
<CloseSidePanelViewButton />
</template>

</FirstToolbarHelper>
Expand All @@ -68,6 +60,9 @@ import FirstToolbarHelper from "pages/sidepanel/helper/FirstToolbarHelper.vue";
import InfoMessageWidget from "components/widgets/InfoMessageWidget.vue";
import {onMounted} from "vue";
import Analytics from "src/utils/google-analytics";
import SidePanelToolbarTabNavigationHelper from "pages/sidepanel/helper/SidePanelToolbarTabNavigationHelper.vue";
import CloseSidePanelView from "components/buttons/CloseSidePanelView.vue";
import CloseSidePanelViewButton from "components/buttons/CloseSidePanelViewButton.vue";
const tabsStore = useTabsStore()
Expand Down
Loading

0 comments on commit 338ecc6

Please sign in to comment.