Files
codeg/src/components/layout/status-bar-session-info.tsx
xintaofei d9323d7399 refactor(workspace): migrate from per-folder windows to single-window workspace
Replace the legacy folder + welcome routes with a unified /workspace route
that hosts all folders, conversations, tabs, and terminals in one window.

- Persist opened tabs to the database (opened_tabs entity + migration)
  so tab layout survives restarts and deep-link bootstrap restores state
- Replace FolderContext shim with AppWorkspaceProvider, ActiveFolderProvider,
  and TabProvider; expose both opened (folders) and full DB (allFolders)
  listings via list_all_folder_details
- Return conversations across all non-deleted folders from list_all when
  no folder filter is given, so the sidebar can show every folder's history
- Add ConversationContextBar above the chat input with folder picker
  (auto-opens unopened folders on select), branch picker, and commit /
  push / merge / stash entries to restore BranchDropdown functionality
- Rework sidebar with stats header, search, flat / folder-grouped view
  modes (localStorage-persisted), reveal-in-sidebar event subscriber,
  and per-folder context menu (focus, close tabs, remove from workspace);
  indent conversations under folder headers in grouped mode
- Gate terminal creation on active folder and show folder context
- Remove deprecated BranchDropdown, FolderNameDropdown, welcome route,
  and per-folder window commands
- Localize all new strings across 10 locales
2026-04-20 21:22:36 +08:00

39 lines
1.0 KiB
TypeScript

"use client"
import { useMemo } from "react"
import { GitBranch } from "lucide-react"
import { useTabContext } from "@/contexts/tab-context"
import { useAppWorkspace } from "@/contexts/app-workspace-context"
export function StatusBarSessionInfo() {
const { tabs, activeTabId } = useTabContext()
const { conversations } = useAppWorkspace()
const activeTab = useMemo(
() => tabs.find((t) => t.id === activeTabId) ?? null,
[tabs, activeTabId]
)
const summary = useMemo(() => {
if (!activeTab || activeTab.kind !== "conversation") return null
return conversations.find(
(c) =>
c.id === activeTab.conversationId &&
c.agent_type === activeTab.agentType
)
}, [activeTab, conversations])
if (!summary) return null
return (
<div className="flex items-center gap-4">
{summary.git_branch && (
<span className="flex items-center gap-1">
<GitBranch className="h-3 w-3" />
{summary.git_branch}
</span>
)}
</div>
)
}