···77**Role:** Talk to a **source** about the file tree and other top-level actions.
8899- Lists entries (sidebar): names and stable ids
1010+- `createFile()` for new persisted entries (sidebar “New document”)
1011- Readiness and auth hints (`isReady`, `subscribeReady`)
1112- Does **not** open document contents or run merge/sync
1213- Pairs with a `DocumentProvider` via `documents` + `defaultEditorKind` (injected in `App.tsx`)
+14
src/App.tsx
···11import { useCallback, useEffect, useMemo, useState } from 'react';
22+import { QueryClient, QueryClientProvider } from '@tanstack/react-query';
23import { MemoryRouter, Route, Routes } from 'react-router-dom';
34import { UserIdentityProvider } from './auth/UserIdentityContext';
45import { AppBottomBar } from './components/AppBottomBar';
···1617 type OpenDocRequest,
1718 type WorkspaceKind,
1819} from './workspaces/workspace';
2020+2121+const queryClient = new QueryClient({
2222+ defaultOptions: {
2323+ queries: {
2424+ // File listings are invalidated explicitly (on auth change, on create);
2525+ // don't refetch silently in the background on every mount/focus.
2626+ staleTime: 30_000,
2727+ refetchOnWindowFocus: false,
2828+ },
2929+ },
3030+});
19312032const WORKSPACE_KIND_STORAGE_KEY = 'textile.workspaceKind';
2133···90102 }, []);
9110392104 return (
105105+ <QueryClientProvider client={queryClient}>
93106 <UserIdentityProvider>
94107 <MemoryRouter initialEntries={['/']}>
95108 {/* TODO: Replace this unsupported screen with full non-macOS UI path. */}
···153166 )}
154167 </MemoryRouter>
155168 </UserIdentityProvider>
169169+ </QueryClientProvider>
156170 );
157171}
···3232 /** List entries for this source; reject on transport errors. */
3333 listFiles(): Promise<FileSystemEntry[]>;
3434 /**
3535+ * Create a new persisted entry in this source (e.g. a new Habitat docs
3636+ * record). The shell optimistically inserts it, then refreshes the listing.
3737+ */
3838+ createFile(): Promise<FileSystemEntry>;
3939+ /**
4040+ * When implemented, called when a listed entry's display name changes
4141+ * (e.g. habitat doc heading edits). Used to keep the sidebar in sync.
4242+ */
4343+ subscribeEntryTitles?(
4444+ listener: (entryId: string, name: string) => void,
4545+ ): () => void;
4646+ /**
3547 * Backend kind used when creating new documents from this source.
3648 * TODO: Let users pick the default per source (or globally) in settings.
3749 */