ccsync icon indicating copy to clipboard operation
ccsync copied to clipboard

Make Task Model Fields Editable on Frontend and Backend

Open its-me-abhishek opened this issue 1 year ago • 20 comments

Description: Currently, the Task model has several fields, but not all are editable consistently. Some fields are editable only on the backend, some only on the frontend, and some aren’t editable at all. The goal is to make the as many fields editable on both frontend and backend as possible (some might not be able to, due to conflicts in data types, etc.).

Fields to Make Editable:

  • [x] Description (description)
  • [x] Project (project)
  • [x] Tags (tags)
  • [x] Status (status)
  • [x] Urgency (urgency)
  • [x] Priority (priority)
  • [x] Due (due)
  • [x] Start (start)
  • [x] End (end)
  • [x] Entry (entry)
  • [x] Wait (wait)
  • [x] Depends (depends)
  • [x] RType (rtype)
  • [x] Recur (recur)
  • [x] Annotations (annotations)

Note: Since it is a large task, separate PRs shall be created for each field, iteratively.

its-me-abhishek avatar Nov 08 '25 17:11 its-me-abhishek

@its-me-abhishek Can i work on it I will create seperate PR for each and keep this discussion updated?? Kindly assign it to me

Rustix69 avatar Nov 09 '25 18:11 Rustix69

Since this is a big issue, it may require assigning it to many contributors. Please feel free to pickup any of the fields and create a PR explaining your approach in its description, will review and merge accordingly!

its-me-abhishek avatar Nov 10 '25 05:11 its-me-abhishek

Hi! I'd like to take on the Description field. I'll start working on it and will submit a PR that references this issue.

Atharva1015 avatar Nov 11 '25 09:11 Atharva1015

hi @Atharva1015, since description is already editable, please pick some other field (any unchecked field in that checklist above)

its-me-abhishek avatar Nov 11 '25 10:11 its-me-abhishek

Hey @its-me-abhishek ,

I reviewed the code and noticed that we’re maintaining separate states for each field. This approach increases complexity since we end up managing twice as many states as the number of fields, leading to repetitive code.

Would it be okay if I refactor this to use a single JSON state object that holds all the field values? This would simplify the logic and make the code more maintainable.

Ankit-69k avatar Nov 11 '25 18:11 Ankit-69k

single JSON state object that holds all the field values?

IMO, that would supposedly make it harder to know what command to run on the backend, separate states for each field makes it sort of easier to make requests to the backend - to run the desired TW commands

its-me-abhishek avatar Nov 12 '25 11:11 its-me-abhishek

single JSON state object that holds all the field values?

IMO, that would supposedly make it harder to know what command to run on the backend, separate states for each field makes it sort of easier to make requests to the backend - to run the desired TW commands

As far as I can tell, handleEditTaskOnBackend is the only function being called for both the description and tags. It then invokes the editTaskOnBackend hook to update the tasks. So, I don’t see any separate API calls — it’s just that the state is being managed separately. In the end, both fields trigger the same function.

Ankit-69k avatar Nov 12 '25 12:11 Ankit-69k

you're right that handleEditTaskOnBackend is the common function being called for both description and tags.

However, we actually have two backend functions for editing tasks:

  • editTask: used by the web
  • modifyTask: used by the app (ref)

the short-term goal is to make as many task fields editable as possible through these two functions (starting with editTask on the web (this issue), then changing modifyTask later on for the app).

in the longer term, we plan to split these iteratively into individual field-level edits on the backend; that’ll make calls faster and payloads smaller. Once that’s stable and tested, finally we can move to a unified JSON state on frontend if and when required.

since we’ll likely need to update the frontend again when that happens, it’s better to leave the current state structure as-is for now.

its-me-abhishek avatar Nov 12 '25 13:11 its-me-abhishek

hey @its-me-abhishek ,I have completed the work on the "Due" field ,and I'll create a PR shortly . Just letting you know !

Hell1213 avatar Nov 15 '25 05:11 Hell1213

@Hell1213 I had worked on the Date Picker PR so we will use the same component in this edit too. I feel that will be better.

  • PR : #172

Rustix69 avatar Nov 15 '25 06:11 Rustix69

@Hell1213 I had worked on the Date Picker PR so we will use the same component in this edit too. I feel that will be better.

@Rustix69 Thanks for the heads up! I'll use the DatePicker component from #172 for the Due field edit functionality. That will keep the UI consistent across the app. Appreciate the guidance!

Hell1213 avatar Nov 15 '25 12:11 Hell1213

@Hell1213 you may checkout Start, End, Entry, Wait, etc. they're also date based and require attention

its-me-abhishek avatar Nov 15 '25 14:11 its-me-abhishek

@Hell1213 you may checkout Start, End, Entry, Wait, etc. they're also date based and require attention

Thanks for the update, @its-me-abhishek. Since the Due field was already handled, I picked up the “start” field instead. I’ve completed the changes and will open a PR soon.

Hell1213 avatar Nov 15 '25 14:11 Hell1213

@its-me-abhishek , I had already begun working on the Entry field. Now that start field has been resolved , I’ll wrap it up and open a PR for Entry field soon.

Hell1213 avatar Nov 17 '25 11:11 Hell1213

Hey @its-me-abhishek can I pick some of these fields to make them editable.

Neeraj-gagat avatar Nov 18 '25 09:11 Neeraj-gagat

sure, @Neeraj-gagat there are some fields yet to be fixed, do check the checklist and pick any of those you'd like to work on!

its-me-abhishek avatar Nov 18 '25 13:11 its-me-abhishek

@its-me-abhishek For annotations field

Backend has it, frontend Task type missing it so , Will first add to task panel, then make it editable. will open seperate pr shortly !.

Hell1213 avatar Dec 06 '25 19:12 Hell1213

It can be done similar to Tags, but with a width that extends similar to the input field One can add or remove any number of annotations so that is something that needs to be done

its-me-abhishek avatar Dec 07 '25 07:12 its-me-abhishek

I'm working on annotation field will open a pr shortly ! thanks .

Hell1213 avatar Dec 23 '25 16:12 Hell1213

Finally all the fields are Editable and are viewable on the Add Task panel! Great work everyone, and thanks to all!

its-me-abhishek avatar Dec 24 '25 08:12 its-me-abhishek