Skip to content

feat: enhance project import functionality and add comprehensive tests#47

Merged
Yashh56 merged 7 commits intoRelwave:developfrom
Yashh56:new/project
Feb 26, 2026
Merged

feat: enhance project import functionality and add comprehensive tests#47
Yashh56 merged 7 commits intoRelwave:developfrom
Yashh56:new/project

Conversation

@Yashh56
Copy link
Copy Markdown
Member

@Yashh56 Yashh56 commented Feb 26, 2026

This pull request introduces a new "Import Project" feature, allowing users to import projects from a cloned repository directory. The changes span backend handler support, API integration, React hooks, UI dialogs, and type definitions. The most important changes are grouped below:

Backend and API Enhancements

  • Added new RPC handlers to support scanning an import source, importing a project, and linking a database to a project in projectHandlers.ts and registered them in the JSON-RPC handler. These handlers interact with the projectStoreInstance to perform the necessary operations. [1] [2]
  • Extended the bridgeApi service with scanImportSource, importProject, and linkProjectDatabase methods to provide frontend access to the new backend endpoints.

React Hooks and Type Definitions

  • Implemented the useImportProject hook in useProjectQueries.ts to manage project imports via React Query.
  • Added new types for import operations, including ImportProjectParams and ScanImportResult, and updated ProjectMetadata and ProjectSummary to include the sourcePath field. [1] [2]

UI and Dialog Integration

  • Added an "Import" button to the ProjectList component and introduced the ImportProjectDialog component for the import workflow. The dialog is wired into the Projects page, including cache invalidation and UI updates upon completion. [1] [2] [3]

State and Cache Management

  • Updated the Projects page to handle the import dialog's state and to invalidate project and database queries when an import completes, ensuring UI consistency.

These changes collectively enable a smooth workflow for importing projects from cloned repositories, including metadata preview, database connection, and UI feedback.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This pull request introduces a comprehensive "Import Project" feature that enables users to import projects from cloned repository directories. The implementation spans the full stack from backend storage logic to UI components, with a strong focus on maintaining git cleanliness by avoiding modifications to tracked files.

Changes:

  • Added backend support for scanning and importing projects from cloned repositories, with machine-specific data stored in git-ignored local config files
  • Implemented new React components and hooks for the import workflow, including folder selection, metadata preview, and database connection setup
  • Added comprehensive test coverage (800 lines) for import functionality, including edge cases and file immutability guarantees

Reviewed changes

Copilot reviewed 11 out of 11 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
src/types/project.ts Added sourcePath field and new types (ScanImportResult, ImportProjectParams) for import operations
src/services/bridgeApi.ts Added scanImportSource, importProject, and linkProjectDatabase API methods with validation
src/hooks/useProjectQueries.ts Added useImportProject hook with cache invalidation
src/pages/Projects.tsx Integrated import dialog with state management and cache invalidation on completion
src/components/project/ProjectList.tsx Added Import button to project list header
src/components/project/ImportProjectDialog.tsx Comprehensive 425-line dialog component handling multi-step import workflow
src/components/project/index.ts Exported ImportProjectDialog component
bridge/src/services/projectStore.ts Core import logic with sourcePath caching, .env parsing, and git-safe file operations
bridge/src/handlers/projectHandlers.ts Added RPC handlers for scanImport, importProject, and linkDatabase
bridge/src/jsonRpcHandler.ts Registered new RPC handlers
bridge/tests/importProject.test.ts Comprehensive test suite with 800 lines covering parsing, scanning, importing, and linking

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread bridge/src/services/projectStore.ts
Comment thread src/components/project/ImportProjectDialog.tsx
Comment thread src/components/project/ImportProjectDialog.tsx
Comment thread bridge/__tests__/importProject.test.ts
Comment thread bridge/src/services/projectStore.ts Outdated
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 12 out of 12 changed files in this pull request and generated 5 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread bridge/src/services/projectStore.ts
Comment thread src/components/project/ImportProjectDialog.tsx
Comment thread src/components/project/ImportProjectDialog.tsx
Comment thread bridge/src/services/projectStore.ts
Comment thread bridge/src/services/projectStore.ts
…ance project update handling for imported projects
@Yashh56 Yashh56 merged commit 54cfb16 into Relwave:develop Feb 26, 2026
1 of 2 checks passed
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.

2 participants