• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

agentic-dev-library / thumbcode / 22032881766

15 Feb 2026 08:57AM UTC coverage: 51.696% (+0.1%) from 51.576%
22032881766

Pull #137

github

web-flow
Merge 4802a33b5 into 7abe8b2f3
Pull Request #137: ⚡ Optimize FileTree rendering with local Zustand store

1332 of 2946 branches covered (45.21%)

Branch coverage included in aggregate %.

21 of 28 new or added lines in 3 files covered. (75.0%)

2203 of 3892 relevant lines covered (56.6%)

10.02 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

71.43
/src/components/code/FileTreeContext.tsx
1
import { createContext, useContext } from 'react';
2
import { type StoreApi, useStore } from 'zustand';
3

4
interface FileTreeState {
5
  expandedPaths: Set<string>;
6
  selectedPath?: string;
7
  onSelectFile?: (path: string) => void;
8
}
9

10
interface FileTreeActions {
11
  toggleExpanded: (path: string) => void;
12
  selectFile: (path: string) => void;
13
}
14

15
export type FileTreeStore = FileTreeState & FileTreeActions;
16

17
export const FileTreeContext = createContext<StoreApi<FileTreeStore> | null>(null);
1✔
18

19
export function useFileTreeStore<T>(selector: (state: FileTreeStore) => T): T {
20
  const store = useContext(FileTreeContext);
124✔
21
  if (!store) {
124!
NEW
22
    throw new Error('useFileTreeStore must be used within a FileTreeContext.Provider');
×
23
  }
24
  return useStore(store, selector);
124✔
25
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc