Skip to content

fix: Accidentally tapping on suffix of a field does not focus input #712

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

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

Conversation

aidanlane
Copy link

@aidanlane aidanlane commented Jul 8, 2025

Summary

Fixes the "Accidentally tapping on suffix of a field does not focus input" from issue #660.

Solution

  • Extended TextFieldWithToolBar to add optional suffixText (with optional suffixForegroundColor). When this suffixText is tapped, then focus will be sent to the text field.

Test plan

  • Build successfully without compilation errors
  • Unit tests run successfully
  • Verify (1) that tap gestures send focus to text field, (2) input values are persisted, and (3) live changes work:
    • Calibrations -> Meter glucose - dead code?
    • CarbEntryEditorView -> Carbs
    • CarbEntryEditorView -> Protein
    • CarbEntryEditorView -> Fat
    • DataTable -> New Glucose
    • ManualTempBasal -> Amount - unsure how to test
    • Treatments -> Carbs
    • Treatments -> Protein
    • Treatments -> Fat
    • Treatments -> Bolus
    • AddMealPresetView -> Carbs
    • AddMealPresetView -> Protein
    • AddMealPresetView -> Fat
  • Multi day use in-vivo

Note

This PR addresses the "Accidentally tapping on suffix of a field does not focus input" from issue #660.

Accidentally tapping on suffix of a field focus not focus input nightscout#660
@aidanlane aidanlane changed the title fix: Accidentally tapping on suffix of a field focus not focus input fix: Accidentally tapping on suffix of a field does not focus input Jul 8, 2025
@aidanlane aidanlane marked this pull request as ready for review July 8, 2025 11:36
Copy link
Contributor

@bjornoleh bjornoleh left a comment

Choose a reason for hiding this comment

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

Approved based on testing. I could test the same items that you had checked, but not libre calibration or manual temp basal.

No code review on my my part.

1. suffix -> units
2. make color field consistent with textColor in name and optionality
@aidanlane
Copy link
Author

Is there anyone who would be able to tell me how to test the input fields for libre calibration or manual temp basal please?

Otherwise, would someone be able to test for it for me, as I only have G7 and Omnipods.

Thanks!

@bjornoleh
Copy link
Contributor

I think perhaps we don’t use the input field for manual temp basal any longer? In Trio 0.2, this could be set when in open loop, a dedicated button appeared on the bottom of the screen then. If so, the manual temp basal code should probably be removed (not necessarily in this PR).

Regarding Libre, there used to be a Libre simulator one could choose when setting up Libre as CGM. I think perhaps this has been hidden behind a feature flag now?

@aidanlane
Copy link
Author

Thanks @bjornoleh

It indeed looks like manual temp basal is dead code. I was able to remove the files and then there were only a few dead code looking references left that were quick to remove. After that it complied and ran fine. That said, I would suggest another PR and test plan for that, just to keep things clean, test surface minimal, and changes traceable.

I’ll have to dig deeper for the libre simulator.

@aidanlane
Copy link
Author

Regarding Libre, there used to be a Libre simulator one could choose when setting up Libre as CGM. I think perhaps this has been hidden behind a feature flag now?

Do you know @kingst? (picking on you as you made the last commit to https://github.com/LoopKit/LibreTransmitter 😉)

@bjornoleh
Copy link
Contributor

There’s some info about hidden simulators behind a debug flag here, but this is actually still a draft PR, so this isn’t merged.
#573 (comment)

@aidanlane
Copy link
Author

Oh, that just appears to allow disabling of the main simulators, not the ability to enable the Libre Demo one.

@dnzxy
Copy link
Contributor

dnzxy commented Jul 29, 2025

Status here?

@aidanlane
Copy link
Author

Code complete, working well in the wild.

Unable to perform two exploratory tests from the test plan. Need decision of the importance of them and if needed help with testing them.

@dnzxy
Copy link
Contributor

dnzxy commented Jul 29, 2025

Calibrations view can be tested by hard-coding the CGM to be of type Libre afaik.
The manual temp basal input is no longer in existence. There used to be a dialog / popover that could be opened from home view's navigation. You can still check that out if you build 0.2.x and do not close the loop IIRC.

@aidanlane
Copy link
Author

Thanks @dnzxy.

I had a lot of trouble getting the Libre simulator to work. Are you able to at all?

Manual. I assume there’s no point in testing that for 0.5.1 then?

@aidanlane
Copy link
Author

@marionbarker, do you know how I could test the libre calibrations?

@bjornoleh bjornoleh self-requested a review August 3, 2025 06:09
Copy link
Contributor

@bjornoleh bjornoleh left a comment

Choose a reason for hiding this comment

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

I'd say that testing the input field for Libre calibration isn’t really needed. Seems like a low risk, zero consequence thing to merge this as is.

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