self-operating-computer icon indicating copy to clipboard operation
self-operating-computer copied to clipboard

Proposal for Codebase Refactoring to Enhance Readability and Maintainability

Open gtlYashParmar opened this issue 2 years ago • 9 comments

I've been reviewing the project's codebase and noticed that all the logic and functions are currently contained within a single file. This structure, while functional, can make the code challenging to read and maintain. To improve the readability and maintainability of the code, I propose restructuring it by:

  1. Separating functions into different files based on their functionality.
  2. Creating directories to logically categorize these files. This approach will not only make the code easier to navigate but also simplify future development efforts by providing a clearer modular structure.

I am eager to contribute to this enhancement and have already started working on a preliminary refactoring plan. My goal is to collaborate with the community to develop a structure that best suits our project's needs. I look forward to hearing your thoughts and suggestions on this proposal.

gtlYashParmar avatar Dec 01 '23 09:12 gtlYashParmar

I think we'll be due for a refactor soon. As the Contributing.md mentions, let's do a refactor once the main.py is over 1000 lines

joshbickett avatar Dec 21 '23 15:12 joshbickett

@joshbickett Thank you for considering a future refactor when main.py exceeds 1000 lines. I'll continue preparing by reviewing the code, documenting potential improvements, and staying engaged with the community. If there are any specific triggers or milestones to start the refactor, please let me know. I'm eager to contribute when the time is right.

gtlYashParmar avatar Dec 22 '23 05:12 gtlYashParmar

Yes the codebase is mess right now there is only single file for everything doesn’t make sense please break it down to multiple modules and manage them separately. Thanks for your work guys 😊

haseeb-heaven avatar Dec 22 '23 15:12 haseeb-heaven

Hey @joshbickett Can i start working on refactoring code.

gtlYashParmar avatar Dec 28 '23 06:12 gtlYashParmar

Hey @joshbickett Can i start working on refactoring code.

I dont think you need to ask for that its not a FR so do it.

haseeb-heaven avatar Dec 28 '23 06:12 haseeb-heaven

@gtlYashParmar yes let's start a refactor. Could you share a little of what you have in mind? I was thinking creating a separate prompt.py file or something similar. Curious to hear about how you're thinking about breaking the files up

joshbickett avatar Dec 28 '23 16:12 joshbickett

@gtlYashParmar yes let's start a refactor. Could you share a little of what you have in mind? I was thinking creating a separate prompt.py file or something similar. Curious to hear about how you're thinking about breaking the files up

I think you need different sections for different modules yes prompt response and ui etc

haseeb-heaven avatar Dec 28 '23 19:12 haseeb-heaven

@joshbickett @haseeb-heaven I Created Pull Request. Just check what i did in my Latest Pull Request #119 and let me know if there are any issues or changes.

gtlYashParmar avatar Dec 29 '23 08:12 gtlYashParmar

@gtlYashParmar I'll take a look thanks

joshbickett avatar Dec 29 '23 14:12 joshbickett

I'll close this since #119 was merged

joshbickett avatar Feb 09 '24 05:02 joshbickett