[Enhancement] Prevent empty tasks and treat empty edit as delete with undo #113

Open
opened 2026-05-06 16:40:31 +00:00 by kodebarista · 2 comments
kodebarista commented 2026-05-06 16:40:31 +00:00 (Migrated from github.com)

Issue/Description:
Currently, the app allows creating tasks with no text (just space) sub-tasks with no char at all and saving existing tasks as empty. This leads to meaningless entries. Additionally, if a user accidentally clears text during edit (e.g., via the "X" button), there is no way to recover what was typed, resulting in an empty task.

Steps to Reproduce:

  • Open Tasks app
  • Create a new task with just space & create
  • Observe an empty task being created
  • Edit an existing task with valid text
  • Clear all text (e.g., using the "X" button) and save
  • Observe the task becomes empty with no recovery option

Expected Behavior:

  • Creating a new task with no text should be discarded (no task created on Enter).
  • Creating a new sub-task with no text should be discarded
  • Editing an existing task:
    • If text becomes empty and is saved, it should trigger a delete action instead of saving an empty task.
    • The delete action then trigger undo, allowing the user to restore the task to original text (before edit).

Other Notes:
This change would prevent accidental creation of empty tasks and provide a safer editing experience by enabling recovery through undo or trash.

  • tasks & sub-tasks with no meaningful information
Image
**Issue/Description:** Currently, the app allows creating tasks with no text (just space) sub-tasks with no char at all and saving existing tasks as empty. This leads to meaningless entries. Additionally, if a user accidentally clears text during edit (e.g., via the "X" button), there is no way to recover what was typed, resulting in an empty task. **Steps to Reproduce:** - Open Tasks app - Create a new task with just space & create - Observe an empty task being created - Edit an existing task with valid text - Clear all text (e.g., using the "X" button) and save - Observe the task becomes empty with no recovery option **Expected Behavior:** - Creating a new task with no text should be discarded (no task created on Enter). - Creating a new sub-task with no text should be discarded - Editing an existing task: - If text becomes empty and is saved, it should trigger a delete action instead of saving an empty task. - The delete action then trigger undo, allowing the user to restore the task to original text (before edit). **Other Notes:** This change would prevent accidental creation of empty tasks and provide a safer editing experience by enabling recovery through undo or trash. - tasks & sub-tasks with no meaningful information <img height="400" alt="Image" src="https://github.com/user-attachments/assets/1ca5536b-9f38-4193-9114-926dc0963a0d" />
edfloreshz commented 2026-05-06 19:17:10 +00:00 (Migrated from github.com)

This is an easy fix! I'm simply checking that the input is not empty, I should also check for white spaces.

This is an easy fix! I'm simply checking that the input is not empty, I should also check for white spaces.
kodebarista commented 2026-05-06 19:18:42 +00:00 (Migrated from github.com)

Yeah, trimming before check should fix this

Yeah, trimming before check should fix this
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
edfloreshz/tasks#113
No description provided.