Commit Graph

7134 Commits

Author SHA1 Message Date
Nikita Galaiko
4cc61cd8d4 Add pagination and improve search UI
This commit adds pagination support to the search results page by updating the limit of results per page, implementing openNextPage and openPrevPage functions, and including navigation buttons for the pagination. It also improves the UI by adding a spinning icon while searching for results and adjusts the overall styling for better readability.

- Added IconChevronLeft and IconChevronRight to icons exports
- Updated the limit of results per page from 50 to 10
- Implemented openNextPage and openPrevPage functions for pagination
- Added navigation buttons for previous and next pages
- Used IconRotateClockwise with animation for a spinning icon while searching
- Updated the styling for better UI readability
2023-03-24 08:53:49 +01:00
Ian Donahue
3a372284e8 Scroll for search results are now on the right of screen
This commit includes refactoring the code format to use consistent indentation, and updates the CSS classes to improve UI element styling. The changes were made in the src/lib/search.ts file and the src/routes/projects/[projectId]/search/+page.svelte file.

- Adjusted the indentation in src/lib/search.ts to use tabs consistently
- Changed the figure class from "mx-14 flex h-full flex-col gap-2" to "search-results flex h-full flex-col gap-2" in +page.svelte
- Updated the figcaption and ul elements to have consistent margins and padding in +page.svelte
2023-03-24 07:42:44 +01:00
Ian Donahue
b10518b14f Scroll for search results are now on the right of screen
This commit includes refactoring the code format to use consistent indentation, and updates the CSS classes to improve UI element styling. The changes were made in the src/lib/search.ts file and the src/routes/projects/[projectId]/search/+page.svelte file.

- Adjusted the indentation in src/lib/search.ts to use tabs consistently
- Changed the figure class from "mx-14 flex h-full flex-col gap-2" to "search-results flex h-full flex-col gap-2" in +page.svelte
- Updated the figcaption and ul elements to have consistent margins and padding in +page.svelte
2023-03-23 16:22:43 +01:00
Kiril Videlov
39e0c1a8ff
Merge pull request #44 from gitbutlerapp/asdf2
asdf2
2023-03-23 16:13:00 +01:00
Nikita Galaiko
a686f64c7a Add pagination support to project search
This commit adds support for pagination within the project search feature. The changes include adding a limit of 50 results per page and an offset to handle page offsets in the search. Additionally, the search results are now updated to include a 'haveMore' flag to indicate if there are more results to display.

Changes in detail:
- Added limit and offset variables
- Updated search result to include 'haveMore' flag
- Modified fetchResultData function to handle updated search results
2023-03-23 16:11:39 +01:00
Nikita Galaiko
b7e5e2a0c8 Refactor search results with asyncDerived store
This commit refactors the search results code to use the asyncDerived store for fetching and displaying results. This simplifies and improves the overall code structure by streamlining the state management and lifecycle of search-related data. Additionally, it switches to using derived stores for displaying results and states related to searching, showing loading, error, and result states as needed.

Changes:
- Remove the manual search fetching and state management code.
- Utilize asyncDerived and derived stores to handle fetching and displaying search results.
- Update use of loading, error, and result states to check the $searchState store instead of manually managing those states.
2023-03-23 16:11:39 +01:00
Nikita Galaiko
a0eeeae645 Refactor search functionality in project layout
This commit refactors the search functionality present in the project layout. Instead of using a debounced input event handler to update the search query, a form is now used to handle search submission. The search functionality in the search page has also been updated to use the query param instead of a writable store, and the fetchResultData function has been extracted for better readability.

Changes:
- Replace debounced input event handler with form submission in project layout
- Update search functionality in search page to use query param
- Extract fetchResultData function for better readability
- Remove unnecessary context and store usage
2023-03-23 16:11:39 +01:00
Nikita Galaiko
aaba14e819 use cache for get session by id 2023-03-23 16:11:39 +01:00
Nikita Galaiko
e4f1edfc83 Refactor search result to include total count
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.
2023-03-23 16:11:39 +01:00
Kiril Videlov
d7a11d1cd0 format 2023-03-23 16:11:30 +01:00
Kiril Videlov
95c690be91 command palett replay dialog now contains things 2023-03-23 16:11:15 +01:00
Scott Chacon
d2fdecc752
Merge pull request #42 from gitbutlerapp/sc-render-removals
Better rendering of removed files
2023-03-23 15:07:17 +01:00
Scott Chacon
3aa1f7d0b6 lint 2023-03-23 14:59:30 +01:00
Scott Chacon
5c0c4a8196 Better rendering of removed files 2023-03-23 14:57:12 +01:00
Kiril Videlov
5fa0b9e68e command palette refactor 2023-03-23 14:23:36 +01:00
Nikita Galaiko
f842829583 Update padding logic in CodeViewer component
This commit updates the padding logic in the CodeViewer component to handle highlighted lines more effectively. The renderRowContent function now returns an object with an html property and a highlighted property, allowing for more precise controls when rendering rows. Additionally, new functions have been introduced to manage chunks of lines and apply padding, helping to optimize the display of code diffs.

