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

jcubic / 10xDevs / 18621254025

18 Oct 2025 09:32PM UTC coverage: 19.473% (+0.2%) from 19.299%
18621254025

push

github

jcubic
replace History API with Next.js routes system

77 of 109 branches covered (70.64%)

Branch coverage included in aggregate %.

0 of 33 new or added lines in 5 files covered. (0.0%)

118 existing lines in 9 files now uncovered.

462 of 2659 relevant lines covered (17.37%)

2.69 hits per line

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

0.0
/src/app/NotesLayoutWrapper.tsx
1
import { auth } from '@/lib/auth';
×
2
import { headers } from 'next/headers';
×
3
import type { Note } from '@prisma/client';
4
import type { NoteTreeNode } from '@/types/tree';
5
import { getNotes } from '@/app/actions/notes';
×
6
import { NotesProvider } from '@/components/notes/NotesContext';
×
7

8
interface NotesLayoutWrapperProps {
9
  children: React.ReactNode;
10
}
11

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

UNCOV
25
export default async function NotesLayoutWrapper({ children }: NotesLayoutWrapperProps) {
×
26
  // Check if user is authenticated
27
  const session = await auth.api.getSession({
×
28
    headers: await headers()
×
UNCOV
29
  });
×
30

31
  // Only load notes if user is authenticated
32
  let treeNodes: NoteTreeNode[] = [];
×
33
  if (session?.user) {
×
34
    try {
×
35
      const notes = await getNotes();
×
36
      treeNodes = notes.map(convertNoteToTreeNode);
×
37
    } catch (error) {
×
UNCOV
38
      console.error('Failed to load notes:', error);
×
39
      // Continue with empty notes array
40
    }
×
UNCOV
41
  }
×
42

43
  return (
×
44
    <NotesProvider initialNotes={treeNodes} initialSelectedNoteId={null}>
×
45
      {children}
×
UNCOV
46
    </NotesProvider>
×
47
  );
UNCOV
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