Skip to content

feat: display latest dev version in settings for non-main builds#582

Merged
dnzxy merged 5 commits intonightscout:devfrom
Sjoerd-Bo3:feature/dev-version-display
Aug 11, 2025
Merged

feat: display latest dev version in settings for non-main builds#582
dnzxy merged 5 commits intonightscout:devfrom
Sjoerd-Bo3:feature/dev-version-display

Conversation

@Sjoerd-Bo3
Copy link
Contributor

@Sjoerd-Bo3 Sjoerd-Bo3 commented May 25, 2025

Summary

  • Displays the latest development version number in Settings for non-main builds
  • Shows comparison between current and latest available dev version
  • Helps developers and testers identify when updates are available

Description

This enhancement improves version tracking for development builds by fetching and displaying the latest available dev version from GitHub. The feature:

  • Only activates for non-main branches (dev, alpha builds)
  • Shows clear version comparison in Settings
  • Helps users know if they're running the latest development version
  • Maintains clean UI with conditional display logic

Implementation Details

  1. Version Checking: Extended AppVersionChecker to fetch latest dev releases
  2. Conditional Display: Only shows for non-main builds to avoid confusion
  3. UI Integration: Clean presentation below current version in Settings
  4. Async Loading: Non-blocking fetch that doesn't impact app startup

Test plan

  • Build and run from dev branch
  • Navigate to Settings and verify current version displays
  • Confirm latest dev version appears below (if different)
  • Test with no network connection - should handle gracefully
  • Build from main branch and verify dev version does NOT appear
  • Test version comparison logic with various version number formats

Screenshots

Dev Build Main Build
image image
Shows both current and latest dev Only shows current version

Add display of latest dev version (x.x.x.x format) in Settings for all non-main branch builds.
Shows version with visual indicators for update status. Uses same
caching and comparison logic as main version checking.

- Only visible when not on main branch builds
- Orange color with arrow icon when newer version available
- Secondary color with hammer icon when on latest version
- 24-hour cache to minimize API calls
- Properly parses APP_DEV_VERSION for x.x.x.x format
- Added localization entries for new strings
@Sjoerd-Bo3 Sjoerd-Bo3 changed the title feat: Display latest dev version in Settings for non-main builds Display latest dev version in Settings for non-main builds May 25, 2025
@Sjoerd-Bo3 Sjoerd-Bo3 linked an issue May 25, 2025 that may be closed by this pull request
@marionbarker
Copy link
Contributor

Review and Test

I plan to approve this from review and test.

Formatting Comment

I noticed when reviewing that the comments in this PR use

/**
comment
*/

Most files in Trio use // on each line that is a comment. That format is my personal preference because when searching for content, it is immediately obvious if a line is code or comment.

I assume there is a preferred style for Trio.

  • If this is an accepted format, then no worries.
  • If the version of comments is desired to be consistent, then the list of "different" files is provided at the end of this comment; and would be the subject of a separate PR.

This command

find Trio/Sources -name "*.swift" -exec grep '//' {} \; | wc  

indicates // is used for 5040 lines, whereas /** is used 30 times.

These are the Trio/Sources files that contain instances of /**.

Trio/Sources/APS/Storage/CarbsStorage.swift
Trio/Sources/Shortcuts/Override/OverridePresetsIntentRequest.swift
Trio/Sources/Modules/Home/View/Chart/ChartElements/GlucoseTargetsView.swift
Trio/Sources/Modules/Home/HomeStateModel+Setup/GlucoseTargetSetup.swift
Trio/Sources/Views/TagCloudView.swift
Trio/Sources/Services/Network/Nightscout/NightscoutManager.swift
Trio/Sources/Services/Storage/Keychain/KeychainItemAccessibility.swift
Trio/Sources/Services/Storage/Disk/Disk.swift
Trio/Sources/Services/AppVersionChecker/AppVersionChecker.swift

Copy link
Contributor

@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.

Reviewed and tested. Left comment questioning comment format.

- Replaced all /// single-line documentation comments with //
- Converted multi-line /** */ comments to // style
- Maintains consistency with Trio's predominant comment style
- Addresses PR nightscout#582 review feedback about comment formatting
@Sjoerd-Bo3
Copy link
Contributor Author

Review and Test

I plan to approve this from review and test.

Formatting Comment

I noticed when reviewing that the comments in this PR use

/** comment */

Most files in Trio use // on each line that is a comment. That format is my personal preference because when searching for content, it is immediately obvious if a line is code or comment.

I assume there is a preferred style for Trio.

  • If this is an accepted format, then no worries.
  • If the version of comments is desired to be consistent, then the list of "different" files is provided at the end of this comment; and would be the subject of a separate PR.

This command

