Skip to content
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

PAINTROID-490: Search bar on Landing Page #105

Open
wants to merge 9 commits into
base: develop
Choose a base branch
from

Conversation

chetanr25
Copy link

@chetanr25 chetanr25 commented Dec 31, 2024

Ticket

JIRA Ticket - PAINTROID-490
Flutter: Search bar on Landing Page

This PR introduces a search functionality to the LandingPage that allows users to search for projects by name. The search feature includes a search toggle button and a search text field. When the search button is pressed, it hides the ProjectPreview and focuses on just the list of projects. The FloatingActionButton also hides as we go into search mode.

New Features and Enhancements

Added search bar functionality to search projects by name

Changes

  1. Added SearchToggleButton Component:

    • Created a new SearchToggleButton component that toggles between a search icon and a close icon based on the search state.
    • The button triggers the start and end of the search functionality.
  2. Added SearchTextField Component:

    • Created a new SearchTextField component that provides a text input field for users to enter their search queries.
    • The text field updates the search query state and filters the project list accordingly.
  3. Updated LandingPage to Integrate Search Functionality:

    • Added search functionality in the LandingPage component.
    • Integrated the SearchToggleButton and SearchTextField components into the AppBar's title of the LandingPage.
    • Implemented logic to filter the project list based on the search query.
    • Modified the LandingPage to hide ProjectPreview and FloatingActionButton when in search mode.

Refactorings and Bug Fixes

  • Fixed Bug with Project List Display:
    • Resolved an issue where only n-1 projects were displayed when n projects were saved.
      Removed unnecessary index != 0 condition to ensure all saved projects are visible.
catrobat.mov

Checklist

Your checklist for this pull request

Please review the contributing guidelines and wiki pages of this repository.

  • Include the name of the Jira ticket in the PR’s title
  • Add the link to the ticket in Jira in the description of the PR
  • Include a summary of the changes plus the relevant context
  • Choose the proper base branch (develop)
  • Confirm that the changes follow the project’s coding guidelines (Wiki)
  • Verify that the changes generate no compiler or linter warnings
  • Perform a self-review of the changes
  • Verify to commit no other files than the intentionally changed ones
  • Include reasonable and readable tests verifying the added or changed behavior
  • Confirm that new and existing tests pass locally
  • Check that the commits’ message style matches the project’s guideline
  • Verify that your changes do not have any conflicts with the base branch
  • After the PR, verify that all CI checks have passed
  • Add new information to the Wiki

@chetanr25 chetanr25 changed the title Add Search Functionality and Fix Project List Display Bug PAINTROID-490: Search bar on Landing Page Dec 31, 2024
@chetanr25 chetanr25 mentioned this pull request Jan 19, 2025
14 tasks
Copy link
Contributor

@Lenkomotive Lenkomotive left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey! Good work!

Functionality wise it looks really good, nice job!

Some points:

  • The landing page uses setState for state management, which was likely the initial implementation approach. Since we now use Riverpod throughout the app, refactoring the landing page to use Riverpod would improve consistency and could be a fun challenge.
  • We are striving to work with TDD (Test-Driven Development) as much as possible. I understand that it’s not always easy to strictly adhere to TDD. In cases where it is not feasible, please make sure to add new widget tests or integration tests afterward, especially for new implementations.

If you got any questions feel free to tag me or other contributors! Cheers 🌞

@chetanr25
Copy link
Author

Thank you for the feedback!

I wanted to ensure the feature in this PR meets expectations before proceeding further with adding tests.
I’ll refactor the landing page to use Riverpod for consistency and will also work on adding the necessary tests. I’ll send a follow-up PR soon.

Appreciate your guidance!

@chetanr25
Copy link
Author

I have merged PR #107 to the current PR

@chetanr25
Copy link
Author

  • Migrated landing page state management from setState to Riverpod providers
  • Created search_filter_sort_provider.dart file in lib/core/providers/object folder
  • Optimized loading experience by conditionally showing progress indicator
  • Removed redundant setState calls and local state variables

I am working on writing test files

@chetanr25 chetanr25 requested a review from Lenkomotive January 31, 2025 12:15
@chetanr25
Copy link
Author

chetanr25 commented Jan 31, 2025

Added comprehensive test coverage for:

  • Search bar visibility and toggle behavior
  • Project filtering based on search queries
  • Sort options menu display and selection
  • FAB visibility during search mode

All tests are passing. Please let me know if any changes are needed!
PR for ticket JIRA Ticket - PAINTROID-490 is ready for review

@chetanr25 chetanr25 closed this Jan 31, 2025
@chetanr25 chetanr25 reopened this Jan 31, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants