Skip to content

Add ChromaDB database discovery UI with dual-mode selector#22

Merged
samkeen merged 3 commits intomainfrom
db-path-select
Jan 28, 2026
Merged

Add ChromaDB database discovery UI with dual-mode selector#22
samkeen merged 3 commits intomainfrom
db-path-select

Conversation

@samkeen
Copy link
Copy Markdown
Contributor

@samkeen samkeen commented Jan 28, 2026

Summary

  • Enhances the RAG settings page with automatic database discovery for improved user experience
  • Implements a dual-mode interface for database selection (dropdown selector as default, with manual path option)
  • Adds comprehensive unit test coverage for the new functionality

Changes

Database Discovery

  • Added discover_databases() method to scan ./data/ subdirectories for ChromaDB databases
  • Returns metadata including collection count, size, and modification time
  • Marks currently configured database for easy identification

UI Improvements

  • Dual-mode selector: Default dropdown with discovered databases, switchable to manual path entry
  • Visual enhancements: Folder icons (📁) prefix database names in dropdown
  • Database metadata: Shows collection count for each discovered database
  • Educational messages: Helpful guidance when no databases found, pointing to utils/README.md
  • Mode persistence: User's preference (select vs manual) saved in localStorage

Testing

  • Added 8 unit tests for discover_databases() method covering various scenarios
  • Added 3 unit tests for the new /api/rag/discover-databases endpoint
  • All 238 tests passing with proper error handling

Test Plan

  • Manually tested database discovery with multiple databases
  • Verified mode switching and persistence works correctly
  • Tested with no databases (shows help message)
  • Validated both select and manual input modes
  • Ensured Test Connection button properly validates both modes
  • Unit tests cover edge cases and error scenarios
  • Full test suite passes (238 tests)

Screenshots

The new dual-mode interface defaults to a friendly dropdown selector while maintaining flexibility for advanced users to specify custom paths.

🤖 Generated with Claude Code

samkeen and others added 3 commits January 28, 2026 08:24
Enhances the RAG settings page with a more user-friendly database selection interface:

- Add automatic discovery of ChromaDB databases in ./data/ subdirectories
- Implement dual-mode UI: dropdown selector (default) and manual path entry
- Show database metadata (collection count, size) in the selector
- Add folder icons to database options for better visual clarity
- Display helpful messages when no databases are found, pointing to utils/README.md
- Persist user's mode preference (select vs manual) in localStorage
- Add comprehensive unit tests for discovery functionality and routes

This makes database selection more intuitive for new users while maintaining
flexibility for advanced users to specify custom paths.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
The path mocking in tests was using Unix-specific path splitting ('/'),
which caused failures on Windows. Fixed by:

- Adding Path import to test module
- Using Path(x).name instead of x.split('/')[-1] for cross-platform compatibility
- Ensuring all path operations work with both forward and backslashes

All 238 tests now pass on macOS, Ubuntu, and Windows.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
@samkeen samkeen merged commit f73b116 into main Jan 28, 2026
9 checks passed
@samkeen samkeen deleted the db-path-select branch January 28, 2026 18:10
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