Conversation
* feat: performance optimizations, schematic API, and branching setup
Backend:
- Fix N+1 queries in communities, processes, ask context, skip chapter
- Add 6 missing DB indexes (migration 0010)
- Add pagination (limit/offset) to files, symbols, narratives repos and API routes
- Expand moka cache capacity 100→500, add caching to files/symbols endpoints
- Add HTTP Cache-Control middleware for GET routes
- Add schematic API endpoint with lazy-load tree + expand + detail
Frontend:
- Add client-side fetch cache (cachedGet with 5min TTL) for read-heavy endpoints
- Rewrite schematic pages: remove ELK.js (1.5MB), inline pure-TS layout engine (159 LOC)
- Add vite-plugin-compression2 (brotli), manual chunk splitting (three, shiki, 3d-graph)
- Lazy-load Shiki languages per file instead of all upfront
CI/Infra:
- Update CI to trigger on dev branch
- Enable delete-branch-on-merge, adopt feature branch workflow
Docs:
- Add docs/OPTIMIZATIONS.md (12-item performance plan)
- Add docs/SCHEMATIC_DESIGN.md (unified explorer design)
- Add docs/adr/0002-unified-schematic-explorer.md
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* docs: add git workflow rules and performance patterns to CLAUDE.md
Ensures all coding agents (Claude, Cursor, etc.) follow the feature
branch workflow (feat/xxx → dev → main) and are aware of established
performance patterns (pagination, caching, N+1 prevention).
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* feat: unified schematic explorer with full interaction system
Backend:
- Community color enrichment for directory nodes (dominant community)
- Grid layout for community overview, layered layout for symbol graphs
- Schematic expand returns subdirectories correctly
Frontend (6 new components, ~730 lines):
- SchematicTooltip: hover tooltips with node metadata
- SchematicDetailTabs: 5-tab detail panel (overview, source, relations, learn, notes)
- SchematicSourcePopup: floating source viewer on double-click
- SchematicContextMenu: right-click actions (view source, ask AI, annotations, etc.)
- SchematicKeyboardOverlay: keyboard shortcut reference (?)
- SchematicMinimap: viewport overview with click-to-pan
Unified page (/explore/schematic):
- Tree + Graph mode toggle with shared state
- Hover highlighting (connected edges + ghost nodes)
- Single click expand/select, double-click deep dive
- Right-click context menu per node type
- Keyboard shortcuts (1/2 modes, F fit, ? help, Esc close)
- Lazy loading via /api/v1/schematic endpoints
- Community sidebar with progress bars in graph mode
- Search highlighting across all nodes
Also:
- Strip ("name") prefix from module_summary narratives
- Grid layout for community nodes (was single row)
- computeFitToView utility in layout.ts
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* feat: add legend panel, drop-shadow on hover, improved node borders
- Legend toggle in toolbar with edge colors, node types, community swatches
- SVG drop-shadow filter on hovered nodes
- Rounded corners rx=8, fix minimap type error
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* fix: polish schematic - root label, tooltip hints, narrative fallback
- Root node shows "codeilus" instead of "."
- Tooltip shows "click to expand" hint for directories
- Detail panel shows helpful message when no narrative available
- Strip ("name") prefix from narratives in detail panel
- Fix minimap type error (community_color cast)
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* fix: community-filtered symbols/edges, source tab loading, root label
Backend:
- Filter symbols by community_id when set (was loading ALL symbols)
- Filter edges to intra-community only (JOIN on community_members)
- Community 2: 241 symbols + 304 edges (was 5773 + 14252)
Frontend:
- Fix Source tab lazy loading (track sourceNodeId to detect node changes)
- Root node shows "codeilus" instead of "."
- Narrative fallback message when no AI explanation
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* feat: E2E tests for schematic (31 tests, all green) + source code fix
Tests (31 passing):
- 6 API tests: schematic, expand, detail, community filter
- 7 tree mode tests: rendering, expand, detail panel, search, minimap
- 3 graph mode tests: mode switch, sidebar, drill-down
- 8 interaction tests: hover, right-click, keyboard, fit, legend, source tab
- 7 TDD behavior tests: source code, progress, learn tab, copy, focus, expand
Bug fixes:
- Source code endpoint: handle absolute file paths (was "path traversal" error)
- Schematic expand: use common-prefix normalization for any codebase path format
- Clipboard copy: wrap in try/catch for headless environments
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Summary of ChangesHello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request introduces a major overhaul of the codebase exploration experience by unifying the previously separate tree and graph schematic views into a single, interactive explorer. The changes focus on improving performance through lazy loading, N+1 query optimizations, and extensive caching, while also enhancing user experience with a richer detail panel, improved search, and comprehensive documentation. This release significantly advances the platform's ability to visualize and understand complex codebases. Highlights
🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console. Ignored Files
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here. Footnotes
|
There was a problem hiding this comment.
Code Review
This pull request is a major release, introducing the unified Schematic Explorer, a new theme system, and E2E tests. It also includes significant performance improvements by fixing N+1 queries, adding database indexes, implementing API pagination, and adding caching on both backend and frontend. The new Schematic Explorer is a huge feature with a well-documented design. My review focuses on a critical security vulnerability, potential panics, and a performance issue in the new code.
| if !std::path::Path::new(clean_path).is_absolute() { | ||
| let canonical_root = repo_root.canonicalize().map_err(|e| ApiError { | ||
| status: StatusCode::INTERNAL_SERVER_ERROR, | ||
| message: format!("Could not resolve repo root: {}", e), | ||
| })?; | ||
| if !canonical.starts_with(&canonical_root) { | ||
| return Err(ApiError { | ||
| status: StatusCode::FORBIDDEN, | ||
| message: "Path traversal detected".to_string(), | ||
| }); | ||
| } | ||
| } |
There was a problem hiding this comment.
This logic introduces a path traversal vulnerability. By providing an absolute path, an attacker can bypass the directory traversal check because the check !canonical.starts_with(&canonical_root) is only performed for relative paths. This could allow reading arbitrary files on the server. The traversal check should be performed for all paths, regardless of whether they are absolute or relative.
// Verify path is safe and within repo root (prevent traversal)
let canonical_root = repo_root.canonicalize().map_err(|e| ApiError {
status: StatusCode::INTERNAL_SERVER_ERROR,
message: format!("Could not resolve repo root: {}", e),
})?;
if !canonical.starts_with(&canonical_root) {
return Err(ApiError {
status: StatusCode::FORBIDDEN,
message: "Path traversal detected".to_string(),
});
}| let mut stmt = conn.prepare(&sql).unwrap(); | ||
| let params: Vec<&dyn rusqlite::types::ToSql> = body.context_symbol_ids.iter().map(|id| id as &dyn rusqlite::types::ToSql).collect(); | ||
| let rows = stmt.query_map(params.as_slice(), |row| { | ||
| Ok(( | ||
| row.get::<_, String>(0)?, | ||
| row.get::<_, String>(1)?, | ||
| row.get::<_, String>(2)?, | ||
| row.get::<_, i64>(3)?, | ||
| row.get::<_, i64>(4)?, | ||
| row.get::<_, Option<String>>(5)?, | ||
| )) | ||
| }).unwrap(); |
There was a problem hiding this comment.
The use of .unwrap() on lines 84 and 95 can cause the server to panic if preparing the SQL statement or mapping the query results fails. This is especially risky with dynamically generated SQL. Please handle these Results gracefully, for example by using a match statement or map_err, and returning an appropriate error response to prevent the service from crashing.
| let mut stmt = conn.prepare("SELECT id, path, language, sloc FROM files ORDER BY path") | ||
| .map_err(db_err)?; | ||
| let all_files: Vec<(i64, String, Option<String>, i64)> = stmt.query_map([], |r| Ok((r.get(0)?, r.get(1)?, r.get(2)?, r.get(3)?))) | ||
| .map_err(db_err)?.collect::<Result<Vec<_>, _>>().map_err(db_err)?; |
There was a problem hiding this comment.
Loading all files from the database with SELECT ... FROM files to then filter them in memory is inefficient and will not scale for large repositories. This will lead to poor performance when expanding directories in a large project. Consider filtering in the database query itself. You could use a LIKE query to select only files within the target directory.
|
|
||
| ## Build & Test | ||
| ```bash | ||
| cd /Users/bm/codeilus/codeilus |
There was a problem hiding this comment.
The build command includes a hardcoded absolute path to a user's home directory. This will not work for other developers or in a CI environment. It should be replaced with a relative path or a placeholder variable to make the instructions more generic and portable.
| cd /Users/bm/codeilus/codeilus | |
| cd <project_root> # e.g., /Users/bm/codeilus/codeilus |
Release v0.2.0
Merging dev → main for release. See CHANGELOG.md for full details.
Highlights:
🤖 Generated with Claude Code