Refactored the CodeViewer component to switch from using grid layout to a table layout for improved rendering performance. This change simplifies CSS styles by removing unnecessary definitions and ensures consistency in line number display. Additional styling has been applied to the table layout to maintain the existing look and functionality.
- Replaced the `div` structure with `table`, `tbody`, and `tr` elements
- Renamed `rows` to `renderedRows` for better naming consistency
- Added `originalLineNumberDigits` and `currentLineNumberDigits` for proper alignment in table cells
- Removed unnecessary CSS rules and added table-specific styles
This commit refactors the search results page UI and updates the navigation buttons for better user experience. Previously, the search result list layout and the navigation buttons showed inconsistent styling and padding issues.
Changes include:
- Adjusting padding and margin for search result list and search result items.
- Moving the navigation buttons inside the search result list.
- Updating the styling and hover effect for navigation buttons.
- Removing unnecessary padding and margin for figure elements.
Adjusted the search result layout and added more consistent spacing in the search results page. This makes the display cleaner and easier to read for users.
Changes:
- Changed list styling for flex display and added a `-mr-14` class to control the layout.
- Updated spacing between elements using both `flex-col gap-6` and `mr-14` to provide more consistent separation between items.
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
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
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
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
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.
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
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 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