Skip to content

Conversation

@ShivaGupta-14
Copy link
Contributor

Add Entry Date Field to Add Task Dialog

Description

Implemented the entry date field in the Add Task dialog, allowing users to specify the entry date when creating a new task.

Previously, the entry field could only be set via the CLI tool. This change makes it accessible directly from the UI while keeping it completely optional.

  • Add entry date field to backend request body and Taskwarrior CLI
  • Implement entry date picker in AddTaskDialog frontend component
  • Update type definitions and hooks to support entry field
  • Add comprehensive frontend and backend tests for the new field

Updates: #188

Checklist

  • Ran npx prettier --write . (for formatting)
  • Ran gofmt -w . (for Go backend)
  • Ran npm test (for JS/TS testing)
  • Added unit tests, if applicable
  • Verified all tests pass
  • Updated documentation, if needed

Additional Notes

Self-Review

I've reviewed my changes and confirm:

  • Optionality: The entry field is completely optional; leaving it empty causes no errors.
  • Test Coverage: Added 4 new frontend tests covering the full UI flow for this field.
  • Consistency: The implementation matches the existing due date field pattern.
  • No Regressions: All existing tests passed, ensuring no breaking changes.

Screenshots

  • Add Task Dialog with Entry Field:

    Video:

Screen.Recording.2025-12-11.at.7.02.19.PM.mov

@github-actions
Copy link

Thank you for opening this PR!

Before a maintainer takes a look, it would be really helpful if you could walk through your changes using GitHub's review tools.

Please take a moment to:

  • Check the "Files changed" tab
  • Leave comments on any lines for functions, comments, etc. that are important, non-obvious, or may need attention
  • Clarify decisions you made or areas you might be unsure about and/or any future updates being considered.
  • Finally, submit all the comments!

This helps make the review process smoother and gives us a clearer understanding of your thought process.

Once you've added your self-review, we'll continue from our side. Thank you!

@ShivaGupta-14 ShivaGupta-14 force-pushed the feat/188-add-entry-to-addTask branch from 5b462b9 to bd5cbd7 Compare December 11, 2025 14:40
@ShivaGupta-14
Copy link
Contributor Author

Hi @its-me-abhishek!

I noticed that the date-fns mock in AddTaskDialog.test.tsx is static, which causes confusing test expectations because the input date doesn’t match the output. Should we switch to a dynamic mock so the test logic is clearer and easier to follow, or should we leave it as is?

@its-me-abhishek
Copy link
Collaborator

Will look into this @ShivaGupta-14

@ShivaGupta-14
Copy link
Contributor Author

@its-me-abhishek, I’ve already completed the self-review and added it to the PR.

@ShivaGupta-14 ShivaGupta-14 force-pushed the feat/188-add-entry-to-addTask branch 5 times, most recently from 88cfeda to a12b4de Compare December 23, 2025 16:58
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

extract entryDate from request body and passed it to the function

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

added the entry field to this struct to accept it from frontend

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

update the function to accept entrydate parameter

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

added new test cases for entry field

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

added entry field to new task state and pass it to addTaskToBackend when submitting, and after submission, reset it.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

added entry field to addTaskToBackend function parameter, type definition and request body.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

added entry-date ui

Copy link
Contributor Author

@ShivaGupta-14 ShivaGupta-14 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

self review completed!, open to any suggestions or feedback.

@ShivaGupta-14 ShivaGupta-14 force-pushed the feat/188-add-entry-to-addTask branch from a12b4de to 1329c43 Compare December 23, 2025 18:34
@ShivaGupta-14
Copy link
Contributor Author

Hi @its-me-abhishek!

I noticed that the date-fns mock in AddTaskDialog.test.tsx is static, which causes confusing test expectations because the input date doesn’t match the output. Should we switch to a dynamic mock so the test logic is clearer and easier to follow, or should we leave it as is?

Hi @its-me-abhishek!

This is also ready for review. I just wanted to confirm one thing, what would you prefer we do with this function? Should we move to a dynamic mock for clearer test logic, or keep it as it is?

@its-me-abhishek
Copy link
Collaborator

Should be fixed imo

- Add entry date field to backend request body and Taskwarrior CLI
- Implement entry date picker in AddTaskDialog frontend component
- Update type definitions and hooks to support entry field
- Add comprehensive frontend and backend tests for the new field

Issue: CCExtractor#188
@ShivaGupta-14 ShivaGupta-14 force-pushed the feat/188-add-entry-to-addTask branch from 1329c43 to bf6f416 Compare December 24, 2025 09:29
@ShivaGupta-14
Copy link
Contributor Author

Hi @its-me-abhishek!

Done!, Now this PR is also completely ready for review.

import { AddTaskdialog } from '../AddTaskDialog';
import '@testing-library/jest-dom';

jest.mock('date-fns', () => ({
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

changed date-fns mock from static to dynamic, now returns the actual formatted date based on input.

@its-me-abhishek its-me-abhishek merged commit 5fbf2df into CCExtractor:main Dec 24, 2025
4 checks passed
@ShivaGupta-14
Copy link
Contributor Author

Thanks for merging :)

@ShivaGupta-14 ShivaGupta-14 deleted the feat/188-add-entry-to-addTask branch December 25, 2025 05:08
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.

2 participants