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

Switch from ionChange to ionInput for Real-Time Filtering in Search Bar #2963

Merged
merged 1 commit into from
Jan 13, 2025

Conversation

Sn0w3y
Copy link
Contributor

@Sn0w3y Sn0w3y commented Jan 13, 2025

This PR updates the <ion-searchbar> event from (ionChange) to (ionInput). By listening to each keystroke, the filter is applied in real-time as the user types. This delivers immediate feedback on search queries, which can enhance the overall user experience for quick lookups or rapidly changing query inputs.

Why This Makes More Sense

  1. Real-Time Results: Users see the updated list as they type, making searches feel more interactive and giving them instant feedback.
  2. Improved UX for Quick Searches: When dealing with smaller data sets or faster filter operations, immediate updates can be more intuitive than having to confirm or leave the input field first.
  3. Common Pattern in Live Searches: Many search experiences provide real-time suggestions or filtering, aligning with modern UX expectations.

Changes

  • Replaced (ionChange)="updateFilter($event.detail.value)" with (ionInput)="updateFilter($event.detail.value)" in the <ion-searchbar>.
  • Kept existing styling and filter logic intact.

Please review and let me know if there are any additional improvements or considerations needed!

Copy link

codecov bot commented Jan 13, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Additional details and impacted files
@@              Coverage Diff              @@
##             develop    #2963      +/-   ##
=============================================
- Coverage      57.08%   57.07%   -0.01%     
+ Complexity      9729     9725       -4     
=============================================
  Files           2266     2266              
  Lines          96819    96819              
  Branches        7163     7163              
=============================================
- Hits           55260    55250      -10     
- Misses         39498    39507       +9     
- Partials        2061     2062       +1     

@sfeilmeier sfeilmeier merged commit 5828abb into OpenEMS:develop Jan 13, 2025
6 of 7 checks passed
@Sn0w3y Sn0w3y deleted the patch-11 branch January 13, 2025 17:43
@lukasrgr
Copy link
Contributor

@Sn0w3y if you got time, theres still an issue with overloads of the jsonrpc responses for getEdges,

In terms of developing mobile first, the onEnter key event makes completely sense with everybody pressing enter or search on their keyboard, on desktop this might be not to obvious.

The overloads for the jsonrpc requests would be definitely solved with the onEnter event.

Are there use cases where you want to filter for multiple ems`s at once and is there a need to see the results per character typed?

@Sn0w3y
Copy link
Contributor Author

Sn0w3y commented Jan 14, 2025

@Sn0w3y if you got time, theres still an issue with overloads of the jsonrpc responses for getEdges,

In terms of developing mobile first, the onEnter key event makes completely sense with everybody pressing enter or search on their keyboard, on desktop this might be not to obvious.

The overloads for the jsonrpc requests would be definitely solved with the onEnter event.

Are there use cases where you want to filter for multiple ems`s at once and is there a need to see the results per character typed?

Hi @lukasrgr,

Thanks for your valuable feedback!

What about implementing device-specific search behavior by determining the device type using Capacitor's getPlatform() method, similar to how we handle it in login.component.ts? This would allow us to use ionInput for real-time filtering on mobile devices (maybe also with a debouce) and the Enter key for desktop users, effectively addressing the JSON-RPC overload concerns.

Let me know if this approach works for you or if you have any other suggestions!

Best regards

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.

3 participants