ccsync icon indicating copy to clipboard operation
ccsync copied to clipboard

Break down Tasks.tsx into smaller files and utilities with incremental, tested PRs

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

The Tasks.tsx file under frontend/src/components/HomeComponents/Tasks/ has grown to over 2000 lines and has become difficult to manage and maintain. Refactor the codebase to split this file into smaller, focused components and utility files. Be sure to:

  • Identify logical segments (UI components like Dialog Boxes, hooks, utilities, state management, etc.) that can be extracted.
  • Incrementally refactor and extract each segment into its own file or module.
  • After each extraction, thoroughly test to ensure nothing is broken.
  • For each breaking or significant structural change, create a separate, small pull request to ease review and avoid introducing regressions.
  • Continue until Tasks.tsx is reduced to a manageable size and follows organized directory/file structure.

A 2000+ line single file should not exist for maintainability. Prioritize clarity, readability, and atomic PRs throughout the process.

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

Shall probably be in multiple PRs

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

Hi @its-me-abhishek, I’ve worked on this file before and can take this up. Could you please assign it to me?

ShivaGupta-14 avatar Nov 27 '25 14:11 ShivaGupta-14

hey @its-me-abhishek would like to contribute to this. will raise some pr anyone who will be working on this please keep the conversation updated about what part you will be working on so we can continously work on diffrent code and not end up working on same set of code

Neeraj-gagat avatar Nov 27 '25 14:11 Neeraj-gagat

Hey @its-me-abhishek, since this is a refactor of the same file and a lot of pieces depend on each other, it’s usually better if one person handles the whole flow. I’ve already finished the first 2 major parts (Dialog refactor + Table components refactor) - both are in the testing phase and together brought the file down to ~1100 lines. I’ve also prepared the final folder structure, and the full plan comes out to around 6 PRs. So I feel keeping this with one person will maintain consistency - but if you prefer collaboration, I’m happy to sync with Neeraj and share the full plan with him.

ShivaGupta-14 avatar Nov 28 '25 00:11 ShivaGupta-14

@ShivaGupta-14 would love to collaboratre can you tell me the plan about how do you plan to refactor things

Neeraj-gagat avatar Nov 28 '25 14:11 Neeraj-gagat

Hey @Neeraj-gagat, thanks for showing interest! As I mentioned earlier, this refactor is very interconnected, so handling it end-to-end keeps everything consistent. I’ve already completed most of the planned work and will be opening the first 3 PRs today, with the remaining ones in the next batch. That’s why I also asked for Abhishek’s opinion earlier, just to make sure we follow whatever approach he prefers. If anything comes up where I need support or a second pair of eyes, I’ll definitely loop you in.

ShivaGupta-14 avatar Nov 28 '25 21:11 ShivaGupta-14

The first step shall probably be breaking down Add Task and Edit Task Dialog Boxes into separate files. Then Abstract out the Table and render that inside Tasks.tsx. Hence using Add Task and Edit Task Dialogs inside that TasksTable file Finally moving out the Filters if possible (Projects, Tags, etc.)

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

hey @Ankit-69k my pr for this issue is already under review could you please look into some otheer issues

Neeraj-gagat avatar Dec 05 '25 09:12 Neeraj-gagat

hey @Ankit-69k my pr for this issue is already under review could you please look into some otheer issues

ok sure, actually the comment was 2 days ago thats why i raised my PR...my bad

Ankit-69k avatar Dec 05 '25 10:12 Ankit-69k