refactor: improve board index management and loading logic#6
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This pull request includes significant refactoring and improvements to both the backend (Rust) and frontend (React/TypeScript) codebases, focusing on better modularization, clearer separation of concerns, and improved loading/error handling in the UI. The backend changes restructure how board and folder data are persisted and loaded from the database, while the frontend introduces new components for loading and error states and refactors the Excalidraw frame's persistence logic.
Backend (Rust) - Boards Index & Persistence:
set_boards_indexfunction into smaller helper functions:clear_index_tables,persist_index_item,persist_folder_item, andresolve_active_board_id, improving readability and maintainability.load_boards_map,load_folder_names_map, andload_index_items, and refactored the row-to-item conversion logic for more robust and modular data handling. [1] [2] [3]Frontend (React/TypeScript) - UI Structure & Persistence:
UI loading and error handling improvements:
FullScreenLoading,ExcalidrawLoadingOverlay, andAppErrorToastfor consistent and reusable loading and error UI states. [1] [2]Appcomponent to use these new UI components, simplifying conditional rendering and improving user experience.Excalidraw frame persistence refactor:
useExcalidrawDataPersistence(for board data) anduseExcalidrawThumbnailPersistence(for thumbnail images), clarifying responsibilities and making the codebase easier to extend and maintain. [1] [2] [3] [4]These changes collectively make the codebase more modular, maintainable, and robust, while also providing a smoother user experience during loading and error conditions.
Backend (Rust) - Boards Index & Persistence
set_boards_indexinto smaller helper functions for clearing tables, persisting items, and resolving the active board, improving maintainability and clarity.Frontend (React/TypeScript) - UI & Persistence
FullScreenLoading,ExcalidrawLoadingOverlay,AppErrorToast) and refactored theAppcomponent to use them for a cleaner and more consistent user experience. [1] [2] [3]