Skip to content

Conversation

@bjorkert
Copy link
Contributor

@bjorkert bjorkert commented Jul 8, 2025

Problem

When users select and delete the Nightscout URL, they have to navigate back to settings and return to the NS URL view before the password autofill feature works again for the token field.

Solution

  • Added textContentType parameter to TogglableSecureInput component
  • Set textContentType: .password for the Nightscout token field
  • This properly identifies the field to iOS's autofill system, maintaining consistent behavior even after URL changes

Changes

  • Modified TogglableSecureInput.swift to accept optional textContentType parameter
  • Updated NightscoutSettingsView.swift to specify .password content type for token field
  • Applied content type to both secure and visible states of the input

Testing

  • Verified that password autofill now works consistently after URL deletion
  • Confirmed no regression in existing functionality

@bjorkert bjorkert requested a review from marionbarker July 8, 2025 09:49
@marionbarker
Copy link
Collaborator

I did more testing and came up with a new procedure.

  • I can use the same procedure with both versions.
  • This is using an actual test phone (SE 3rd gen running iOS 18.5).
  • Clearing just the URL is not sufficient to trigger the password tool with either build - must always touch the Token line too
  • By tapping on the token line, and hitting delete, the token clears without needing to select all (so this is faster) and there is no need to clear the URL line

I leave it up to @bjorkert to decide if we should make this change.

When NS URL/Token is filled in, the actions below work to bring up the password tool (PW Icon shows on screen) without returning to the Settings screen and then returning to the NS Settings screen

  • Note - cursor must be on URL line to update both URL and token

With version 3.0.0:

  • Touch PW - clear token, Touch URL (no need to clear it) and use PW tool - works

With the version in this PR:

  • Touch PW - clear token, Touch URL (no need to clear it) and use PW tool - works

Copy link
Collaborator

@marionbarker marionbarker left a comment

Choose a reason for hiding this comment

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

approved from code review and test if @bjorkert thinks this modification is a good idea.

@marionbarker
Copy link
Collaborator

After applying the modification suggested by @bjorkert, commit aa9252e, this PR is a definite improvement.

Once the password icon is triggered to show up, the cursor can be on either the URL line or the token line and both URL and token are updated from the selection of a saved password.

Note - the saved passwords have the NS URL as the username and the token as the password. I have a series of these passwords I use to test all the types of URLs (Trio, Loop, Loop with no treatments) when testing LoopFollow updates.

@marionbarker marionbarker merged commit 832ef10 into dev Jul 8, 2025
@marionbarker marionbarker deleted the nightscout-token-autofill branch July 8, 2025 22:52
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