From 774b88423637ac6e42eb39832521063c0c653df8 Mon Sep 17 00:00:00 2001 From: Claude Date: Mon, 27 Oct 2025 00:36:23 +0000 Subject: [PATCH] Update storage strategy: user always selects folder location MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Changed from opaque platform-specific defaults to user-controlled storage: Before: - Default to hidden platform directories (%APPDATA%, ~/.local/share, etc.) - User could optionally select custom folder After: - User MUST select folder on first run (no hidden defaults) - Full transparency and control over data location - Examples: ~/Documents/Tasks, ~/Dropbox/Tasks, etc. Key changes: - CLI init requires folder path argument - GUI shows folder picker on first launch - Mobile prompts for folder location with suggestions - App config (theme, window size) still in platform-specific location - Task data always in user-visible, user-controlled folder Benefits: - Users can easily find and backup their data - Works seamlessly with cloud sync (Dropbox, iCloud, OneDrive) - Can use with other tools (Obsidian, VS Code) - Git-friendly for version control - Multiple task vaults possible (work/personal) - No lock-in, no hidden data Updated: - Storage strategy section - AppConfig model (local_path is required, not optional) - CLI examples (init requires path) - First run experience description - Repository API (takes tasks_folder directly) 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude --- PLAN.md | 76 +++++++++++++++++++++++++++++++++++++-------------------- 1 file changed, 49 insertions(+), 27 deletions(-) diff --git a/PLAN.md b/PLAN.md index ddb189b..1f7b1bc 100644 --- a/PLAN.md +++ b/PLAN.md @@ -109,12 +109,14 @@ TaskList { } AppConfig { - storage_type: StorageType, // Local or WebDAV - local_path: Option, - webdav_url: Option, + // Stored in platform-specific config location + local_path: PathBuf, // User-selected tasks folder (required) + webdav_url: Option, // Optional WebDAV server webdav_credentials: Option, theme: Theme, last_sync: Option, + window_size: Option<(u32, u32)>, + last_opened_list: Option, } ``` @@ -197,8 +199,8 @@ pub struct TaskRepository { } impl TaskRepository { - pub fn new(config: Config) -> Result; - pub fn init(path: PathBuf) -> Result; + pub fn new(tasks_folder: PathBuf) -> Result; + pub fn init(tasks_folder: PathBuf) -> Result; // Task operations pub fn create_task(&mut self, list_id: Uuid, task: Task) -> Result; @@ -229,19 +231,23 @@ pub trait Storage { ### Storage Strategy #### Local Storage -- **Location**: User-selectable folder OR platform-specific app data directory - - Windows: `%APPDATA%/bevy-tasks/` (default) - - Linux: `~/.local/share/bevy-tasks/` (default) - - macOS: `~/Library/Application Support/bevy-tasks/` (default) - - iOS: App sandbox documents directory - - Android: Internal storage app directory - - User can select any folder with read/write permissions +- **Location**: **User must select a folder** on first run + - Can be anywhere with read/write permissions + - Examples: `~/Documents/Tasks`, `~/Dropbox/Tasks`, `D:\My Tasks` + - Users can change location later in settings + - **No hidden default directories** - full user control and visibility +- **App Configuration Storage** (separate from task data): + - Windows: `%APPDATA%/bevy-tasks/config.json` + - Linux: `~/.config/bevy-tasks/config.json` + - macOS: `~/Library/Application Support/bevy-tasks/config.json` + - iOS: App sandbox preferences + - Android: App preferences + - Stores: selected folder path, theme, last sync time, window position - **Format**: Markdown files with YAML frontmatter (Obsidian-compatible) - **Structure**: ``` - data/ + ~/Documents/Tasks/ # User-selected folder ├── .bevy-tasks/ - │ ├── config.json # App configuration │ └── metadata.json # List ordering, sync state ├── My Tasks/ # Task list folder │ ├── Buy groceries.md @@ -253,13 +259,20 @@ pub trait Storage { └── Team meeting prep.md ``` -**Benefits of Markdown Format**: -- Human-readable and editable in any text editor -- Compatible with Obsidian, Logseq, and other markdown tools -- Easy to version control (git-friendly) -- Future-proof format -- Enables external editing and scripting -- Natural organization with folders +**First Run Experience**: +- CLI: `bevy-tasks init ~/Documents/Tasks` (user specifies path) +- GUI: Folder picker dialog on first launch +- Mobile: Folder picker with suggested locations (Documents, iCloud Drive, etc.) + +**Benefits of User-Selected Storage**: +- **Full transparency**: Users can see exactly where their data is +- **Easy backup**: Users can backup the folder however they want (Time Machine, cloud sync, etc.) +- **Portable**: Move folder between machines, cloud drives, USB drives +- **No lock-in**: Data is in plain markdown, accessible without the app +- **Git-friendly**: Users can version control their tasks folder +- **Compatible with other tools**: Use with Obsidian, Logseq, VS Code, etc. +- **Multiple vaults**: Users can have separate task folders for work/personal +- **User choice**: Dropbox, iCloud, OneDrive, local folder - user decides #### WebDAV Sync - **Conflict Resolution**: Last-write-wins with timestamp @@ -317,10 +330,19 @@ pub trait Storage { **CLI Example**: ```bash -bevy-tasks init ~/my-tasks +# First run: initialize tasks folder +bevy-tasks init ~/Documents/Tasks + +# Or use a cloud-synced folder +bevy-tasks init ~/Dropbox/Tasks + +# Then use normally bevy-tasks add "Buy groceries" --list "Personal" bevy-tasks list bevy-tasks complete + +# Change folder location +bevy-tasks config set-folder ~/new/location ``` ### Phase 2: WebDAV Sync (Backend + CLI) @@ -358,7 +380,7 @@ bevy-tasks sync --status - [ ] Basic task list view - [ ] Create/edit/delete tasks - [ ] Mark tasks complete -- [ ] Settings screen (storage location, WebDAV config) +- [ ] Settings screen (change folder location, WebDAV config) - [ ] Desktop support (Windows, Linux, macOS) - [ ] Sync status indicators @@ -379,7 +401,7 @@ bevy-tasks sync --status - [ ] Rich markdown editor for task notes - [ ] Drag & drop reordering - [ ] Move tasks between lists -- [ ] Folder picker for custom storage +- [ ] Change storage folder location in settings - [ ] Keyboard shortcuts - [ ] Search functionality @@ -679,7 +701,7 @@ cargo test --watch # with cargo-watch 2. **Build CLI to test backend**: ```bash cd crates/bevy-tasks-cli -cargo run -- init ~/my-tasks +cargo run -- init ~/Documents/TestTasks cargo run -- add "Test task" cargo run -- list ``` @@ -824,5 +846,5 @@ To be determined. --- **Last Updated**: 2025-10-27 -**Document Version**: 2.1 -**Status**: Ready to Implement - egui Hybrid Approach Confirmed +**Document Version**: 2.2 +**Status**: Ready to Implement - User-Controlled Storage