This commit refactors the search result to include the total count of matches found, alongside the limited search results (page) for better pagination support. Changes made include:
- Modified the return type from `Vec<SearchResult>` to `SearchResults` structure, to include a total count.
- Updated the search function implementation to handle the new data structure.
- Adapted the test cases to account for the updated search result format.
In addition to the previous changes, this commit addresses the issue of not knowing the total number of search results when using pagination, which can now be easily obtained from the `SearchResults` structure.
This commit adds a new feature to display the contents of a file when it's in the "added" status in the commits view. A new `get_file_contents` function is implemented in the `Repository` struct, and a corresponding command is added to the main Tauri app. The frontend is updated to handle added files by invoking this command and rendering the contents in the DiffViewer component.
Changes include:
- Add `get_file_contents` function to `repository.rs` and command in main.rs
- Update the viewer to handle added files
This update enables the generation of a working directory diff and returns a Git commit message based on the diff changes. It includes changes to the API, Tauri, and frontend code. Notable modifications include:
- Added `git_wd_diff` function to Tauri `src/main.rs`
- Modified `Repository` struct, added `wd_diff` method to `src/repositories/repository.rs`
- New `commit` function added to `src/lib/api.ts`
- Added `fetchCommitMessage` function in `src/routes/projects/[projectId]/+page.svelte`
- Minor UI adjustments in `src/routes/projects/[projectId]/player/+page.svelte`
Overall, this commit improves user experience by automatically generating commit messages based on the changes made in the working directory.