From 9ed84690aca0b6a8beedf97d60a59aae2dc704e2 Mon Sep 17 00:00:00 2001 From: Tristan Michael Date: Tue, 14 Apr 2026 07:19:27 -0700 Subject: [PATCH] Rename due_date to date across codebase MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The kebab menu and docs referred to a task "due date" but the field was just a date; this change renames due_date/group_by_due_date and related identifiers to date/group_by_date across Rust, TypeScript, Svelte, CLI, docs and tests to keep terminology consistent. Updates include API/command names, storage/models, repository methods, UI text, JS variables and builder/parse functions so code, tests and documentation all use "date" semantics. Preserve old "group_by_due_date" field name Add serde alias to ListMetadata.group_by_date so older .listdata.json files that used the previous field name (group_by_due_date) can still be deserialized correctly. This fixes serialization/deserialization issues encountered at /home/trztn/Documents/Onyx and /var/home/trztn/Nextcloud/Onyx. the frontmatter due should be date... I don't want due anywhere - Renamed `TaskFrontmatter.due` → `TaskFrontmatter.date`; YAML key on disk is now `date:` instead of `due:` - Added `#[serde(alias = "due")]` so existing task files with `due:` frontmatter still deserialize correctly - Updated google_tasks.rs to write `date:` instead of `due:` in generated YAML - Renamed CLI `--due` flag to `--date`; updated function signature and display string "Due:" → "Date:" Remove serde aliases and rename due→date Drop backwards-compat aliases and update frontmatter/metadata to use the canonical "date"/"group_by_date" fields. The aliases for group_by_due_date and due were removed to avoid maintaining backward-compatibility and to reflect the current schema. Updated storage types to rename the fields and adjusted serialization attributes so YAML/JSON frontmatter and .listdata.json files now use group_by_date and date consistently. --- CLAUDE.md | 6 ++-- apps/tauri/src-tauri/src/lib.rs | 12 ++++---- .../src/lib/components/NewTaskInput.svelte | 28 +++++++++---------- .../src/lib/components/TaskDetailView.svelte | 8 +++--- apps/tauri/src/lib/components/TaskItem.svelte | 6 ++-- apps/tauri/src/lib/stores/app.svelte.ts | 16 +++++------ apps/tauri/src/lib/types.ts | 4 +-- crates/onyx-cli/src/commands/group.rs | 8 +++--- crates/onyx-cli/src/commands/list.rs | 2 +- crates/onyx-cli/src/commands/task.rs | 16 +++++------ crates/onyx-cli/src/main.rs | 14 +++++----- crates/onyx-core/src/models.rs | 20 ++++++------- crates/onyx-core/src/repository.rs | 20 ++++++------- crates/onyx-core/src/storage.rs | 16 +++++------ 14 files changed, 88 insertions(+), 88 deletions(-) diff --git a/CLAUDE.md b/CLAUDE.md index 7242b94..4445b64 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -56,7 +56,7 @@ The GUI uses Svelte 5 runes mode (`$state`, `$derived`, `$effect`, `$props()`). - **Task animations**: Grid-rows `0fr`/`1fr` trick for smooth collapse/expand. Module-level `animateInIds` Set coordinates expand-in after toggle. - **Inline editing**: Click task to edit, auto-save on blur. `debouncedSave` snapshots task before timer to prevent stale-reference errors on component destroy. - **Kebab menus**: Tasks and lists use kebab menus with custom `ConfirmDialog` component (not native `confirm()`). "Move to..." is inline in the menu (not a submenu) to avoid overflow. -- **Main panel header**: Hamburger + window controls in top bar; list name (large, bold) + kebab below divider (matching task detail layout). Kebab has Rename, Group by due date, Delete completed, Delete list. +- **Main panel header**: Hamburger + window controls in top bar; list name (large, bold) + kebab below divider (matching task detail layout). Kebab has Rename, Group by date, Delete completed, Delete list. - **New task**: FAB button opens bottom toast sheet (outside sliding container for fixed positioning). ### Development phase @@ -81,10 +81,10 @@ Pre-alpha. No users, no released builds, no data to migrate. Breaking changes to - Workspace switcher drop-up with add/remove - Per-workspace theme system (System default, Light, Dark, Nord, Dracula, Solarized Dark) via CSS `data-theme` attribute - Completed tasks section with animated show/hide -- Due date picker/editor (DateTimePicker in new task + task detail); `has_time: bool` field tracks whether time is set +- Date picker/editor (DateTimePicker in new task + task detail); `has_time: bool` field tracks whether time is set - Move task between lists (inline list in kebab menu, no submenu) - List rename (inline input in main panel header via kebab) -- Group-by-due-date toggle per list (main panel kebab; persists flag but display sorting not yet implemented) +- Group-by-date toggle per list (main panel kebab; persists flag but display sorting not yet implemented) - Delete completed tasks (main panel kebab + subtask kebab, with confirmation dialogs) - Keyboard shortcuts (Escape priority chain: settings → detail → list menu → drawer → menus) - Setup screen with 2-step mode selection (Local Folder vs WebDAV Server), window dragging, "Open Existing Folder" option, remote folder browsing diff --git a/apps/tauri/src-tauri/src/lib.rs b/apps/tauri/src-tauri/src/lib.rs index aa0922f..f865618 100644 --- a/apps/tauri/src-tauri/src/lib.rs +++ b/apps/tauri/src-tauri/src/lib.rs @@ -488,7 +488,7 @@ fn rename_list( } #[tauri::command] -fn set_group_by_due_date( +fn set_group_by_date( list_id: String, enabled: bool, state: State<'_, Mutex>, @@ -498,12 +498,12 @@ fn set_group_by_due_date( mute_watcher(&mut s); let id = Uuid::parse_str(&list_id).map_err(|e| e.to_string())?; repo_mut(&mut s)? - .set_group_by_due_date(id, enabled) + .set_group_by_date(id, enabled) .map_err(|e| e.to_string()) } #[tauri::command] -fn get_group_by_due_date( +fn get_group_by_date( list_id: String, state: State<'_, Mutex>, ) -> Result { @@ -511,7 +511,7 @@ fn get_group_by_due_date( ensure_repo(&mut s)?; let id = Uuid::parse_str(&list_id).map_err(|e| e.to_string())?; repo_ref(&s)? - .get_group_by_due_date(id) + .get_group_by_date(id) .map_err(|e| e.to_string()) } @@ -924,8 +924,8 @@ pub fn run() { reorder_task, move_task, rename_list, - set_group_by_due_date, - get_group_by_due_date, + set_group_by_date, + get_group_by_date, set_webdav_config, set_workspace_theme, set_sync_interval, diff --git a/apps/tauri/src/lib/components/NewTaskInput.svelte b/apps/tauri/src/lib/components/NewTaskInput.svelte index 4da85e2..e43c7b0 100644 --- a/apps/tauri/src/lib/components/NewTaskInput.svelte +++ b/apps/tauri/src/lib/components/NewTaskInput.svelte @@ -9,21 +9,21 @@ let title = $state(""); let description = $state(""); - let dueDate = $state(null); - let dueDateHasTime = $state(false); + let date = $state(null); + let dateHasTime = $state(false); let inputEl = $state(null); let showDatePicker = $state(false); async function handleSubmit() { if (!title.trim()) return; const created = await app.createTask(title.trim(), description.trim() || undefined); - if (dueDate && created) { - await app.updateTask({ ...created, due_date: dueDate, has_time: dueDateHasTime }); + if (date && created) { + await app.updateTask({ ...created, date: date, has_time: dateHasTime }); } title = ""; description = ""; - dueDate = null; - dueDateHasTime = false; + date = null; + dateHasTime = false; newTaskState.open = false; } @@ -31,14 +31,14 @@ newTaskState.open = false; title = ""; description = ""; - dueDate = null; - dueDateHasTime = false; + date = null; + dateHasTime = false; showDatePicker = false; } function handleDateChange(iso: string | null, hasTime: boolean = false) { - dueDate = iso; - dueDateHasTime = hasTime; + date = iso; + dateHasTime = hasTime; } function formatDateChip(iso: string): string { @@ -47,7 +47,7 @@ const dayNames = ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"]; const day = dayNames[d.getDay()]; const pad = (n: number) => String(n).padStart(2, "0"); - const timePart = dueDateHasTime ? `, ${pad(d.getHours())}:${pad(d.getMinutes())}` : ""; + const timePart = dateHasTime ? `, ${pad(d.getHours())}:${pad(d.getMinutes())}` : ""; if (d.toDateString() === today.toDateString()) return `Today${timePart}`; return `${day}, ${pad(d.getDate())}/${pad(d.getMonth() + 1)}${timePart}`; } @@ -102,12 +102,12 @@ - {#if dueDate} + {#if date}
-