/**
 * UI state for the desktop app — sidebar open/closed, active date.
 * Not persisted (sidebar state resets on reload).
 */
import { defineStore } from "pinia"

export const useUiStore = defineStore("ui", () => {
  const leftSidebarOpen = ref(true)
  const rightSidebarOpen = ref(false)
  const activeDate = ref("")

  /** Set the active journal date. JournalView watches this and scrolls. */
  function setActiveDate(date: string) {
    activeDate.value = date
  }

  return {
    leftSidebarOpen,
    rightSidebarOpen,
    activeDate,
    setActiveDate,
  }
})
