Open makeavish opened 10 months ago
Hi Vishal, I would like to work on this issue shall I take it.
Sure @joemiltonm Assigned to you
Do propose the approach you will take and suggested location of the history of custom time period before starting to actually code
Do propose the approach you will take and suggested location of the history of custom time period before starting to actually code
Thank you, sure will proceed after proposing the approach here.
Hi @pranay01 ,
To implement this I would recommend using local storage combined with redux state management to store and retrieve the history of custom time ranges.
Workflow: When the user selects a custom time range using this we create a new object with 'label' and 'value' as key. This is dispatched to a 'customTimeHistory' state variable, which maintains an array of objects. Simultaneously, the object is stored in 'timeHistory' key in the local storage. This ensures new custom date gets reflected in the dropdown options and also stored in local storage for persistance.
When the application starts, the 'customTimeHistory' redux variable initialises to the values from the local storage or an empty array if local storage is not available.
Please suggest if any changes are required in this approach.
Below is the screencast of the custom time history feature I experimented with the approach I've mentioned. please have a look.
Screencast from 09-01-24 01:07:28 PM IST.webm
Further, if the user keeps adding custom dates then a long list of custom dates will appear clumsy. To avoid this
we can include a 'remove' button next to the custom time ranges to manually delete it.
or
we can limit the total custom time ranges that can be added to say 5 or 8 and If this limit is exceeded, we could remove the oldest date (FIFO)
Please share your preferred way or any different approach we need to take.
@YounixM Please review above approach
@joemiltonm: We are in the process of updating the design for the time selector. It will take a week or so. Post that, we can collaborate and get this change merged.
@joemiltonm: We are in the process of updating the design for the time selector. It will take a week or so. Post that, we can collaborate and get this change merged.
@YounixM, sure. we'll collaborate and implement the feature in the updated design.
https://www.loom.com/share/8ca6fd5f73ca4370a7cf9a75e733fb81?sid=7777ce46-195c-4e7f-a0c8-3ceb93e95036