Skip to content

Create Tauri command layer for desktop app integration - #144

Merged
malibio merged 2 commits into
mainfrom
feature/issue-110-tauri-commands
Oct 4, 2025
Merged

malibio merged 2 commits into
mainfrom
feature/issue-110-tauri-commands

Conversation

@malibio

@malibio malibio commented Oct 3, 2025

Copy link
Copy Markdown
Collaborator

Closes #110

malibio and others added 2 commits October 3, 2025 23:46
Implements database path management and Node CRUD operations for Text, Task, and Date nodes to enable E2E testing.

**Database Path Management:**
- User-selectable database location with native folder picker
- Preference storage and loading
- Default app data directory fallback
- Support for cloud-synced folders

**Node Operations:**
- CRUD commands for Text, Task, and Date nodes
- Node type validation (limited to initial E2E scope)
- Hierarchy operations (get_children)
- Proper error mapping from Rust to Tauri responses

**Implementation Details:**
- Added tauri-plugin-dialog dependency for folder picker
- Added nodespace-core dependency for DatabaseService and NodeService
- Created modular commands structure (commands/db.rs, commands/nodes.rs)
- Registered all commands in Tauri builder
- State management for DatabaseService and NodeService instances

Closes #110

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <[email protected]>
Implements comprehensive fixes based on pragmatic code review:

**Critical Fixes:**
1. State reinitialization protection - Added check to prevent multiple database initializations and resource leaks
2. Atomic preference file writes - Implemented write-then-rename pattern with preference merging to prevent corruption

**Important Improvements:**
3. Structured error types - Created CommandError with error codes and debug details for better observability
4. Comprehensive test coverage - Added unit tests for node type validation and error serialization
5. Async I/O throughout - Converted all std::fs operations to tokio::fs for consistent async behavior

**Documentation & Code Quality:**
6. Documented blocking dialog behavior - Added doc comments explaining why blocking_pick_folder is intentional
7. Workspace dependency - Migrated nodespace-core to workspace dependencies for cleaner dependency management
8. Comprehensive documentation - Added detailed doc comments with examples for all public functions

**Key Changes:**
- `commands/db.rs`: State protection, atomic writes, async I/O, comprehensive docs
- `commands/nodes.rs`: Structured errors, full documentation, unit tests
- `Cargo.toml`: Workspace dependency configuration
- All Clippy warnings resolved, zero lint issues

**Testing:**
- Added 5 unit tests covering validation, error handling, and serialization
- All quality checks pass (lint, format, typecheck, clippy)

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <[email protected]>
@malibio
malibio merged commit b29534c into main Oct 4, 2025
@malibio
malibio deleted the feature/issue-110-tauri-commands branch October 4, 2025 10:40
malibio added a commit that referenced this pull request Feb 4, 2026
* Add Tauri command layer for desktop app integration

Implements database path management and Node CRUD operations for Text, Task, and Date nodes to enable E2E testing.

**Database Path Management:**
- User-selectable database location with native folder picker
- Preference storage and loading
- Default app data directory fallback
- Support for cloud-synced folders

**Node Operations:**
- CRUD commands for Text, Task, and Date nodes
- Node type validation (limited to initial E2E scope)
- Hierarchy operations (get_children)
- Proper error mapping from Rust to Tauri responses

**Implementation Details:**
- Added tauri-plugin-dialog dependency for folder picker
- Added nodespace-core dependency for DatabaseService and NodeService
- Created modular commands structure (commands/db.rs, commands/nodes.rs)
- Registered all commands in Tauri builder
- State management for DatabaseService and NodeService instances

Closes #110

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <[email protected]>

* Address code review feedback - all 8 issues resolved

Implements comprehensive fixes based on pragmatic code review:

**Critical Fixes:**
1. State reinitialization protection - Added check to prevent multiple database initializations and resource leaks
2. Atomic preference file writes - Implemented write-then-rename pattern with preference merging to prevent corruption

**Important Improvements:**
3. Structured error types - Created CommandError with error codes and debug details for better observability
4. Comprehensive test coverage - Added unit tests for node type validation and error serialization
5. Async I/O throughout - Converted all std::fs operations to tokio::fs for consistent async behavior

**Documentation & Code Quality:**
6. Documented blocking dialog behavior - Added doc comments explaining why blocking_pick_folder is intentional
7. Workspace dependency - Migrated nodespace-core to workspace dependencies for cleaner dependency management
8. Comprehensive documentation - Added detailed doc comments with examples for all public functions

**Key Changes:**
- `commands/db.rs`: State protection, atomic writes, async I/O, comprehensive docs
- `commands/nodes.rs`: Structured errors, full documentation, unit tests
- `Cargo.toml`: Workspace dependency configuration
- All Clippy warnings resolved, zero lint issues

