Skip to content

Release v0.2.0: Schematic Explorer, Theme System, E2E Tests#2

Merged
mbaneshi merged 1 commit intomainfrom
dev
Mar 21, 2026
Merged

Release v0.2.0: Schematic Explorer, Theme System, E2E Tests#2
mbaneshi merged 1 commit intomainfrom
dev

Conversation

@mbaneshi
Copy link
Owner

Release v0.2.0

Merging dev → main for release. See CHANGELOG.md for full details.

Highlights:

  • Unified Schematic Explorer with tree/graph modes, 6 interaction components
  • Light/dark theme system with real-time toggle across all pages
  • 31 E2E Playwright tests
  • Schematic API (3 new endpoints with lazy loading)
  • Max subscription routing for Claude CLI
  • Docs site updated with schematic explorer guide

🤖 Generated with Claude Code

* 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>
@gemini-code-assist
Copy link

Summary of Changes

Hello, 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

  • Unified Schematic Explorer: A new unified schematic explorer has been implemented, integrating tree and graph modes with lazy loading and enhanced interaction components. This replaces the previous disconnected tree and graph views.
  • Performance Optimizations: Significant performance improvements were made across the backend API, including N+1 query fixes, pagination for list endpoints, increased Moka cache capacity, and the addition of HTTP caching headers.
  • New Schematic API Endpoints: Three new backend API endpoints (/schematic, /schematic/expand, /schematic/detail) were introduced to support the lazy-loading and detailed data requirements of the new schematic explorer.
  • Comprehensive E2E Testing: Extensive Playwright end-to-end tests were added for the new schematic explorer, covering API functionality, UI interactions in both tree and graph modes, and expected user behaviors.
  • Updated Documentation: New documentation files were added detailing a comprehensive performance optimization plan, the design of the unified schematic explorer, and an Architectural Decision Record (ADR) for this major feature.
  • Database Enhancements: New database indexes were added to improve query performance, and a dedicated schematic repository was introduced to manage complex schematic data retrieval.
  • Frontend Refactoring: The frontend schematic components and layout logic were refactored, replacing external libraries like ELK.js with custom, more efficient implementations and introducing client-side API caching.

🧠 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
  • Ignored by pattern: .github/workflows/** (1)
    • .github/workflows/ci.yml
Using Gemini Code Assist

The 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 /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

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 .gemini/ folder in the base of the repository. Detailed instructions can be found here.

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

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

@mbaneshi mbaneshi merged commit 6f0b1ec into main Mar 21, 2026
2 of 6 checks passed
Copy link

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment on lines +114 to 125
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(),
});
}
}

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

security-critical critical

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(),
        });
    }

Comment on lines +84 to +95
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();

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

high

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.

Comment on lines +515 to +518
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)?;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

high

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

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

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.

Suggested change
cd /Users/bm/codeilus/codeilus
cd <project_root> # e.g., /Users/bm/codeilus/codeilus

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant