Skip to content

Conversation

@graycreate
Copy link
Member

Show only version name (e.g., 2.3.13) without version code

Copilot AI review requested due to automatic review settings December 27, 2025 04:43
@graycreate graycreate merged commit cee8d1b into main Dec 27, 2025
@graycreate graycreate deleted the fix/simplify-version-display branch December 27, 2025 04:43
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR attempts to simplify the version display in the Settings screen by removing the version code from the display format. However, the implementation does not achieve this goal due to the underlying implementation of Utils.getVersionName().

Key Issue:

  • The Utils.getVersionName() method already appends the version code to the version name (as versionName + "." + versionCode), so removing the explicit version code display in parentheses does not actually remove it from the UI—it just changes the format from "2.3.13 (56)" to "2.3.13.56"

Comment on lines +103 to 105
versionPref.setSummary(Utils.getVersionName());
}

Copy link

Copilot AI Dec 27, 2025

Choose a reason for hiding this comment

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

The change does not achieve the stated goal of showing only the version name. Looking at the implementation of Utils.getVersionName() (line 347 in Utils.java), it returns packageInfo.versionName + "." + packageInfo.versionCode, which means the version code is still included in the display. The version code was previously shown in parentheses (e.g., "2.3.13 (56)"), and now it will be shown as a dot-separated suffix (e.g., "2.3.13.56"). To truly show only the version name without the version code, the Utils.getVersionName() method needs to be modified to return only packageInfo.versionName, or a separate method should be used here.

Suggested change
versionPref.setSummary(Utils.getVersionName());
}
versionPref.setSummary(getAppVersionNameOnly());
}
/**
* Returns only the version name portion, stripping any appended version code
* that may be added by {@link Utils#getVersionName()} (e.g. "2.3.13.56" -> "2.3.13").
*/
private String getAppVersionNameOnly() {
String fullVersion = Utils.getVersionName();
if (fullVersion == null || fullVersion.isEmpty()) {
return fullVersion;
}
int lastDot = fullVersion.lastIndexOf('.');
if (lastDot > 0) {
return fullVersion.substring(0, lastDot);
}
return fullVersion;
}

Copilot uses AI. Check for mistakes.
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.

2 participants