Skip to content

fix: preserve new task drafts and restore task list rendering#715

Open
rachit23tech wants to merge 2 commits into
Charushi06:mainfrom
rachit23tech:feature/export-to-calendar
Open

fix: preserve new task drafts and restore task list rendering#715
rachit23tech wants to merge 2 commits into
Charushi06:mainfrom
rachit23tech:feature/export-to-calendar

Conversation

@rachit23tech
Copy link
Copy Markdown
Contributor

Related Issue

Closes #580

Summary

Fixes the new task creation flow so opening the deadline picker no longer closes the form or discards unsaved input. It also restores task card rendering in the task list, which previously showed the pending count button without displaying the actual task items.

Changes Made

  • Prevented the new task modal from closing on backdrop clicks.
  • Added explicit modal close handling through Cancel, close button, and Escape.
  • Added unsaved-draft confirmation before discarding new task form input.
  • Kept the native datetime-local input and widened/repositioned the modal on desktop so the picker has room to open beside the form.
  • Updated post-save calendar behavior to focus the saved task’s due date in calendar view.
  • Fixed task list markup assembly so pending tasks render correctly again.
  • Added helper modules for new-task modal state handling and safe markup joining.
  • Added regression tests for modal draft-state behavior, post-save calendar focus, and task markup joining.

Testing

Tested locally with:

  • node --test .\tests\exportIcs.test.js .\tests\newTaskModal.test.mjs .\tests\taskMarkup.test.mjs
    Result:
  • 14 tests passed
  • 0 tests failed

Screenshots

image image

Checklist

  • Code follows project style
  • Tested locally
  • No unrelated changes included
  • Documentation updated (if applicable)

@rachit23tech
Copy link
Copy Markdown
Contributor Author

Hi @Charushi06

I have made the necessary fixes and sent in PR.
Kindly review it and merge it in.

Update me if any changes are needed.

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.

New task form closes when clicking anywhere around date picker out of new task window, causing unsaved task data loss

1 participant