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

Add Tidepool navigation view (fix missing chevron) #227

Merged
merged 5 commits into from
May 23, 2024

Conversation

dsnallfot
Copy link
Contributor

@dsnallfot dsnallfot commented May 22, 2024

  • One more click to reach the service, but
  • Added chevron in settings list (for consistency)
  • Added room for information/explainations of the setting in header/footer in the new view
  • First draft to build on (maybe: rephrase header/footer, add connection status in navigation view, other relevant info etc)
  • Change TidePool to Tidepool

Demo of PR implementation:

Simulator.Screen.Recording.-.iPhone.14.-.2024-05-22.at.10.12.47.mp4

Settings navigation before change (missing chevron)
image0

- One more click to reach the service, but
- Added chevron in settings list (for consistency)
- Added room for information/explainations of the setting in header/footer in the new view
- First draft to build on (maybe: rephrase header/footer, add connection status in navigation view, other relevant info etc)
@marionbarker
Copy link
Contributor

Suggest using Tidepool (instead of TidePool) for variable, function and file names.

@dsnallfot
Copy link
Contributor Author

dsnallfot commented May 22, 2024

Suggest using Tidepool (instead of TidePool) for variable, function and file names.

Thats a relevant suggestion. However before this PR the incorrect "TidePool..." instead of "Tidepool..." was used 48 times in 8 files (excluding filenames and project.pbxproj)
This PR increased the usage to 49 times in 9 files (excluding filenames and project.pbxproj) due to the addition of TidePoolStartView file and moving existing code from SettingsRootView to TidePoolStartView.

I changed all user visible TidePool text to Tidepool in the PR.

I could change TidePool to Tidepool in all added code in the PR, but then the new code and the old code is inconsistent. Or I could of course change all 49 TidePool entries but then all those files below are impacted. Not sure what's the best move here :/

TidePool TidePool TidePool
Skärmavbild 2024-05-22 kl  13 18 04 Skärmavbild 2024-05-22 kl  13 18 39 Skärmavbild 2024-05-22 kl  13 18 56

@MikePlante1
Copy link
Contributor

We’ll have to do some tests to make sure it doesn’t affect anything, ofc, but I think we should change all the Ps to lowercase

@dsnallfot
Copy link
Contributor Author

Ok Mike. We might as well do it now rather than wait for later. Will update the PR with this later today (increased risk of merge conflicts with other ongoing PRs/issues of course since more files will be changed)

@aug0211
Copy link
Contributor

aug0211 commented May 22, 2024

Can I suggest an alternate route?

View these as two separate issues. Accept and merge this PR as is.

If I understand correctly, this PR in current form is consistent with the current state, matching the other 48 occurrences, and increases it by 1 (~2%).

We could merge this, knowing that it follows the standard in all other locations of Trio, and follow up with a separate PR to address the capitalization issue.

@marionbarker
Copy link
Contributor

Any change to a project.pbxproj is problematic. At least update the filename.

Or do the rename all at once and we commit to test, approve and merge ASAP.

Then all other PR can merge dev if needed.

@dsnallfot
Copy link
Contributor Author

dsnallfot commented May 22, 2024

Any change to a project.pbxproj is problematic. At least update the filename.

Or do the rename all at once and we commit to test, approve and merge ASAP.

Then all other PR can merge dev if needed.

project.pbxproj names also updated with lowercases now (Xcode does that automagically when filenames are changed). I have test built successfully, but it doesn't hurt that we test this thoroughly

@dsnallfot
Copy link
Contributor Author

dsnallfot commented May 22, 2024

Can I suggest an alternate route?

View these as two separate issues. Accept and merge this PR as is.

If I understand correctly, this PR in current form is consistent with the current state, matching the other 48 occurrences, and increases it by 1 (~2%).

We could merge this, knowing that it follows the standard in all other locations of Trio, and follow up with a separate PR to address the capitalization issue.

Sorry Auggie. I pushed the commit before I browser refreshed this GH issue and saw your comment so I didn't consider it before changing

@dsnallfot dsnallfot marked this pull request as ready for review May 22, 2024 15:14
@dsnallfot
Copy link
Contributor Author

@MikePlante1 I cannot add reviewers for the PR myself, could you please help me with that?

- Footer text in 2 elements
- spelling error fix
 and Connect to Tidepool from ontapgesture text ->  Action button with blue text for consistency
@dsnallfot dsnallfot requested a review from dnzxy May 22, 2024 21:36
@bjornoleh
Copy link
Contributor

When tapping the Connect to Tidepool button, I am being returned to the Tidepool settings root the first time I tap it, but the second time I am taken to the Tidepool login screen. The same happens each time I escape the Tidepool settings and try again.

