fix: keep vault loading shell visible

This commit is contained in:
lucaronin
2026-04-29 22:52:19 +02:00
parent 2a2ea1b8ef
commit 1f4889fe66
14 changed files with 938 additions and 124 deletions

View File

@@ -14,7 +14,9 @@ export interface Tab {
export interface EditorContentProps {
activeTab: Tab | null
activeTabPath: string | null
isLoadingNewTab: boolean
isVaultLoading?: boolean
entries: VaultEntry[]
editor: ReturnType<typeof useCreateBlockNote>
diffMode: boolean
@@ -56,6 +58,7 @@ export interface EditorContentProps {
export function useEditorContentModel(props: EditorContentProps) {
const {
activeTab,
activeTabPath,
entries,
rawMode,
diffMode,
@@ -77,6 +80,10 @@ export function useEditorContentModel(props: EditorContentProps) {
activeStatus: props.activeStatus,
})
const showEditor = !diffMode && showContentEditor
const loadingEntry = !activeTab && activeTabPath
? entries.find((entry) => entry.path === activeTabPath) ?? null
: null
const loadingTab = loadingEntry ? { entry: loadingEntry, content: '' } : null
const breadcrumbBarRef = useRef<HTMLDivElement | null>(null)
@@ -88,6 +95,7 @@ export function useEditorContentModel(props: EditorContentProps) {
effectiveRawMode,
forceRawMode: isNonMarkdownText || isDeletedPreview,
showEditor,
loadingTab,
path,
breadcrumbBarRef,
wordCount,