Skip to content

fix(linux): do not discard quick-add drafts before async save succeeds - #38

Merged
turinglambdaai merged 2 commits into
mainfrom
fix/linux-quick-add-keep-draft-until-save
Oct 21, 2026
Merged

turinglambdaai merged 2 commits into
mainfrom
fix/linux-quick-add-keep-draft-until-save

Conversation

@turinglambdaai

Copy link
Copy Markdown
Owner

Bug

Linux quick add clears the GTK entry before requesting parse_quick_add and add_task. If parsing or persistence fails, the user permanently loses their typed task. The code also allows repeated Enter/plus submissions while the first RPC is pending, producing duplicate tasks.

Fix

  • Keep the submitted text in the entry until the backend reports a successful add. On parsing or saving errors, preserve the input and report the backend error.
  • Guard concurrent submits with an in-flight flag, resetting it for success, errors and disconnected backend cases.
  • Clear input and preview only if its current text still matches the submitted draft. A new task typed during an in-flight RPC is never erased by the older operation.
  • Capture the selected or default target list ID before either asynchronous RPC so changing lists cannot redirect a task.
  • Reject whitespace-only submissions without clearing user input; use the same quick-add grammar as Windows/macOS.

QA

  • Linux GTK build + packaged acceptance green
  • 生活 selected → Enter creates one task in 生活; quick repeated Enter doesn't duplicate it
  • Backend parse/save failure keeps the exact text; retry works
  • Start task A, edit to draft B before A finishes; A success doesn't remove B
  • New task/preview still operate normally; undo-banner task restoration unaffected

Independent of #33 (Linux selection) and #34 (divider CSS); these branches touch different areas of the same file, so review the combined Linux build before release.

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.

1 participant