Add export list context menu item #59

Merged
edfloreshz merged 6 commits from feat/export-list into main 2025-05-24 18:58:57 +00:00
edfloreshz commented 2025-05-24 16:55:27 +00:00 (Migrated from github.com)

This pull request introduces major refactoring and feature changes, focusing on removing unused functionality, simplifying the codebase, and improving maintainability.

  • Removed the TaskService abstraction and the TasksProvider trait, along with their implementations and dependencies.
  • Renamed ComputerStorageEngine to ComputerStorage and consolidated all storage-related methods into this module. Added a new export_list method to generate markdown representations of lists and tasks
  • Removed unused imports, reorganized modules, and improved formatting for better readability and maintainability.
  • Removed the Export functionality from the content view and moved it to a context menu item in the sidebar.
  • image
  • Added an error window when the app error is unrecoverable.
  • image

Gets us closer to #34

This pull request introduces major refactoring and feature changes, focusing on removing unused functionality, simplifying the codebase, and improving maintainability. * Removed the `TaskService` abstraction and the `TasksProvider` trait, along with their implementations and dependencies. * Renamed `ComputerStorageEngine` to `ComputerStorage` and consolidated all storage-related methods into this module. Added a new `export_list` method to generate markdown representations of lists and tasks * Removed unused imports, reorganized modules, and improved formatting for better readability and maintainability. * Removed the `Export` functionality from the content view and moved it to a context menu item in the sidebar. * ![image](https://github.com/user-attachments/assets/3f1c6375-09ea-4b8a-9258-1e6f48a06d99) * Added an error window when the app error is unrecoverable. * ![image](https://github.com/user-attachments/assets/31426156-2f9e-4dcf-8963-d47c0c1074cb) Gets us closer to #34
copilot-pull-request-reviewer[bot] (Migrated from github.com) reviewed 2025-05-24 16:56:47 +00:00
copilot-pull-request-reviewer[bot] (Migrated from github.com) left a comment

Pull Request Overview

This PR refactors storage and service layers, removes unused abstractions, and adds an export_list method with a context-menu export action.

  • Eliminates the old TaskService and related traits/modules.
  • Renames ComputerStorageEngine to ComputerStorage, consolidates storage methods, and adds export_list.
  • Removes inline export UI in Content, moving it into a new sidebar context menu.

Reviewed Changes

Copilot reviewed 15 out of 15 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
src/todo.rs Removed legacy list/task handlers
src/main.rs Dropped unused mod todo
src/core/task_service.rs Deleted TasksProvider trait
src/core/service.rs Removed SQL-backed TaskService implementation
src/core/services/computer.rs Deleted old computer service wrapper
src/core/storage.rs Renamed and refactored storage engine, added export_list
src/core/services/mod.rs Removed import of computer service module
src/core/mod.rs Updated module exports to include only models and storage
src/content.rs Removed inline export button and handlers
src/actions.rs Updated action enums for export menu item
src/core/models/*.rs Simplified import paths and derive attributes
Comments suppressed due to low confidence (1)

src/core/storage.rs:31

  • The directory creation is using application_id instead of the full storage path. Change this to create_dir_all(storage.path()) so the correct directory is created.
std::fs::create_dir_all(&storage.application_id).expect("Failed to create storage directory");
## Pull Request Overview This PR refactors storage and service layers, removes unused abstractions, and adds an `export_list` method with a context-menu export action. - Eliminates the old `TaskService` and related traits/modules. - Renames `ComputerStorageEngine` to `ComputerStorage`, consolidates storage methods, and adds `export_list`. - Removes inline export UI in `Content`, moving it into a new sidebar context menu. ### Reviewed Changes Copilot reviewed 15 out of 15 changed files in this pull request and generated 2 comments. <details> <summary>Show a summary per file</summary> | File | Description | | ----------------------------- | ------------------------------------------------------------------ | | src/todo.rs | Removed legacy list/task handlers | | src/main.rs | Dropped unused `mod todo` | | src/core/task_service.rs | Deleted `TasksProvider` trait | | src/core/service.rs | Removed SQL-backed `TaskService` implementation | | src/core/services/computer.rs | Deleted old computer service wrapper | | src/core/storage.rs | Renamed and refactored storage engine, added `export_list` | | src/core/services/mod.rs | Removed import of `computer` service module | | src/core/mod.rs | Updated module exports to include only `models` and `storage` | | src/content.rs | Removed inline export button and handlers | | src/actions.rs | Updated action enums for export menu item | | src/core/models/*.rs | Simplified import paths and derive attributes | </details> <details> <summary>Comments suppressed due to low confidence (1)</summary> **src/core/storage.rs:31** * The directory creation is using `application_id` instead of the full storage path. Change this to `create_dir_all(storage.path())` so the correct directory is created. ``` std::fs::create_dir_all(&storage.application_id).expect("Failed to create storage directory"); ``` </details>
@ -0,0 +1,194 @@
use std::path::PathBuf;
copilot-pull-request-reviewer[bot] (Migrated from github.com) commented 2025-05-24 16:56:47 +00:00

The doc comment states that new returns None, but the signature returns Self and panics on failure. Update the documentation to accurately describe that it will panic on error rather than return an Option.

    /// Panics if the data local directory cannot be determined or if directories cannot be created.
    /// # Arguments
    /// * `application_id` - The application ID used to create the storage path.
    /// # Returns
    /// A new instance of the storage engine.
The doc comment states that `new` returns `None`, but the signature returns `Self` and panics on failure. Update the documentation to accurately describe that it will panic on error rather than return an `Option`. ```suggestion /// Panics if the data local directory cannot be determined or if directories cannot be created. /// # Arguments /// * `application_id` - The application ID used to create the storage path. /// # Returns /// A new instance of the storage engine. ```
copilot-pull-request-reviewer[bot] (Migrated from github.com) commented 2025-05-24 16:56:47 +00:00

[nitpick] Using expect here will panic the application on directory creation failure. Consider returning a Result or handling the error gracefully to avoid unexpected panics in production.

[nitpick] Using `expect` here will panic the application on directory creation failure. Consider returning a `Result` or handling the error gracefully to avoid unexpected panics in production.
sgued (Migrated from github.com) reviewed 2025-05-24 19:27:05 +00:00
@ -0,0 +44,4 @@
}
pub fn settings() -> Settings {
Settings::default()
sgued (Migrated from github.com) commented 2025-05-24 19:26:30 +00:00

Looks like this is not intended ? The app just always fail.

Looks like this is not intended ? The app just always fail.
edfloreshz (Migrated from github.com) reviewed 2025-05-24 19:41:28 +00:00
@ -0,0 +44,4 @@
}
pub fn settings() -> Settings {
Settings::default()
edfloreshz (Migrated from github.com) commented 2025-05-24 19:41:28 +00:00

Yeah, I'm fixing it + another big change.

Yeah, I'm fixing it + another big change.
edfloreshz (Migrated from github.com) reviewed 2025-05-24 19:43:14 +00:00
@ -0,0 +44,4 @@
}
pub fn settings() -> Settings {
Settings::default()
edfloreshz (Migrated from github.com) commented 2025-05-24 19:43:14 +00:00

Just sent a fix to main

Just sent a fix to main
Sign in to join this conversation.
No description provided.