**Testing:**
- Added 5 unit tests covering validation, error handling, and serialization
- All quality checks pass (lint, format, typecheck, clippy)

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <[email protected]>

---------

Co-authored-by: Claude <[email protected]>
malibio added a commit that referenced this pull request Feb 5, 2026
* Add Tauri command layer for desktop app integration

Implements database path management and Node CRUD operations for Text, Task, and Date nodes to enable E2E testing.

**Database Path Management:**
- User-selectable database location with native folder picker
- Preference storage and loading
- Default app data directory fallback
- Support for cloud-synced folders

**Node Operations:**
- CRUD commands for Text, Task, and Date nodes
- Node type validation (limited to initial E2E scope)
- Hierarchy operations (get_children)
- Proper error mapping from Rust to Tauri responses

**Implementation Details:**
- Added tauri-plugin-dialog dependency for folder picker
- Added nodespace-core dependency for DatabaseService and NodeService
- Created modular commands structure (commands/db.rs, commands/nodes.rs)
- Registered all commands in Tauri builder
- State management for DatabaseService and NodeService instances

Closes #110

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <[email protected]>

* Address code review feedback - all 8 issues resolved

Implements comprehensive fixes based on pragmatic code review:

**Critical Fixes:**
1. State reinitialization protection - Added check to prevent multiple database initializations and resource leaks
2. Atomic preference file writes - Implemented write-then-rename pattern with preference merging to prevent corruption

**Important Improvements:**
3. Structured error types - Created CommandError with error codes and debug details for better observability
4. Comprehensive test coverage - Added unit tests for node type validation and error serialization
5. Async I/O throughout - Converted all std::fs operations to tokio::fs for consistent async behavior

**Documentation & Code Quality:**
6. Documented blocking dialog behavior - Added doc comments explaining why blocking_pick_folder is intentional
7. Workspace dependency - Migrated nodespace-core to workspace dependencies for cleaner dependency management
8. Comprehensive documentation - Added detailed doc comments with examples for all public functions

**Key Changes:**
- `commands/db.rs`: State protection, atomic writes, async I/O, comprehensive docs
- `commands/nodes.rs`: Structured errors, full documentation, unit tests
- `Cargo.toml`: Workspace dependency configuration
- All Clippy warnings resolved, zero lint issues

**Testing:**
- Added 5 unit tests covering validation, error handling, and serialization
- All quality checks pass (lint, format, typecheck, clippy)

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <[email protected]>

---------

Co-authored-by: Claude <[email protected]>
malibio added a commit that referenced this pull request Feb 26, 2026
* Add Tauri command layer for desktop app integration

Implements database path management and Node CRUD operations for Text, Task, and Date nodes to enable E2E testing.

**Database Path Management:**
- User-selectable database location with native folder picker
- Preference storage and loading
- Default app data directory fallback
- Support for cloud-synced folders

**Node Operations:**
- CRUD commands for Text, Task, and Date nodes
- Node type validation (limited to initial E2E scope)
- Hierarchy operations (get_children)
- Proper error mapping from Rust to Tauri responses

**Implementation Details:**
- Added tauri-plugin-dialog dependency for folder picker
- Added nodespace-core dependency for DatabaseService and NodeService
- Created modular commands structure (commands/db.rs, commands/nodes.rs)
- Registered all commands in Tauri builder
- State management for DatabaseService and NodeService instances

Closes #110

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <[email protected]>

* Address code review feedback - all 8 issues resolved

Implements comprehensive fixes based on pragmatic code review:

**Critical Fixes:**
1. State reinitialization protection - Added check to prevent multiple database initializations and resource leaks
2. Atomic preference file writes - Implemented write-then-rename pattern with preference merging to prevent corruption

**Important Improvements:**
3. Structured error types - Created CommandError with error codes and debug details for better observability
4. Comprehensive test coverage - Added unit tests for node type validation and error serialization
5. Async I/O throughout - Converted all std::fs operations to tokio::fs for consistent async behavior

**Documentation & Code Quality:**
6. Documented blocking dialog behavior - Added doc comments explaining why blocking_pick_folder is intentional
7. Workspace dependency - Migrated nodespace-core to workspace dependencies for cleaner dependency management
8. Comprehensive documentation - Added detailed doc comments with examples for all public functions

**Key Changes:**
- `commands/db.rs`: State protection, atomic writes, async I/O, comprehensive docs
- `commands/nodes.rs`: Structured errors, full documentation, unit tests
- `Cargo.toml`: Workspace dependency configuration
- All Clippy warnings resolved, zero lint issues

**Testing:**
- Added 5 unit tests covering validation, error handling, and serialization
- All quality checks pass (lint, format, typecheck, clippy)

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <[email protected]>

---------

Co-authored-by: Claude <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Create Tauri command layer for desktop app integration

1 participant