-
Notifications
You must be signed in to change notification settings - Fork 1
Update QuickFixFinder UI and Refactor Filters for Reusability #228
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
from SearchWorkerResult.kt to SearchFilters.kt
176a641 to
677f084
Compare
…een-update-UI since the project architecture changed the merge conflict was hard to manage hopefully everything was merged the right way
7d7db08 to
7fa722a
Compare
Cleanup consists in removing not needed code in SearchOnBoarding.kt
now all tests should pass
|
This PR is almost ready for review! |
1533a3d to
b904a29
Compare
b904a29 to
513da1f
Compare
|
ramshty
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overall really good work and nice effort of modularization. Your code is very clean and concise, i doubt that we could do better. Thanks for your work !!
app/src/main/java/com/arygm/quickfix/ui/uiMode/appContentUI/userModeUI/search/QuickFixFinder.kt
Show resolved
Hide resolved
app/src/main/java/com/arygm/quickfix/ui/uiMode/appContentUI/userModeUI/search/SearchFilters.kt
Show resolved
Hide resolved
app/src/main/java/com/arygm/quickfix/ui/uiMode/appContentUI/userModeUI/search/SearchFilters.kt
Show resolved
Hide resolved
...rc/main/java/com/arygm/quickfix/ui/uiMode/appContentUI/userModeUI/search/SearchOnBoarding.kt
Show resolved
Hide resolved
…een-update-UI - merge is resolved but not compiling
2987272 to
761f367
Compare
- The two files are QuickFixSlidingWindowWorker.kt and ProfileResults.kt
AnotherMedo
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Quite a bit of changes to keep the code maintainable, consistent and bug free. But otherwise great PR!
@ramshty will review the functionality of your branch by checking out to it
app/src/main/java/com/arygm/quickfix/ui/uiMode/appContentUI/userModeUI/search/QuickFixFinder.kt
Outdated
Show resolved
Hide resolved
app/src/main/java/com/arygm/quickfix/ui/uiMode/appContentUI/userModeUI/search/QuickFixFinder.kt
Show resolved
Hide resolved
app/src/main/java/com/arygm/quickfix/ui/uiMode/appContentUI/userModeUI/search/QuickFixFinder.kt
Show resolved
Hide resolved
...rc/main/java/com/arygm/quickfix/ui/uiMode/appContentUI/userModeUI/search/SearchOnBoarding.kt
Outdated
Show resolved
Hide resolved
...rc/main/java/com/arygm/quickfix/ui/uiMode/appContentUI/userModeUI/search/SearchOnBoarding.kt
Outdated
Show resolved
Hide resolved
.../main/java/com/arygm/quickfix/ui/uiMode/appContentUI/userModeUI/search/SearchWorkerResult.kt
Outdated
Show resolved
Hide resolved
.../main/java/com/arygm/quickfix/ui/uiMode/appContentUI/userModeUI/search/SearchWorkerResult.kt
Show resolved
Hide resolved
AnotherMedo
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please make sure to rollback the changes on tests if you want this PR merged.
I have noticed that you made the test files more trivial and I do not understand why... See the comments for more details.
|
|
||
| @Test | ||
| fun profileContent_displaysWorkerProfiles() { | ||
| // Set up test data | ||
| val testProfiles = | ||
| listOf( | ||
| WorkerProfile( | ||
| uid = "worker0", | ||
| fieldOfWork = "Plumbing", | ||
| rating = 3.5, | ||
| reviews = ArrayDeque(), | ||
| location = null, // Simplify for the test | ||
| price = 49.0, | ||
| ), | ||
| WorkerProfile( | ||
| uid = "worker1", | ||
| fieldOfWork = "Electrical", | ||
| rating = 3.0, | ||
| reviews = ArrayDeque(), | ||
| location = null, | ||
| price = 59.0, | ||
| )) | ||
|
|
||
| // Mock the AccountViewModel to return sample account data | ||
| // Mock AccountViewModel fetchUserAccount | ||
| every { accountViewModel.fetchUserAccount(any(), captureLambda()) } answers | ||
| { | ||
| val uid = firstArg<String>() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why was this test removed ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this test was not removed but updated to match the update of the ProfileResults composable. It was replaced by a new test that is testing exactly the same thing
| @Test | ||
| fun testTitleAndDescriptionAreDisplayed() { | ||
| // Set the composable content | ||
| composeTestRule.setContent { | ||
| SearchWorkerResult( | ||
| navigationActions, | ||
| searchViewModel, | ||
| accountViewModel, | ||
| userViewModel, | ||
| preferencesViewModel, | ||
| quickFixViewModel, | ||
| workerViewModel = workerViewModel) | ||
| } | ||
| // Set the search query and verify that the title and description match the query | ||
| searchViewModel.setSearchQuery("Unknown") | ||
|
|
||
| // Check if the description with the query text is displayed | ||
| composeTestRule.onAllNodesWithText("Unknown").assertCountEquals(3) | ||
| } | ||
|
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Again, why was this test removed ? Once added and passed, tests should in no way be removed. Please restore it
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This test was removed because the searchQuery field in searchViewModel appears to be unused and serves no functional purpose in the codebase. As a result, the test doesn’t provide any meaningful validation. At least from my understanding
Sebbayra
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I checked out on the branch to check if the filters still work, however there are some functionalities that have been changed and don't work, like for example we can't stack the rating filter on other filters, the emergency one bugs as well and doesn't stack, the location filter doesn't change colors when applied, and the normal search doesn't display results, and I have seen that you have changed the tests for SearchWorkerResult have been changed and I really want their logic and functionality unchanged because they are crucial to ensure that every filter works as intended.
|
Note: This PR will not be merged as it is too late and there are still some unresolved bugs like @Sebbayra pointed out. |
1c30bc9 to
f6ff04a
Compare
Closing this since it will not be merged as stated in the comment |



Description:
This PR updates the user interface of
QuickFixFinder.ktand, as part of the process, refactors the filtering logic into a dedicated, reusable component.Key changes include:
UI Updates in QuickFixFinder:
SearchandAnnouncewhen a search query is entered in search barRefactoring of Filter Logic:
reapplyFilters,clearFilters, etc.) and UI elements (SearchFilterButtons,FilterRow) fromSearchWorkerResult.ktinto a newSearchFilters.ktcomponent.Separation of Concerns:
QuickFixFinder.ktnow focuses on the UI layout and user flow.Benefits:
QuickFixFinder.kt.Test Plan:
QuickFixFinder.ktdisplays as intended.Screenshots: