diff --git a/apps/shelve/app/components/layout/Navbar.vue b/apps/shelve/app/components/layout/Navbar.vue
index 1fca17ed..6f132066 100644
--- a/apps/shelve/app/components/layout/Navbar.vue
+++ b/apps/shelve/app/components/layout/Navbar.vue
@@ -21,6 +21,7 @@ const allNavigations = computed(() => {
const isSearchActive = ref(false)
const searchQuery = ref('')
const selectedTeamIndex = ref(0)
+const loading = useNavbarLoading()
const toggleSearch = () => {
isSearchActive.value = !isSearchActive.value
@@ -77,9 +78,9 @@ defineShortcuts({
-
+
-
@@ -102,7 +103,7 @@ defineShortcuts({
:exit="{ opacity: 0 }"
:transition="{ duration: 0.2 }"
>
-
+
({ required: false })
-const search = defineModel
('search', { required: false })
+const isSearchActive = defineModel({ required: true })
+const search = defineModel('search', { required: true })
const selectedIndex = defineModel('selectedIndex', { required: false, default: 0 })
+const { createTeam } = useTeamsService()
// Command palette setup
-const { commandGroups, createTeamFromSearch, version, subMenuState, deactivateSubMenu } = useAppCommands()
+const { commandGroups, version, subMenuState, deactivateSubMenu } = useAppCommands()
const {
scrollContainerRef,
@@ -16,7 +17,6 @@ const {
getItemGlobalIndex,
navigateUp,
navigateDown,
- selectCurrentItem,
scrollToSelectedItem
} = useCommandPalette(search, commandGroups, {
onClose: () => {
@@ -58,7 +58,7 @@ const handleSubmenuAction = (item: CommandItem, index: number) => {
savedMainMenuIndex = index
// Execute the action (which will activate the submenu)
- item.action()
+ if (item.action) item.action()
// Reset selection in new submenu
selectedIndex.value = 0
@@ -193,7 +193,7 @@ function playAction(item: CommandItem, index: number) {
diff --git a/apps/shelve/app/composables/useAppCommands.ts b/apps/shelve/app/composables/useAppCommands.ts
index bdbbf2eb..b1d909aa 100644
--- a/apps/shelve/app/composables/useAppCommands.ts
+++ b/apps/shelve/app/composables/useAppCommands.ts
@@ -228,7 +228,7 @@ export function useAppCommands() {
icon: 'lucide:bug',
description: 'Report a bug or issue',
action: () => {
- window.open('https://github.com/hugorcd/shelve/issues', '_blank')
+ window.open('https://github.com/HugoRCD/shelve/issues/new/choose', '_blank')
},
keywords: ['issues', 'bug', 'report', 'problem'],
},
@@ -321,15 +321,8 @@ export function useAppCommands() {
]
})
- // Helper function to create a team
- const createTeamFromSearch = async (teamName: string) => {
- if (!teamName) return
- await createTeam(teamName)
- }
-
return {
commandGroups,
- createTeamFromSearch,
version,
currentTeam,
subMenuState,
diff --git a/apps/shelve/app/composables/useStore.ts b/apps/shelve/app/composables/useStore.ts
index 245b2ecb..6f9efa7e 100644
--- a/apps/shelve/app/composables/useStore.ts
+++ b/apps/shelve/app/composables/useStore.ts
@@ -43,3 +43,7 @@ export function useEnvironments(): Ref {
export function useVariables(projectId: string): Ref {
return useState(`variables-${projectId}`)
}
+
+export function useNavbarLoading(): Ref {
+ return useState('navbar-loading', () => false)
+}
diff --git a/apps/shelve/app/composables/useTeams.ts b/apps/shelve/app/composables/useTeams.ts
index 1921f579..7d1e5fda 100644
--- a/apps/shelve/app/composables/useTeams.ts
+++ b/apps/shelve/app/composables/useTeams.ts
@@ -22,6 +22,7 @@ export function useTeamsService() {
const currentTeam = useTeam()
const loading = ref(false)
const createLoading = ref(false)
+ const navbarLoading = useNavbarLoading()
const defaultTeamSlug = useCookie('defaultTeamSlug')
@@ -50,6 +51,7 @@ export function useTeamsService() {
async function createTeam(name: string): Promise {
createLoading.value = true
+ navbarLoading.value = true
try {
const team = await $fetch('/api/teams', {
method: 'POST',
@@ -67,6 +69,7 @@ export function useTeamsService() {
toast.error('Failed to create team')
} finally {
createLoading.value = false
+ navbarLoading.value = false
}
}