Changes include:
- Modify `renderRowContent` to return an object containing html and highlighted properties
- Add a `rows` computed variable that maps the original rows to the newly rendered rows
- Introduce new `RenderedRow` type and `applyPadding` function to manage chunks and padding logic
- Update Row interface to include a size property
2023-03-23 14:07:58 +01:00
Nikita Galaiko
cbc82a93cc simplify highlight condition 2023-03-23 14:07:58 +01:00
Nikita Galaiko
eca05585ff ignore tmp vite configs 2023-03-23 08:43:41 +01:00
Nikita Galaiko
5c99150b20 acquire lock closer to where it is used 2023-03-23 08:43:41 +01:00
Nikita Galaiko
01a4c63900 ignore binary files in session/wd 2023-03-23 08:43:41 +01:00
Nikita Galaiko
28a4a111af send sha when releasing 2023-03-23 08:00:27 +01:00
Nikita Galaiko
e76c88b486
fix typo 2023-03-22 15:58:51 +01:00
Nikita Galaiko
1ffb00b106
teach codevier to highlight tokens 2023-03-22 15:58:51 +01:00
Scott Chacon
258ed370f7 Add get_file_contents API to Rust and display added file content in DiffViewer
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
2023-03-22 15:54:33 +01:00
Scott Chacon
501983f9bb Listen to Sessions events too
Re-added the <Session> watcher, so we can see file add/remove/modify events, not just commits and branch changes. We actually need to watch both.
2023-03-22 15:54:33 +01:00
Nikita Galaiko
c6b23dc250
log exec time as debug 2023-03-22 15:17:10 +01:00
Nikita Galaiko
e92c924b45
log tauri commands execution time 2023-03-22 15:02:16 +01:00
Nikita Galaiko
17fa40b3b8
fix deadlock issue 2023-03-22 14:11:29 +01:00
Scott Chacon
41d2893fd9 Add DiffViewer component and file selection
Enhanced the commit page by adding the DiffViewer component and implementing file selection functionality for the commit message generation. Users can now view diffs per file before committing.
2023-03-22 13:50:38 +01:00
Nikita Galaiko
69df2d0408
fix sessions storage filtering 2023-03-22 11:26:02 +01:00
Nikita Galaiko
a5c8f02350
fix high cpu usage 2023-03-22 10:05:35 +01:00
Nikita Galaiko
fa3a6271f9
subscribe to file changes before sending them 2023-03-22 09:12:37 +01:00
Nikita Galaiko
217ede1771
async init 2023-03-22 09:02:41 +01:00
Nikita Galaiko
300d042e04
start only one files watcher 2023-03-22 08:59:23 +01:00
Nikita Galaiko
80e3e9fd28
make watchers async 2023-03-22 07:51:58 +01:00
Nikita Galaiko
b202c264aa
share git repo between repository too 2023-03-21 15:12:45 +01:00
Nikita Galaiko
7bee70ac80
share repo for sessions storage 2023-03-21 11:28:58 +01:00
Nikita Galaiko
e79d377e3e
share repo for deltas storage 2023-03-21 11:01:10 +01:00
Nikita Galaiko
3009958218
arc protect 2023-03-21 10:53:15 +01:00
Nikita Galaiko
244cf5850d
cache sessions list 2023-03-21 08:57:38 +01:00
Nikita Galaiko
a5062ada92
extract session flush to store 2023-03-21 08:41:44 +01:00
Nikita Galaiko
06371e4c36
extract create current session to store 2023-03-21 07:59:56 +01:00
Nikita Galaiko
9dfe98cef2
cache list_files 2023-03-20 17:27:55 +01:00
Nikita Galaiko
e7adcdd017
extract list_session_files to storage 2023-03-20 17:27:54 +01:00
Ian Donahue
7e7e093684 prettied up some stuff 2023-03-20 17:14:35 +01:00
Nikita Galaiko
0ffbcd5d13
extract sessions storage 2023-03-20 16:21:25 +01:00
Nikita Galaiko
252f589f44
async user image fetching 2023-03-20 15:41:17 +01:00
Scott Chacon
e29d09f2fc linting 2023-03-20 15:15:14 +01:00
Scott Chacon
e1239d4b08 Merge branch 'master' of github.com:gitbutlerapp/gitbutler-client 2023-03-20 15:14:32 +01:00
Scott Chacon
16601f31d3 Improve git committing with new screen
New commit screen with diffs pulled from Rust and summarizable by gpt4.
2023-03-20 15:12:22 +01:00