Add first-run onboarding guide#673
Open
bjorkert wants to merge 9 commits into
Open
Conversation
Introduce a step-based onboarding wizard shown once on launch (skippable, with a prominent Skip for already-configured users): welcome, data source choice, Nightscout/Dexcom connection, units, and a few useful alarms seeded with sensible defaults. For Nightscout, add the option to create a read-only access token from the site's API secret. The secret is used only to authorize the request and is never stored. The token is derived locally from the created subject's id and the secret, since Nightscout's subjects list is served from a cache that does not reflect a freshly created subject right away. Replace the launch-time permission prompts with deferred requests so a fresh install is not fronted with them before onboarding: - notifications are requested when alarms are set up or first added - calendar is requested from the Calendar settings screen - Bluetooth is initialised only when a BLE background refresh mode is selected Welcome screen uses the LoopFollow mark with a coin-landing animation.
Not Looping and Low Battery rely on loop and uploader data that only a Nightscout site provides, so they are meaningless for a Dexcom-only follower. Offer the device/system alarm group during onboarding only when following Nightscout (or a Nightscout URL is already configured), and don't seed them otherwise.
Polish the onboarding wording (data source, Nightscout token, Dexcom sign-in, units, alarms, and completion screens) and modernise the Dexcom field labels: "Username" instead of "User Name" and "Outside US" instead of "NON-US" (display only; stored server value is unchanged). Apply the same Dexcom label changes to the standalone Dexcom settings screen so the two stay consistent.
Member
Author
# Conflicts: # LoopFollow.xcodeproj/project.pbxproj
Collaborator
Collaborator
|
First of all, this is awesome. I played with this yesterday and I really like it. Great first draft! A few general thoughts:
A few more detailed comments about the Onboarding flow
|
Onboarding - Track progress by phase with a smooth bar and a per-phase counter - Add overview, general alarm settings, tab order, notification and telemetry steps, plus a "Copy from another phone" QR data source - Left-align text and tidy copy throughout Nightscout - Split connect into an address page and a token page shown only when needed - Add a live status pill; show "needs a token" as a positive state - Accept both array and object shapes from the subject-create response, fixing the create-token-fails-first-time case - Treat a freshly created but not-yet-accepted token as pending instead of an error so the user can continue Dexcom - Enable keychain autofill, verify credentials with a real login, and use a CGM-style icon Alarms - Offer more alarms one per page, on by default, with a few settings each - Skip alarm types the user already has and use each type's own icon Other - Defer notification, calendar and Bluetooth prompts away from launch - Add units explainer footers with correct values that follow the unit
- Unify the Nightscout and Dexcom connect screens on a shared, color-coded status pill pinned at the top. - Give every onboarding header one shared leading edge with its content by moving horizontal margins out of OnboardingStepHeader to the call sites. - Top-align the Notifications and Privacy screens to match the rest of the flow. - Split the Units phase into two lighter pages: Units and Statistics. - State a concrete setup time on the Overview screen and add a short "things to explore" tease on the completion screen. - Format the Fast drop alarm's threshold in the selected glucose unit. - Show the day/night setting on the Sensor change and Pump change alarms, defaulting to Day. - Derive the onboarding alarm control fallbacks from Alarm(type:) so they share the one source of truth for per-type defaults.
- Update recommended thresholds: Low 70 / 20 min predictive, Urgent low 54, Fast drop 15 over 3 readings (~45 in 15 minutes), Not looping 16 (aligned with Missed readings). - Add a "Readings in a row" control and a plain-language footer to the Fast drop onboarding page so its per-reading behaviour is clear. - Derive the onboarding alarm control fallbacks from Alarm(type:) so they share one source of truth with the normal per-type defaults. - Add FastDropCondition tests covering per-reading vs cumulative behaviour, window and threshold edges, and guard cases.
Bring the onboarding's token-from-secret flow to the regular Nightscout settings screen: paste a token, or paste the API secret and LoopFollow creates (or reuses) a read-only token for you. When the token field holds something that isn't a token and the site rejects it — most often a pasted API secret — a one-tap "create a token from this" action is offered. The provisioning logic, secret detection, and error mapping now live on NightscoutSettingsViewModel so onboarding and settings share one implementation.
Detect a pasted API secret by actually verifying it against the site (an auth probe on an admin-gated endpoint), rather than guessing from its shape — so the "create a read-only token from this" suggestion only appears when creating one will genuinely work. Show the suggestion on the onboarding token page as well, not just the Nightscout settings screen.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.





















Adds a friendly, step-based first-run onboarding wizard, shown once on launch and skippable (with a prominent Skip for users who are already configured).
Flow
Welcome → choose a data source → connect (Nightscout or Dexcom Share) → units & metrics → a few useful alarms → done.
Highlights
Also modernises the Dexcom field labels ("Username", "Outside US") in both onboarding and the existing Dexcom settings screen for consistency; stored values are unchanged.
A matching docs update will follow separately in the docs repo.