mirror of
https://github.com/aculix/negotium.git
synced 2026-09-11 07:28:17 +00:00
feat: edit a task in place
Fixing a typo meant deleting the task and typing it again, which also cost you its position in the list. Click the text to edit it. Enter saves, Escape cancels, clicking away saves. The rename rule lives in tasks.js and is tested. It refuses blank input rather than treating it as a delete, since selecting all and hitting enter by accident should give you your task back, and it returns the original array untouched when nothing changed so an idle edit does not write to storage. The interesting part was what editing collides with. Keystrokes are stopped from reaching the row, or Delete would remove the task you are typing into and Alt+Arrow would reorder it mid-edit. A drag cannot start from inside the field, and the click a drag leaves behind is swallowed, or dropping a row would open it for editing. Switching day, deferring a task and the midnight rollover all close an open editor, so it cannot be left hanging over a row that is no longer there.
This commit is contained in:
@@ -17,6 +17,7 @@ Built with Svelte for speed and simplicity. No overwhelming features, no endless
|
||||
- ↩️ **Undo** - `Cmd/Ctrl+Z` brings back a deleted task, in its original position
|
||||
- 📅 **Today & Tomorrow lists** - Plan ahead with separate task lists
|
||||
- 🔄 **Unfinished work carries over** - When a new day begins, tasks you didn't finish move to Today; completed ones are cleared away
|
||||
- ✏️ **Edit a task** - Fix a typo without deleting and retyping it
|
||||
- ➡️ **Push a task to tomorrow** - Didn't get to it? Move it across without retyping it
|
||||
- 🎯 **Reorder by drag or keyboard** - Drag with a mouse, long-press and drag on touch, or use `Alt+↑`/`Alt+↓`
|
||||
- 💾 **Persistent storage** - All tasks saved locally in your browser
|
||||
@@ -89,6 +90,7 @@ The date, storage, rollover, task and undo logic lives in `src/lib/` as plain mo
|
||||
### Managing Tasks
|
||||
- **Add a task**: Type in the input field and press Enter
|
||||
- **Complete a task**: Click the checkbox next to the task
|
||||
- **Edit a task**: Click its text. Enter saves, Escape cancels, and clicking away saves too
|
||||
- **Delete a task**: Click the delete icon on the task (it shows on hover, and is always visible on touch), or press `Delete` with the task focused
|
||||
- **Undo a delete**: Press `Cmd/Ctrl+Z`. The task returns to where it was
|
||||
- **Move a task to Tomorrow**: Click the arrow on the task, or press `Alt+→`. From Tomorrow, the arrow points back and `Alt+←` returns it to Today
|
||||
|
||||
Reference in New Issue
Block a user