-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Filtering treatments #818
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
Filtering treatments #818
Conversation
Sync Trio:dev public with Trio-dev:dev
…trio Sync trio dev from trio
…07-13 Sync trio dev 2025-07-13
…07-23 Sync trio dev 2025 07 23
…08-07 Sync trio dev 2025 08 07
Sync PR from Trio's `dev` branch
|
Thanks mate! For uploading |
|
This LGTM. @marv-out would you like to address the comment about de-selecting entries when double tapping Select All or keep it as is? |
|
Yep, I can implement this later today. It does make sense |
|
updated the functionality, but I noticed a plist change when building with xcode 26 again. I haven't committed that now, not sure if thats correct or not... |
I think the best way is to just build with Xcode 16.4 and then commit before pushing, even if you do the actual coding in Xcode 26 If you don’t do that, though, do what you did and don’t include that change in the commit. |
|
Ok, then it should be good to go. I don't have Xcode 16.4 anymore... |
|
I build it via Xcode 16.4 and the only fix-it is re-inserting a stale l18n that your PR removed. I can push that soon. Works great on my in-vivo iPhone 14 Pro Max (iOS 26.1 (23B5073a)). Love it! Works great on an iPhone 17 Simulator (iOS 26.0) Screen.Recording.2025-10-24.at.11.42.14.movSeems to often hide the menu in an iPhone 15 Simulator with iOS 17.5, though. Screen.Recording.2025-10-24.at.11.35.18.mov |
MikePlante1
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.
Tested it on an iPhone SE (2nd gen) Simulator with iOS 18.5, and it works just as great is it does with iOS 26.
So I'm just going to approve this PR as-is. At worst, iOS 17 users will just have to tap to open the filter button a few more times, but also anyone running iOS 17 should have already updated to iOS 18 a while ago as all phones that support iOS 17 also support iOS 18.
|
It just occurred to me that since the UI looks the same whether treatments are filtered or showing all, it could lead to somebody applying a filter but then not remembering the next time the open History and presuming they're seeing everything when they aren't. Not sure the best way to present that info in the UI, though. |
Yeah when a filter is active some indication should be shown in the list indeed. Good catch! |
|
Basing this on Mike's recording. I'd suggest if there are no entries to display an empty row with something like "No entries" or "No Data" or some similar text. I agree with the notion of active filters and would suggest to display this with an inverted filter icon (so the current chosen icon becomes inverted, to a Rest looks and feels wonderful. |
|
I am heading to vacation right now without a mac, so I am not really able to edit sth for the next week. Maybe somebody else could add the icon so that it can be merged |
I'll take a stab at it. Have a great vacation! |
|
How's this? Screen.Recording.2025-10-25.at.09.42.39.mov |
Changed filter button to show filled icon and count when not all treatment types are selected. Updated event display logic for No Data to use filteredPumpEvents instead of pumpEventStored.
|
I like it :) |
|
I agree, looks clear and great like this. |
Introduced a TreatmentType enum to replace hardcoded treatment type strings in DataTableRootView. Updated filter logic and UI to use the enum, improving maintainability and reducing duplication.
|
Nice addition, I think its good to go |
Sjoerd-Bo3
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.
LGTM, good to go!
Love this feature, @marv-out! Great job!! 👏🎉😁 |
Merge pull request nightscout#818 from marv-out/filtering-treatments
Merge pull request nightscout#818 from marv-out/filtering-treatments

Add treatment-type filtering with custom popover in Treatment Root View
Summary
This PR introduces filtering for treatment types in the Treatment Root View.
A custom popover lets users select or deselect which treatment types to display.
The implementation is intentionally simple in both code and UI.
Details
Notes / Caveats
I wrote the initial version a while back and haven’t thoroughly re-tested it since.
There may be edge cases I’m not remembering.
The main area I considered improving was the UI polish; after a quick look today it still seems acceptable, but I’m open to suggestions.
Testing Requested
Suggestions and feedback are very welcome.