Skip to content

Commit f70b7d8

Browse files
authored
Merge pull request #8 from anibal/claude/review-claude-md-011CV2UPaJR82LiCVjRYj4SL
Update CLAUDE.md documentation file
2 parents 187a948 + 48d4369 commit f70b7d8

1 file changed

Lines changed: 28 additions & 8 deletions

File tree

CLAUDE.md

Lines changed: 28 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ On mobile (<800px), Explorer, Search, and RecentNotes merge into a **single over
136136
- Scroll lock removed
137137
- RecentNotes collapsed
138138

139-
**Implementation** (`quartz/components/scripts/explorer.inline.ts:29-100`):
139+
**Implementation** (see `toggleExplorer()` function in `quartz/components/scripts/explorer.inline.ts`):
140140
- Stores original parent and next sibling references before moving components
141141
- Uses `checkVisibility()` on mobile button to detect viewport size
142142
- `insertBefore()` and `appendChild()` for DOM manipulation
@@ -149,7 +149,7 @@ On desktop (≥800px), only **one sidebar can be expanded** at a time:
149149
- Expanding RecentNotes collapses Explorer
150150
- Prevents overwhelming sidebar content
151151

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`)
153153

154154
#### Viewport Detection Patterns
155155

@@ -198,11 +198,11 @@ Prevents background page scrolling while overlay is active. Removed on close.
198198
- `graph-loader.inline.ts` checks viewport with `window.matchMedia`
199199
- Dynamically loads separate `graph.bundle.js` on-demand
200200
- 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
203203
- SPA router defines `window.addCleanup` that other component scripts depend on
204204
- 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`
206206

207207
## Key Source Directories
208208

@@ -216,8 +216,8 @@ quartz/
216216
├── plugins/
217217
│ ├── types.ts # Plugin interface definitions
218218
│ ├── transformers/ # 14 content transformation plugins
219-
│ ├── filters/ # 3 filtering plugins
220-
│ ├── emitters/ # 14 output generation plugins
219+
│ ├── filters/ # 2 filtering plugins
220+
│ ├── emitters/ # 12 output generation plugins
221221
│ └── vfile.ts # VFile (virtual file) extensions
222222
├── processors/
223223
│ ├── parse.ts # Markdown parsing orchestration
@@ -379,7 +379,7 @@ if (cfg.enableSPA) {
379379
- Loading SPA router last causes "window.addCleanup is not a function" errors
380380
- Always use `unshift()` for foundational utilities, `push()` for dependent scripts
381381

382-
See `quartz/plugins/emitters/componentResources.ts:84-93`
382+
See `addGlobalPageResources()` function in `quartz/plugins/emitters/componentResources.ts`
383383

384384
## Custom Slug Plugin
385385

@@ -475,6 +475,26 @@ See `.playwright-mcp/` directory for example test artifacts.
475475
9. **Mobile viewport detection**: Use `checkVisibility()` on mobile-only elements OR `window.matchMedia()` for viewport checks. Don't rely solely on CSS classes.
476476
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.
477477

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+
478498
## File Trie & Searching
479499

480500
`FileTrie` data structure enables efficient file searching:

0 commit comments

Comments
 (0)