Skip to content

Conversation

@rickpasetto
Copy link

Pete gave good PR feedback that the caller should be responsible for deciding whether to queue on .main, not the callee.
In this case, too, since the callers were already on main, but still need to queue due to timing issues, I added comments explaining why.

Pete gave good PR feedback that the caller should be responsible for deciding whether to queue on .main, not the callee.
In this case, too, since the callers were already on main, _but still need to queue due to timing issues_, I added comments explaining why.
@rickpasetto rickpasetto requested a review from ps2 September 18, 2020 19:20
Copy link

@ps2 ps2 left a comment

Choose a reason for hiding this comment

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

LGTM, though I'm a little worried the fix is being applied too wide.

// order for it to work
DispatchQueue.main.async { [weak self] in
guard let self = self else { return }
self.textField.moveCursorToEnd()
Copy link

Choose a reason for hiding this comment

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

This cell is used a lot of places in Loop, I think, and I haven't done a review to see if we really want this behavior on all of them. Some places, like dexcom code entry, the view is centered and the font is large, and the standard iOS behavior of the cursor landing where you tap is useful and easy to do, and probably expected. The places where we've had problems and really want the cursor to go to the end is in views where 1) making a too big value accidentally by prepending instead of appending is risky, 2) where the input is relatively small, and/or 3) the value is on the right hand side of the screen, making placement of the cursor on the right more difficult.

Copy link

Choose a reason for hiding this comment

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

I'm wondering if we should add this behavior under a flag, or do a review of what interfaces this affects.

Copy link
Author

Choose a reason for hiding this comment

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

IMHO consistency is better here. I humbly disagree that this behavior should vary between different text field entry UI. That would only make matters more confusing for the user.

(P.S. The Dexcom code entry screen works fine, because it always starts empty.)

Copy link

Choose a reason for hiding this comment

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

Cursor placement is an iOS idiom; we're breaking convention and already ensuring inconsistency by forcing the cursor to the right. The user is spending their time in a system where our input fields, or at least those we choose to apply this too, will be the odd duck out, and this may be a confusing situation. I think the safety concerns we have seen for certain interfaces warrant this non-standard behavior, but I'm just wondering if we want to scope the damage.

Copy link

Choose a reason for hiding this comment

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

And as for Dexcom code inputs; it's the same as other fields; it's only when editing a value that the issue arises. You may put in a code, realize it's wrong, want to edit it, but you can't do what you expect, and you end up having to delete and re-enter several valid values to fix the one you want to change.

Copy link
Author

Choose a reason for hiding this comment

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

I disagree that we're breaking iOS convention. I've used many apps that vary this behavior, from cursor-on-the-right, to cursor-on-the-left, to "select the whole text" field to edit it. While I haven't done a full assay on apps out there, I can confidently say this is true. So making statements like this is "non-standard" behavior that will cause "damage" is, I believe, overstating things a bit.

This PR is not changing anything. It is only addressing one of the architectural concerns you gave in the previous PR (#243). I recommend we merge this and continue to monitor the situation.

Re: the Dexcom code entry: I don't understand the steps you outline to reproduce. There's no "editing the value" in this case. It always starts empty.

Copy link

Choose a reason for hiding this comment

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

It's definitely a convention. I just tried several apple apps (calendar, apple health, contacts) and different fields, and they all allowed placement of cursor on the right or left, and hover to place somewhere in the middle. I also just tried the dexcom cgm manager code entry, and was able to enter a code, then place the cursor in the middle, delete one digit, and replace it.

I'm not saying that this PR needs to be changed (I did approve it), but I do want to call attention to the fact that the related changes that were landed in the previous PR are addressing the very real problem in some UIs with a broad brush that affects other UIs that we haven't had issues with, and are now causing them to behave in non-standard ways, and yes, if this causes user confusion where we didn't need to, I do think it is damage.

Copy link
Author

Choose a reason for hiding this comment

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

You can still do all of those things with the changes here (and in the prior PR). All I changed is the initial cursor placement. Maybe I don't understand your concern fully.

@rickpasetto rickpasetto merged commit 692fe1c into dev Sep 21, 2020
@rickpasetto rickpasetto deleted the rick/LOOP-1916-bolus-carb-entry-cursor-2 branch September 21, 2020 21:19
@rickpasetto
Copy link
Author

rickpasetto commented Sep 21, 2020 via email

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