-

+
@@ -59,7 +100,14 @@
import {useAppVersion} from "~/composables/useAppVersion";
const auth = useAuthStore()
+const ui = useUiStore()
const {version} = useAppVersion()
+const route = useRoute()
+
+const currentProjectId = computed(() => {
+ const match = route.path.match(/^\/projects\/(\d+)/)
+ return match ? match[1] : null
+})
const handleLogout = async () => {
await auth.logout()
diff --git a/frontend/stores/ui.ts b/frontend/stores/ui.ts
new file mode 100644
index 0000000..fc51610
--- /dev/null
+++ b/frontend/stores/ui.ts
@@ -0,0 +1,22 @@
+export const useUiStore = defineStore('ui', () => {
+ const sidebarCollapsed = ref(false)
+
+ if (import.meta.client) {
+ const saved = localStorage.getItem('ui-sidebar-collapsed')
+ if (saved !== null) {
+ sidebarCollapsed.value = saved === 'true'
+ }
+ }
+
+ watch(sidebarCollapsed, (val) => {
+ if (import.meta.client) {
+ localStorage.setItem('ui-sidebar-collapsed', String(val))
+ }
+ })
+
+ function toggleSidebar() {
+ sidebarCollapsed.value = !sidebarCollapsed.value
+ }
+
+ return { sidebarCollapsed, toggleSidebar }
+})