Skip to content

Conversation

@Hell1213
Copy link
Contributor

@Hell1213 Hell1213 commented Dec 10, 2025

Description

This PR adds support for annotations when creating a task. An annotations input has been added to the Add Task dialog (following the existing tags UX), and the backend has been updated to correctly apply annotations using Taskwarrior after task creation. A read-only annotations section is also included in the Task Details view, and update test mocks to include annotations field for TypeScript compatibility

The scope is intentionally limited to adding the annotations field during task creation; editing annotations is out of scope.

Contributes to #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

Annotations follow the same UI pattern as tags for consistency. Backend uses proper task ID retrieval for reliable annotation attachment to Taskwarrior.

** Demo video**

Screencast.from.2025-12-19.10-40-31.mp4

@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!

@Hell1213
Copy link
Contributor Author

hey @its-me-abhishek,
I've opened the PR for adding annotations to the Add Task Panel (#188). The implementation is complete and ready for review:

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This annotation logic retrieves the actual task ID after creation instead of using newest filter, which ensures reliable annotation attachment to the correct task in Taskwarrior.

Copy link
Contributor Author

@Hell1213 Hell1213 left a comment

Choose a reason for hiding this comment

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

Implemented annotations support in Add Task, wired it up in the backend with proper task ID handling, added read-only display in Task Details, and updated tests. All changes stay within the intended scope.

@its-me-abhishek
Copy link
Collaborator

annotation lookup logic is fragile because it relies on the next report, which doesn’t guarantee ordering and can return unpredictable output depending on user config, report definitions, or task statuses. this makes the ID extraction unreliable and may fail after sync or if the report isn’t configured exactly as expected. We should switch to a stable source of truth by using task export (JSON) maybe and extracting the UUID of the last created task. UUIDs are consistent across sync and avoid ID-shift issues as ID is unreliable most of the times.

@Hell1213
Copy link
Contributor Author

annotation lookup logic is fragile because it relies on the next report, which doesn’t guarantee ordering and can return unpredictable output depending on user config, report definitions, or task statuses. this makes the ID extraction unreliable and may fail after sync or if the report isn’t configured exactly as expected. We should switch to a stable source of truth by using task export (JSON) maybe and extracting the UUID of the last created task. UUIDs are consistent across sync and avoid ID-shift issues as ID is unreliable most of the times.

Thank ! You were absolutely right about the fragile annotation lookup logic, I'm working on it will update PR shortly

@Hell1213 Hell1213 force-pushed the feat/add-annotations-to-task-panel branch from 3cbc519 to 422c0cf Compare December 16, 2025 15:38
@Hell1213
Copy link
Contributor Author

hey @its-me-abhishek , I’ve updated the annotations implementation so the task is identified reliably after creation and annotations are attached to the correct task using task export instead of report-based lookup. The PR is ready for review now. Thanks.

@Hell1213 Hell1213 force-pushed the feat/add-annotations-to-task-panel branch from 422c0cf to 1d18419 Compare December 16, 2025 16:06

func TestAddTaskWithTags(t *testing.T) {
err := AddTaskToTaskwarrior("email", "encryption_secret", "clientId", "description", "", "H", "2025-03-03", []string{"work", "important"})
err := AddTaskToTaskwarrior("email", "encryption_secret", "clientId", "description", "", "H", "2025-03-03", []string{"work", "important"}, nil)
Copy link
Collaborator

Choose a reason for hiding this comment

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

nil values should be removed from these tests everywhere to prevent flaky nature

Copy link
Collaborator

@its-me-abhishek its-me-abhishek left a comment

Choose a reason for hiding this comment

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

Please fix

@Hell1213 Hell1213 force-pushed the feat/add-annotations-to-task-panel branch from 1d18419 to cf1bced Compare December 17, 2025 12:56
@Hell1213
Copy link
Contributor Author

hey @its-me-abhishek
I have updated the PR .
The nil values in the tests have been replaced with proper empty arrays.
thanks

setIsCreatingNewProject,
uniqueProjects = [],
}: AddTaskDialogProps) => {
const [annotationInput, setAnnotationInput] = useState('');
Copy link
Collaborator

Choose a reason for hiding this comment

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

it seems this takes only one Annotation as an input, please fix this as there can be many annotations!

Copy link
Contributor Author

Choose a reason for hiding this comment

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

updated , task can have multiple annotations like tags

@its-me-abhishek
Copy link
Collaborator

The nil values in the tests have been replaced with proper empty arrays.

For this as well, please add some textual value to that as '' or nil or [''] mostly end up in creating false positives

@Hell1213
Copy link
Contributor Author

Hell1213 commented Dec 19, 2025

The nil values in the tests have been replaced with proper empty arrays.

For this as well, please add some textual value to that as '' or nil or [''] mostly end up in creating false positives

Updated the PR , tasks have multiple annotations support ,
and implemented proper test values instead nil or empty array

- Add annotations field to AddTaskRequestBody and frontend forms
- Implement annotation processing using task export for reliable task ID
- Fix stale state bug in handleAddTask function
@Hell1213 Hell1213 force-pushed the feat/add-annotations-to-task-panel branch from cf1bced to 1ac343f Compare December 19, 2025 05:11
@its-me-abhishek its-me-abhishek merged commit af9ab8c into CCExtractor:main Dec 19, 2025
4 checks passed
ShivaGupta-14 pushed a commit to ShivaGupta-14/ccsync that referenced this pull request Dec 25, 2025
- Add annotations field to AddTaskRequestBody and frontend forms
- Implement annotation processing using task export for reliable task ID
- Fix stale state bug in handleAddTask function
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