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

SNApp-notes / web / 19396077261

15 Nov 2025 09:53PM UTC coverage: 56.102% (-6.5%) from 62.6%
19396077261

push

github

jcubic
fix unit/integration tests

341 of 639 branches covered (53.36%)

Branch coverage included in aggregate %.

629 of 1090 relevant lines covered (57.71%)

197.6 hits per line

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

75.0
/src/components/AppLayoutClient.tsx
1
/**
2
 * Client-side layout wrapper for main application structure.
3
 * Arranges navigation, sidebar, content panels, and footer using CSS grid layout.
4
 *
5
 * @remarks
6
 * Dependencies: `./notes/MainNotesLayout.module.css` for CSS Module grid layout styles,
7
 * and `./Footer` for application footer component.
8
 *
9
 * **Layout Structure:**
10
 * ```
11
 * ┌─────────────────────────┐
12
 * │      navigation         │  (Top nav bar)
13
 * ├──────────┬──────────────┤
14
 * │          │              │
15
 * │ sidebar  │   content    │  (Main panels)
16
 * │          │              │
17
 * └──────────┴──────────────┘
18
 * │       children          │  (Optional additional content)
19
 * └─────────────────────────┘
20
 * │        Footer           │  (Copyright info)
21
 * └─────────────────────────┘
22
 * ```
23
 *
24
 * **Usage:**
25
 * - Used in `src/app/layout.tsx` as the root layout wrapper
26
 * - Receives slots from Next.js parallel routes (@navigation, @sidebar, @content)
27
 * - Flexible: all props are optional
28
 *
29
 * **CSS Grid:**
30
 * - Uses CSS Modules for scoped styling
31
 * - Responsive grid layout defined in `MainNotesLayout.module.css`
32
 * - Sidebar and content panels are arranged horizontally
33
 *
34
 * **Keyboard Shortcuts:**
35
 * - Ctrl+Shift+F / Cmd+Shift+F: Open search modal (US-020)
36
 * - Ctrl+G / Cmd+G: Close search modal (when open)
37
 * - Ctrl+S / Cmd+S: Save current note
38
 *
39
 * @example
40
 * ```tsx
41
 * import AppLayoutClient from '@/components/AppLayoutClient';
42
 *
43
 * export default function RootLayout({ children }: { children: React.ReactNode }) {
44
 *   return (
45
 *     <AppLayoutClient
46
 *       navigation={<TopNavigationBar />}
47
 *       sidebar={<LeftPanel />}
48
 *       content={<MainContent />}
49
 *     >
50
 *       {children}
51
 *     </AppLayoutClient>
52
 *   );
53
 * }
54
 * ```
55
 *
56
 * @public
57
 */
58
'use client';
59

60
import styles from './notes/MainNotesLayout.module.css';
61
import Footer from './Footer';
62
import { useKeyboardShortcut } from '@/hooks/useKeyboardShortcut';
63
import { useSearchContext } from '@/components/search/SearchContext';
64
import { SearchModal } from '@/components/search/SearchModal';
65

66
/**
67
 * Props for AppLayoutClient component.
68
 *
69
 * @internal
70
 */
71
interface AppLayoutClientProps {
72
  navigation?: React.ReactNode;
73
  sidebar?: React.ReactNode;
74
  content?: React.ReactNode;
75
  children?: React.ReactNode;
76
}
77

78
/**
79
 * Application layout wrapper with navigation, sidebar, content, and footer.
80
 *
81
 * @param props - Layout slot contents
82
 * @param props.navigation - Top navigation bar (from @navigation slot)
83
 * @param props.sidebar - Left sidebar panel (from @sidebar slot)
84
 * @param props.content - Main content area (from @content slot)
85
 * @param props.children - Additional content below main panels
86
 * @returns Rendered layout structure
87
 *
88
 * @remarks
89
 * This component is the main layout container for the application. It receives
90
 * content from Next.js parallel routes and arranges them in a CSS grid layout.
91
 *
92
 * **Slots:**
93
 * - `navigation`: Top navigation bar (user menu, title)
94
 * - `sidebar`: Left panel (notes tree, create button)
95
 * - `content`: Main content area (note editor)
96
 * - `children`: Additional content (modals, dialogs)
97
 *
98
 * **Styling:**
99
 * - Uses CSS Modules for scoped styling (`MainNotesLayout.module.css`)
100
 * - Grid layout with flexible sidebar and content panels
101
 * - Footer always pinned to bottom
102
 *
103
 * **Keyboard Shortcuts:**
104
 * - Ctrl+Shift+F: Opens search modal
105
 *
106
 * @example
107
 * ```tsx
108
 * <AppLayoutClient
109
 *   navigation={<TopNavigationBar />}
110
 *   sidebar={<LeftPanel />}
111
 *   content={<NoteEditor />}
112
 * />
113
 * ```
114
 *
115
 * @public
116
 */
117
export default function AppLayoutClient({
36✔
118
  navigation,
119
  sidebar,
120
  content,
121
  children
122
}: AppLayoutClientProps) {
123
  const { openModal } = useSearchContext();
134✔
124

125
  // Register Ctrl+Shift+F (Windows/Linux) and Cmd+Shift+F (MacOS) keyboard shortcut for search
126
  useKeyboardShortcut(['CTRL+SHIFT+F', 'META+SHIFT+F'], openModal);
134✔
127

128
  return (
×
129
    <div className={styles.layout}>
130
      {navigation}
131
      <div className={styles.panels}>
132
        {sidebar}
133
        {content}
134
      </div>
135
      {children}
136
      <SearchModal />
137
      <Footer />
138
    </div>
139
  );
140
}
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