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

jcubic / 10xDevs / 18687268278

21 Oct 2025 02:28PM UTC coverage: 21.69% (+2.2%) from 19.515%
18687268278

push

github

jcubic
more test for the Editor component

89 of 121 branches covered (73.55%)

Branch coverage included in aggregate %.

522 of 2696 relevant lines covered (19.36%)

3.49 hits per line

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

3.03
/src/components/notes/MainNotesLayout.tsx
1
import type { Note } from '@prisma/client';
1✔
2
import type { NoteTreeNode } from '@/types/tree';
3
import { getNotes } from '@/app/actions/notes';
×
4
import { NotesProvider } from './NotesContext';
×
5
import MainNotesClient from './MainNotesClient';
×
6
import styles from './MainNotesLayout.module.css';
×
7

8
interface MainNotesLayoutProps {
9
  selectedNoteId?: number;
10
  lineNumber?: number;
11
}
12

13
// Convert Prisma Note to NoteTreeNode
14
function convertNoteToTreeNode(note: Note, selectedNoteId?: number): NoteTreeNode {
×
15
  return {
×
16
    id: note.id,
×
17
    name: note.name,
×
18
    selected: note.id === selectedNoteId,
×
19
    data: {
×
20
      content: note.content, // Preserve null for example notes
×
21
      dirty: false
×
22
    }
×
23
  };
×
24
}
×
25

26
export default async function MainNotesLayout({
×
27
  selectedNoteId,
×
28
  lineNumber
×
29
}: MainNotesLayoutProps) {
×
30
  // Single fetch - get all notes once
31
  const notes = await getNotes();
×
32

33
  // Convert to TreeNodes
34
  const treeNodes: NoteTreeNode[] = notes.map((note) =>
×
35
    convertNoteToTreeNode(note, selectedNoteId)
×
36
  );
×
37

38
  return (
×
39
    <NotesProvider
×
40
      initialNotes={treeNodes}
×
41
      initialSelectedNoteId={selectedNoteId || null}
×
42
    >
43
      <div className={styles.layout}>
×
44
        <MainNotesClient lineNumber={lineNumber} />
×
45
      </div>
×
46
    </NotesProvider>
×
47
  );
48
}
×
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