Skip to content

feat: make recur field editable#232

Merged
its-me-abhishek merged 4 commits intoCCExtractor:mainfrom
Hell1213:feat/make-recur-field-editable
Dec 6, 2025
Merged

feat: make recur field editable#232
its-me-abhishek merged 4 commits intoCCExtractor:mainfrom
Hell1213:feat/make-recur-field-editable

Conversation

@Hell1213
Copy link
Copy Markdown
Contributor

@Hell1213 Hell1213 commented Nov 28, 2025

Added recur field editing functionality with dropdown selection. Users can set task recurrence (daily, weekly, monthly, yearly) and Taskwarrior automatically updates the rtype field.

Changes

Backend:

  • Added Recur field to EditTaskRequestBody model
  • Updated EditTaskHandler to extract and pass recur parameter
  • Modified EditTaskInTaskwarrior to execute task modify recur:value command

Frontend:

  • Added recur parameter to editTaskOnBackend function
  • Implemented dropdown UI for recur field with save/cancel buttons
  • Added read-only RType field display with conditional explanation text
  • Updated all handleEditTaskOnBackend calls to pass recur value

Tests:

  • Updated test function signatures to include recur parameter
  • All tests passing (258/259 frontend tests - 1 pre-existing failure unrelated to changes)

How It Works

When users edit the recur field, the backend executes task <id> modify recur:value. Taskwarrior automatically sets the rtype field to "periodic" for time-based recurrences. Both fields are displayed in task details - recur is editable via dropdown, rtype is read-only.

UI Improvements

  • Dropdown with 4 clean options: Daily, Weekly, Monthly, Yearly
  • Hover effects for better visual feedback
  • No "None" option to avoid complexity - users simply don't set recurrence if not needed

Checklist

  • Ran npx prettier --write .
  • Ran gofmt -w .
  • Ran npm test
  • Verified all tests pass
  • Tested on localhost

Additional Notes

RType Values:

  • periodic - Regular time-based recurrence (daily, weekly, monthly, yearly)
  • chained - Recurs after previous instance completes (advanced use case)
  • None - No recurrence

RType is automatically managed by Taskwarrior and cannot be edited directly. The UI shows "(Auto-set by recur)" when the field is empty to explain this behavior.

Screenshots
Screenshot from 2025-12-06 23-06-18
Screenshot from 2025-12-06 23-06-41

@Hell1213
Copy link
Copy Markdown
Contributor Author

Hey @its-me-abhishek,
PR is ready. The recur field is working exactly as we discussed, and Rtype get automatically update when user apply changes in recur field .
Please take a look whenever you get time. Thanks!

@its-me-abhishek
Copy link
Copy Markdown
Collaborator

Please fix the conflicts

Added recur field editing functionality. Users can set task recurrence
(daily, weekly, monthly, etc.) and Taskwarrior automatically updates
the rtype field. Both recur and rtype fields are now visible in task details.
@Hell1213 Hell1213 force-pushed the feat/make-recur-field-editable branch from 5661902 to ddd9866 Compare November 29, 2025 15:52
@Hell1213
Copy link
Copy Markdown
Contributor Author

@its-me-abhishek resolved all conflicts , and update the pr plss take a look when you get time , thanks .

onChange={(e) =>
setEditedRecur(e.target.value)
}
placeholder="daily, weekly, monthly, etc."
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

imo it'd be better to provide a dropdown to choose from one of those..

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

yeah thanks, A dropdown makes more sense.
I’ll update it with the common recur options and push the changes."

Replaced text input with dropdown for better UX.
Removed 'None' option to simplify selection.
Added hover effects for better visual feedback.
@Hell1213
Copy link
Copy Markdown
Contributor Author

Hey @its-me-abhishek,
I noticed one test in ReportsView.test.tsx is failing even on the main branch. It’s a date boundary issue — the weekly filtering test breaks on Sundays because “yesterday” ends up outside the computed week.
This is unrelated to the recur field changes.
How should we handle this one?

Comment thread backend/utils/tw/taskwarrior_test.go Outdated

func TestEditTaskInATaskwarrior(t *testing.T) {
err := EditTaskInTaskwarrior("uuid", "description", "email", "encryptionSecret", "taskuuid", nil, "project", "2025-11-29T18:30:00.000Z", "2025-11-29T18:30:00.000Z", "2025-11-29T18:30:00.000Z", "2025-11-30T18:30:00.000Z", nil, "2025-12-01T18:30:00.000Z")
err := EditTaskInTaskwarrior("uuid", "description", "email", "encryptionSecret", "taskuuid", nil, "project", "2025-11-29T18:30:00.000Z", "2025-11-29T18:30:00.000Z", "2025-11-29T18:30:00.000Z", "2025-11-30T18:30:00.000Z", nil, "2025-12-01T18:30:00.000Z", "")
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Shall add some value in the tests, a nil or "" will mostly make these tests pass, while being flaky

<SelectItem
value="daily"
className="cursor-pointer hover:bg-accent"
>
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Shall also have a None field by default, and it should be selectable too... clicking that would remove any recurrence, as in this implementation one can 'SET' recursion but can not remove any (via the UI)

@Hell1213
Copy link
Copy Markdown
Contributor Author

Hell1213 commented Dec 3, 2025

@its-me-abhishek.
I’ll adjust the tests to avoid flaky empty values and add a selectable None option for clearing recurrence.
thanks.

@Hell1213
Copy link
Copy Markdown
Contributor Author

Hell1213 commented Dec 5, 2025

@its-me-abhishek
Added None option and updated tests.

Comment thread backend/utils/tw/edit_task.go Outdated
}

// Handle recur - this will automatically set rtype field
if recur == "none" {
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

this is not intended... what I meant was,
in a scenario when one edits the recur field, while:

  1. having no recur set previously: They should get an option of None to revert back, while adding a task. Hence show 4 options in that case
  2. already having a recur set: Then one can only modify the existing - hence no need to show the None option.

In the first case there won't be a need for a none call on backend in case the user chooses none, as it would lead to an error anyways. And we will not have an option to set none in the second case as well.

So make no call via frontend if None is chosen. And show none only when No recur has been already set

@Hell1213
Copy link
Copy Markdown
Contributor Author

Hell1213 commented Dec 6, 2025

@its-me-abhishek ,sure
I will update the frontend behavior accordingly.
Thanks .

@Hell1213 Hell1213 force-pushed the feat/make-recur-field-editable branch from 490fb0d to 7df0177 Compare December 6, 2025 18:22
@Hell1213
Copy link
Copy Markdown
Contributor Author

Hell1213 commented Dec 6, 2025

@its-me-abhishek ,
updated the recur field , dropdown as requested .

@its-me-abhishek
Copy link
Copy Markdown
Collaborator

LGTM! Merging this

@its-me-abhishek its-me-abhishek merged commit 6818fcd into CCExtractor:main Dec 6, 2025
4 checks passed
ShivaGupta-14 pushed a commit to ShivaGupta-14/ccsync that referenced this pull request Dec 25, 2025
* feat: make recur field editable

Added recur field editing functionality. Users can set task recurrence
(daily, weekly, monthly, etc.) and Taskwarrior automatically updates
the rtype field. Both recur and rtype fields are now visible in task details.

* chore: fix prettier formatting

* refactor: improve recur field dropdown UI

Replaced text input with dropdown for better UX.
Removed 'None' option to simplify selection.
Added hover effects for better visual feedback.

* fix: show None option only when task has no recur set
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