I am also getting modified: Trio.xcworkspace/xcshareddata/swiftpm/Package.resolved when checking out this branch. Others seing this?

@dsnallfot
Copy link
Contributor Author

When tapping the Connect to Tidepool button, I am being returned to the Tidepool settings root the first time I tap it, but the second time I am taken to the Tidepool login screen. The same happens each time I escape the Tidepool settings and try again.

I am also getting modified: Trio.xcworkspace/xcshareddata/swiftpm/Package.resolved when checking out this branch. Others seing this?

Hm. I have not seen that error you're describing with need to double tap. Will investigate. (No code affecting this are changed in the PR)

And the other thing: I don't know exactly why this occurs, but there is an uncommitted Package.resolved change in my Xcode clone, see attached screenshot. I did not upload it to the PR since it isn't anything that should be altered in this PR. But if someone understands this better, please inform me
Skärmavbild 2024-05-22 kl  23 58 23

@dsnallfot
Copy link
Contributor Author

dsnallfot commented May 22, 2024

When tapping the Connect to Tidepool button, I am being returned to the Tidepool settings root the first time I tap it, but the second time I am taken to the Tidepool login screen. The same happens each time I escape the Tidepool settings and try again.

I am also getting modified: Trio.xcworkspace/xcshareddata/swiftpm/Package.resolved when checking out this branch. Others seing this?

Looking at the code, the thing that happens when you press the button is that ´state.setupTidepool = true´. The default state is false. Maybe you exited a previous build when the state was true? And therefor the button didn't trigger the sheet?

I cannot reproduce it. Could you try to rebuild and see if it persists?

Simulator.Screen.Recording.-.iPhone.14.-.2024-05-23.at.00.15.06.mp4

@bjornoleh
Copy link
Contributor

It happens every time on first tap and ok on there second. Not sure if I had previously set up TP on this build

@dsnallfot
Copy link
Contributor Author

It happens every time on first tap and ok on there second. Not sure if I had previously set up TP on this build

I will try to build to my physical simulator iPhone and test that way also (have just run it in Xcode sim)

@bjornoleh
Copy link
Contributor

I did build twice by the way, with a build of dev in between. Same result for the PR branch builds.

@dsnallfot
Copy link
Contributor Author

dsnallfot commented May 22, 2024

I did build twice by the way, with a build of dev in between. Same result for the PR branch builds.

Ok. I hope someone else can comment as soon as they've tested so we know if this affects all builds or if there are some special circumstances that triggers this.

edit 1: FYI: While waiting for TestFlight to finish I built on 3 different clean iPhone simulators (with no previous Trio settings). All worked as expected - no double tapping needed...

edit 2: Also tested to login on clean dev sim build. Then build pr build over. Credentials was not saved (needed to login again). but no double tapping needed.

Edit 3: Just built on real phone. I see the exact same issue that you described. Good! (Or not good). But then I know I need to investigate how the bools behave.
Will keep you posted!

- Sheet needed to be moved outside Form (Swift curiosity)
@dsnallfot
Copy link
Contributor Author

dsnallfot commented May 23, 2024

@bjornoleh. After intense googling and code debugging I found some other devs discussing this exact peculiar sheet behavior that doesn't affect simulators but shows up on physical phone builds. (I could for instance see when adding some debug logging that the sheet always got triggered 3 times in a row the first time I opened the Tidepool navigation view).

And all I had to do to resolve this bug was to move the sheet code 2 brackets down, outside the form.

Now it should work as intended again (both on simulator and physical phone). If not, let me know 😊

@bjornoleh
Copy link
Contributor

@bjornoleh. After intense googling and code debugging I found some other devs discussing this exact peculiar sheet behavior that doesn't affect simulators but shows up on physical phone builds. (I could for instance see when adding some debug logging that the sheet always got triggered 3 times in a row the first time I opened the Tidepool navigation view).

And all I had to do to resolve this bug was to move the sheet code 2 brackets down, outside the form.

Now it should work as intended again (both on simulator and physical phone). If not, let me know 😊

Thanks, well done figuring out this ridiculous issue! Works as expected now when building to a phone.

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.

LGTM! 🚀

@dnzxy
Copy link
Contributor

dnzxy commented May 23, 2024

LGTM. Great work, Daniel and wonderful discussion here. Thanks everyone.

Merging with 2 approving requests.

@dnzxy dnzxy merged commit 1c4339f into nightscout:dev May 23, 2024
1 check passed
@MikePlante1 MikePlante1 mentioned this pull request May 27, 2024
4 tasks
@dsnallfot dsnallfot deleted the dev-tidepool-nav branch June 16, 2024 12:34
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.

None yet

6 participants