On Windows, Tauri returns paths with backslash separators. Multiple
components used .split('/') to extract filenames/segments, which
returned the entire path as a single element on Windows. Changed all
instances to .split(/[/\]/) to handle both Unix and Windows paths.
Affected: ProjectContextChip, ToolCallBlock, PermissionDialog,
ToolCallGroup, FileSearchMenu, InlineImageGallery,
LocalSlashCommandPanel, ProjectFilter, StatusBar, DirectoryPicker.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
37 lines
1.4 KiB
TypeScript
37 lines
1.4 KiB
TypeScript
import { useSettingsStore } from '../../stores/settingsStore'
|
|
import { useSessionStore } from '../../stores/sessionStore'
|
|
import { useSessionRuntimeStore } from '../../stores/sessionRuntimeStore'
|
|
import { useTabStore } from '../../stores/tabStore'
|
|
|
|
export function StatusBar() {
|
|
const { currentModel } = useSettingsStore()
|
|
const activeTabId = useTabStore((s) => s.activeTabId)
|
|
const runtimeSelection = useSessionRuntimeStore((s) =>
|
|
activeTabId ? s.selections[activeTabId] : undefined,
|
|
)
|
|
const projectPath = useSessionStore((s) => s.sessions.find((session) => session.id === activeTabId)?.projectPath)
|
|
|
|
const projectName = projectPath
|
|
? projectPath.split(/[/\\]/).filter(Boolean).pop() || ''
|
|
: ''
|
|
const modelLabel = runtimeSelection?.modelId ?? currentModel?.name ?? null
|
|
|
|
return (
|
|
<div className="h-[var(--statusbar-height)] flex items-center justify-between px-4 border-t border-[var(--color-border)] bg-[var(--color-surface-sidebar)] select-none text-[11px]">
|
|
<div className="flex items-center gap-3">
|
|
{projectName && (
|
|
<span className="text-[var(--color-text-secondary)] font-[var(--font-mono)]">{projectName}</span>
|
|
)}
|
|
</div>
|
|
|
|
<div className="flex items-center gap-4">
|
|
{modelLabel && (
|
|
<span className="text-[var(--color-text-tertiary)] font-[var(--font-mono)]">
|
|
{modelLabel}
|
|
</span>
|
|
)}
|
|
</div>
|
|
</div>
|
|
)
|
|
}
|