Task Manager App Refactor #7
Open
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This pull request introduces several new features, improvements, and bug fixes, as outlined below.
Each item is linked to its respective pull request for detailed context:
The app is live on Vercel: https://i-am-hired.vercel.app/
Changes made
Fix Filter Condition
Summary
When filtering tasks, completed tasks were incorrectly displaying as pending and vice versa.
In order to fix it, the conditions inside the task array filter method where inverted.
Test Cases
Completed.Clean the houseshould be displayed.Pending.Buy groceriesshould be displayed.Screenshots
Clean the houseiscompletedandBuy groceriesispending):Buy groceriesis not completed):Fix deletion button not updating the UI immediately
Summary
When deleting a task, the UI was not updating correctly since the array in the state was being mutated.
In order to fix it, I used the
filtermethod to create a new array without the selected task.Test Cases
Deletebutton on any task.Screen Recordings
delete-button-not-working.mp4
delete-button-working.mp4
Fix style inconsistencies
Summary
Use only Tailwind CSS classes instead of using both Tailwind and style prop.
Test Cases
Deletebutton looks the same.Screenshots
Ensure robust type safety and address UI issues
Summary
TaskItemprops.Tasktype in atypesdirectory.all,completed, orpending)completedwas being used asisCompleted, and propertytitlewas being used asname).newTasktonewTaskTitleand add an empty string as initial value.Issues resolved after the changes:
completedandpendingtasks look correct (sinceisCompletedproperty was being used instead ofcompleted, and the value was always undefined, then all tasks had thecompletedstyles).namewas being used instead oftitle, which added a new task with an undefined value fortitle.newTaskTitlehad an initial value ofundefined, making the input change from uncontrolled to controlled.Test Cases
completedandpendinghave their respective styling.Screen Captures
creating-new-task.mp4
Code refactoring and highlight selected tab
Summary
TaskManagercomponent into different components in a hierarchy that maps to the way the components are nested.Test Cases
Screen Captures
switch-tabs.mp4
Zustand implementation
Summary
Implement Zustand library in order to centralize common data in a store instead of passing props. Also added necessary actions to manipulate the data.
The following data was moved to the store:
Tests Cases
Everything should be working the same way as before, so verify that the following works:
Store tasks in localStorage
Summary
localStorage.localStorage.Test Cases
Screen Captures
changes-persisted.mp4
Show confirmation modal before deleting a task
Summary
Adds a confirmation modal that asks the user if they want to confirm the task deletion.
Test Cases
Screen Captures
Add deployment workflow for Vercel
Summary
Add deployment workflow for Vercel so every time a change is made in the
mainbranch, the project will be deployed to https://i-am-hired.vercel.app/Test Cases
UI Improvements
Summary
Test Cases
Screen Captures
ui-improvements.mp4