Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Show sidebar toggle keybinding shortcut on sidebar icon tooltip #1160

Merged
merged 1 commit into from
Oct 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion src/components/sidebar/SideToolbar.vue
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
:key="tab.id"
:icon="tab.icon"
:iconBadge="tab.iconBadge"
:tooltip="tab.tooltip"
:tooltip="tab.tooltip + getTabTooltipSuffix(tab)"
:selected="tab.id === selectedTab?.id"
:class="tab.id + '-tab-button'"
@click="onTabClick(tab)"
Expand Down Expand Up @@ -45,6 +45,7 @@ import {
CustomSidebarTabExtension,
SidebarTabExtension
} from '@/types/extensionTypes'
import { useKeybindingStore } from '@/stores/keybindingStore'

const workspaceStore = useWorkspaceStore()
const settingStore = useSettingStore()
Expand Down Expand Up @@ -74,6 +75,14 @@ onBeforeUnmount(() => {
}
})
})

const keybindingStore = useKeybindingStore()
const getTabTooltipSuffix = (tab: SidebarTabExtension) => {
const keybinding = keybindingStore.getKeybindingByCommandId(
`Workspace.ToggleSidebarTab.${tab.id}`
)
return keybinding ? ` (${keybinding.combo.toString()})` : ''
}
</script>

<style>
Expand Down
2 changes: 1 addition & 1 deletion src/stores/workspace/sidebarTabStore.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { useWorkflowsSidebarTab } from '@/hooks/sidebarTabs/workflowsSidebarTab'
import { SidebarTabExtension } from '@/types/extensionTypes'
import { defineStore } from 'pinia'
import { computed, ref } from 'vue'
import { useCommandStore } from '../commandStore'
import { useCommandStore } from '@/stores/commandStore'

export const useSidebarTabStore = defineStore('sidebarTab', () => {
const sidebarTabs = ref<SidebarTabExtension[]>([])
Expand Down
Loading