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

agentic-dev-library / thumbcode / 22032840233

15 Feb 2026 08:54AM UTC coverage: 51.666% (+0.09%) from 51.576%
22032840233

Pull #139

github

web-flow
Merge c7b24c305 into 7abe8b2f3
Pull Request #139: ⚡ Optimize FileTree rendering performance using Zustand store

1334 of 2951 branches covered (45.21%)

Branch coverage included in aggregate %.

17 of 26 new or added lines in 3 files covered. (65.38%)

13 existing lines in 2 files now uncovered.

2201 of 3891 relevant lines covered (56.57%)

9.84 hits per line

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

37.5
/src/components/code/FileTreeContext.tsx
1
import { createContext } from 'react';
2
import { createStore } from 'zustand/vanilla';
3

4
export interface FileTreeState {
5
  expandedPaths: Set<string>;
6
  selectedPath?: string;
7
}
8

9
export interface FileTreeActions {
10
  toggleExpanded: (path: string) => void;
11
  setSelectedPath: (path: string) => void;
12
  setExpandedPaths: (paths: Set<string>) => void;
13
}
14

15
export type FileTreeStore = ReturnType<typeof createFileTreeStore>;
16

17
export const createFileTreeStore = (initialProps: Partial<FileTreeState> = {}) => {
1✔
18
  return createStore<FileTreeState & FileTreeActions>((set) => ({
8✔
19
    expandedPaths: initialProps.expandedPaths ?? new Set(),
8!
20
    selectedPath: initialProps.selectedPath,
21
    toggleExpanded: (path) =>
NEW
22
      set((state) => {
×
NEW
23
        const next = new Set(state.expandedPaths);
×
NEW
24
        if (next.has(path)) {
×
NEW
25
          next.delete(path);
×
26
        } else {
NEW
27
          next.add(path);
×
28
        }
NEW
29
        return { expandedPaths: next };
×
30
      }),
31
    setSelectedPath: (path) => set({ selectedPath: path }),
8✔
NEW
32
    setExpandedPaths: (paths) => set({ expandedPaths: paths }),
×
33
  }));
34
};
35

36
export const FileTreeContext = createContext<{
1✔
37
  store: FileTreeStore;
38
  onSelectFile?: (path: string) => void;
39
  showStatus?: boolean;
40
} | null>(null);
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