find Trio/Sources -name "*.swift" -exec grep '//' {} \; | wc  

indicates // is used for 5040 lines, whereas /** is used 30 times.

These are the Trio/Sources files that contain instances of /**.

Trio/Sources/APS/Storage/CarbsStorage.swift
Trio/Sources/Shortcuts/Override/OverridePresetsIntentRequest.swift
Trio/Sources/Modules/Home/View/Chart/ChartElements/GlucoseTargetsView.swift
Trio/Sources/Modules/Home/HomeStateModel+Setup/GlucoseTargetSetup.swift
Trio/Sources/Views/TagCloudView.swift
Trio/Sources/Services/Network/Nightscout/NightscoutManager.swift
Trio/Sources/Services/Storage/Keychain/KeychainItemAccessibility.swift
Trio/Sources/Services/Storage/Disk/Disk.swift
Trio/Sources/Services/AppVersionChecker/AppVersionChecker.swift

@marionbarker Fixed

@Sjoerd-Bo3 Sjoerd-Bo3 self-assigned this May 25, 2025
@Sjoerd-Bo3 Sjoerd-Bo3 requested a review from marionbarker May 25, 2025 23:40
Copy link
Contributor

@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.

Test again after commit 71a278b.
Works as expected for branches named main and pr582 (with and without a modification to the APP_DEV_VERSION).

Copy link

@kingst kingst left a comment

Choose a reason for hiding this comment

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

I left a few questions / comments / suggestions. I'm not that familiar with this module but hopefully my feedback is useful.

@dnzxy
Copy link
Contributor

dnzxy commented Jun 4, 2025

What is the status here wrt. to Sam's comments on his review? @kingst @Sjoerd-Bo3

@dnzxy
Copy link
Contributor

dnzxy commented Jun 9, 2025

We'd like to move to 0.5.1 this week. What's the status here @Sjoerd-Bo3 ?
Please also fix merge conflicts and sync your feature branch with latest dev. Thanks :)

@Sjoerd-Bo3
Copy link
Contributor Author

We'd like to move to 0.5.1 this week. What's the status here @Sjoerd-Bo3 ? Please also fix merge conflicts and sync your feature branch with latest dev. Thanks :)

I have the changes locally. Will push when home.

@dnzxy
Copy link
Contributor

dnzxy commented Jun 17, 2025

Hi, what's the status here?

@dnzxy dnzxy marked this pull request as draft June 23, 2025 21:00
Signed-off-by: Sjoerd Bozon <sjoerd.bozon@gmail.com>
- Convert refreshVersionInfo to async/await with completion handler wrapper
- Convert private checkForNewVersion to async/await with completion handler wrapper
- Convert fetchDataAndUpdateCache to async/await with parallel data fetching
- Convert checkAndNotifyVersionStatus to use async/await with @mainactor
- Update SettingsRootView to use async methods with Task blocks
- Simplify parseVersionFromConfig condition by checking for "DEV" instead of "APP_DEV_VERSION"
- Add async version of fetchData method
- Convert checkForNewDevVersion to async/await with completion handler wrapper
- Convert fetchDevVersionAndUpdateCache to async/await
@Sjoerd-Bo3
Copy link
Contributor Author

Addressed Comments from @kingst, ready for review and merge

@Sjoerd-Bo3 Sjoerd-Bo3 marked this pull request as ready for review July 5, 2025 15:41
@Sjoerd-Bo3 Sjoerd-Bo3 requested a review from marv-out as a code owner July 5, 2025 15:42
@Sjoerd-Bo3 Sjoerd-Bo3 changed the title Display latest dev version in Settings for non-main builds feat: display latest dev version in settings for non-main builds Jul 6, 2025
Copy link
Contributor

@MikePlante1 MikePlante1 left a comment

Choose a reason for hiding this comment

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

Approval based on testing, not code review:

installed branch name APP_VERSION APP_DEV_VERSION latest version (0.2.7) latest dev (0.5.1.4) new version alert
main 0.2.6 0.2.6 orange yes
main 0.2.7 0.2.7 green no
dev 0.2.7 0.2.7 green orange no
test 0.2.6 0.2.6 orange orange yes
test 0.2.7 0.2.7 green orange no
test 0.5.1 0.5.1.3 green orange no
test 0.5.1 0.5.1.4 green gray no

@Sjoerd-Bo3 Sjoerd-Bo3 requested a review from kingst July 7, 2025 08:19
@dnzxy dnzxy merged commit 322ed50 into nightscout:dev Aug 11, 2025
3 checks passed
kingst pushed a commit that referenced this pull request Dec 25, 2025
…al-temp

Implement low glucose suspend and skip neutral temp dosing logic
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.

Display dev version in Settings for non-main builds

5 participants