You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
**Implementation** (see `toggleExplorer()` function in `quartz/components/scripts/explorer.inline.ts`):
140
140
- Stores original parent and next sibling references before moving components
141
141
- Uses `checkVisibility()` on mobile button to detect viewport size
142
142
-`insertBefore()` and `appendChild()` for DOM manipulation
@@ -149,7 +149,7 @@ On desktop (≥800px), only **one sidebar can be expanded** at a time:
149
149
- Expanding RecentNotes collapses Explorer
150
150
- Prevents overwhelming sidebar content
151
151
152
-
**Implementation** (`quartz/components/scripts/explorer.inline.ts:103-109` and `recentNotes.inline.ts:24-32`)
152
+
**Implementation**: See the desktop mutual exclusion logic in `toggleExplorer()` function (`explorer.inline.ts`) and `toggleRecentNotes()` function (`recentNotes.inline.ts`)
153
153
154
154
#### Viewport Detection Patterns
155
155
@@ -198,11 +198,11 @@ Prevents background page scrolling while overlay is active. Removed on close.
198
198
-`graph-loader.inline.ts` checks viewport with `window.matchMedia`
199
199
- Dynamically loads separate `graph.bundle.js` on-demand
200
200
- Queues navigation events while bundle loads
201
-
- See `quartz/components/scripts/graph-loader.inline.ts` and `quartz/plugins/emitters/componentResources.ts:buildGraphBundle()`
202
-
7.**Critical Script Loading Order** ⚠️: SPA router MUST be loaded first via `unshift()` in `componentResources.ts:addGlobalPageResources()`
201
+
- See `loadGraphBundle()` function in `quartz/components/scripts/graph-loader.inline.ts` and `buildGraphBundle()` function in `quartz/plugins/emitters/componentResources.ts`
202
+
7.**Critical Script Loading Order** ⚠️: SPA router MUST be loaded first via `unshift()` in emitters
203
203
- SPA router defines `window.addCleanup` that other component scripts depend on
204
204
- Without this order, component cleanup breaks during navigation
205
-
- See `quartz/plugins/emitters/componentResources.ts:84-93`
205
+
- See `addGlobalPageResources()` function in `quartz/plugins/emitters/componentResources.ts`
- Loading SPA router last causes "window.addCleanup is not a function" errors
380
380
- Always use `unshift()` for foundational utilities, `push()` for dependent scripts
381
381
382
-
See `quartz/plugins/emitters/componentResources.ts:84-93`
382
+
See `addGlobalPageResources()` function in `quartz/plugins/emitters/componentResources.ts`
383
383
384
384
## Custom Slug Plugin
385
385
@@ -475,6 +475,26 @@ See `.playwright-mcp/` directory for example test artifacts.
475
475
9.**Mobile viewport detection**: Use `checkVisibility()` on mobile-only elements OR `window.matchMedia()` for viewport checks. Don't rely solely on CSS classes.
476
476
10.**DOM manipulation for mobile**: When moving components between parents, ALWAYS store original parent and next sibling references to restore exact positions. See `explorer.inline.ts` for pattern.
477
477
478
+
## How to Navigate Code References
479
+
480
+
This documentation references **function names and file paths** rather than line numbers, which change frequently as code evolves. This approach provides stable references that survive refactoring and make the documentation easier to maintain.
481
+
482
+
**To find a referenced function**:
483
+
1. Open the file mentioned (e.g., `quartz/components/scripts/explorer.inline.ts`)
484
+
2. Search for the function name (e.g., `toggleExplorer`)
485
+
3. In most IDEs:
486
+
- Text search: `Ctrl/Cmd + F` then type function name
487
+
- Symbol search: `Ctrl/Cmd + Shift + O` (VS Code) or `Ctrl/Cmd + O` (JetBrains)
488
+
- Go to definition: `F12` or `Cmd/Ctrl + Click` on function calls
489
+
490
+
**Why no line numbers?**
491
+
- Line numbers become outdated with every code change
492
+
- Function names are more stable and self-documenting
493
+
- IDE tools work better with names than coordinates
494
+
- Reduces documentation maintenance burden
495
+
496
+
**Example**: Instead of "`componentResources.ts:121-131`", we write "`addGlobalPageResources()` function in `componentResources.ts`"
497
+
478
498
## File Trie & Searching
479
499
480
500
`FileTrie` data structure enables efficient file searching:
0 commit comments