From 1f4889fe66917c2280f8d65e9e763c6d7e79caef Mon Sep 17 00:00:00 2001 From: lucaronin Date: Wed, 29 Apr 2026 22:52:19 +0200 Subject: [PATCH] fix: keep vault loading shell visible --- src/App.test.tsx | 17 +- src/App.tsx | 17 +- src/components/BreadcrumbBar.tsx | 26 +- src/components/Editor.test.tsx | 20 ++ src/components/Editor.tsx | 16 +- src/components/Sidebar.tsx | 305 ++++++++++++++++-- src/components/SidebarParts.tsx | 23 +- .../editor-content/EditorContentLayout.tsx | 273 ++++++++++++---- .../editor-content/useEditorContentModel.ts | 8 + src/components/note-list/NoteListLayout.tsx | 60 +++- src/components/note-list/useNoteListModel.tsx | 5 + .../sidebar/SidebarLoadingSections.tsx | 277 ++++++++++++++++ src/components/sidebar/SidebarTopNav.tsx | 5 + tests/smoke/vault-loading-skeleton.spec.ts | 10 +- 14 files changed, 938 insertions(+), 124 deletions(-) create mode 100644 src/components/sidebar/SidebarLoadingSections.tsx diff --git a/src/App.test.tsx b/src/App.test.tsx index 62878a47..c7f8c2cd 100644 --- a/src/App.test.tsx +++ b/src/App.test.tsx @@ -517,10 +517,16 @@ describe('App', () => { render() - await waitFor(() => { - expect(screen.queryByTestId('vault-loading-skeleton')).not.toBeInTheDocument() - }) - expect(screen.getByText('Select a note to start editing')).toBeInTheDocument() + expect(await screen.findByTestId('sidebar-loading-favorites', {}, { timeout: 5000 })).toBeInTheDocument() + expect(screen.queryByTestId('vault-loading-skeleton')).not.toBeInTheDocument() + expect(screen.getByTestId('sidebar-top-nav')).toHaveTextContent('Inbox') + expect(screen.getByTestId('sidebar-loading-views')).toBeInTheDocument() + expect(screen.getByTestId('sidebar-loading-types')).toBeInTheDocument() + expect(screen.getByTestId('sidebar-loading-folders')).toBeInTheDocument() + expect(screen.getByTestId('note-list-loading-skeleton')).toBeInTheDocument() + expect(screen.getByTestId('breadcrumb-title-skeleton')).toBeInTheDocument() + expect(screen.getByTestId('editor-content-skeleton')).toBeInTheDocument() + expect(screen.queryByText('Select a note to start editing')).not.toBeInTheDocument() expect(screen.getByTestId('status-vault-reloading')).toHaveAccessibleName('Reloading vault from disk') await act(async () => { fireEvent.keyDown(window, { key: 'p', code: 'KeyP', metaKey: true }) @@ -535,6 +541,9 @@ describe('App', () => { await waitFor(() => { expect(screen.queryByTestId('vault-loading-skeleton')).not.toBeInTheDocument() + expect(screen.queryByTestId('note-list-loading-skeleton')).not.toBeInTheDocument() + expect(screen.queryByTestId('breadcrumb-title-skeleton')).not.toBeInTheDocument() + expect(screen.queryByTestId('editor-content-skeleton')).not.toBeInTheDocument() expect(screen.queryByTestId('status-vault-reloading')).not.toBeInTheDocument() expect(screen.getAllByText('Test Project').length).toBeGreaterThan(0) }) diff --git a/src/App.tsx b/src/App.tsx index dc6f3930..16cd6ab8 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -1609,17 +1609,7 @@ function App() { ) } - // Show the full skeleton only while app-level vault capabilities are unknown. - if (!noteWindowParams && onboarding.state.status === 'ready' && gitRepoState === 'checking') { - return ( - - ) - } + const isVaultContentLoading = !noteWindowParams && onboarding.state.status === 'ready' && vault.isLoading return (
@@ -1627,7 +1617,7 @@ function App() { {sidebarVisible && ( <>
- +
@@ -1638,7 +1628,7 @@ function App() { {effectiveSelection.kind === 'filter' && effectiveSelection.filter === 'pulse' ? ( handleSetViewMode('all')} locale={appLocale} /> ) : ( - + )}
@@ -1648,6 +1638,7 @@ function App() { locale?: AppLocale + loadingTitle?: boolean } const DISABLED_ICON_STYLE = { opacity: 0.4, cursor: 'not-allowed' } as const @@ -615,6 +616,16 @@ function FilenameCrumb({ entry, locale = 'en', onRenameFilename }: Pick