Skip to content

fix: show version badge for all builds — bake pre-release sha into buildVersion#204

Open
xAlisher wants to merge 1 commit into
logos-co:masterfrom
xAlisher:fix/version-badge-empty-buildversion
Open

fix: show version badge for all builds — bake pre-release sha into buildVersion#204
xAlisher wants to merge 1 commit into
logos-co:masterfrom
xAlisher:fix/version-badge-empty-buildversion

Conversation

@xAlisher
Copy link
Copy Markdown
Contributor

@xAlisher xAlisher commented Jun 1, 2026

Fixes #203.

What was broken

PR #188 added a version badge beneath the sidebar logo, but it has been hidden in every pre-release build since the merge.

SidebarPanel.qml tested backend.buildVersion against /-rc|-alpha|-beta|-dev/i, but buildVersion is always "" on master — flake.nix only reads the VERSION file, which exists only on release/* branches. The regex was never reached.

Changes

flake.nix — fall back to pre-release-{sha7} from self.rev when no VERSION file is present. self.rev is defined on every clean CI checkout; absent on dirty local builds, which intentionally show nothing:

else if (self ? rev) then "pre-release-${builtins.substring 0 7 self.rev}" else "";

src/qml/panels/SidebarPanel.qml — replace the suffix regex with a plain non-empty check, consistent with DashboardView.qml. Until 1.0, every build (stable, RC, pre-release) benefits from being identifiable at a glance:

visible: backend.buildVersion.length > 0

Result

Build buildVersion Badge
pre-release-2576ef8-269 (master CI) pre-release-2576ef8 ✓ shown
0.1.2-RC3 (release branch) 0.1.2-RC3 ✓ shown
0.1.2 (stable release) 0.1.2 ✓ shown
dirty local dev build "" ✗ hidden

…ildVersion

Fixes logos-co#203.

`buildVersion` was always empty for master/pre-release builds because
`flake.nix` only read the VERSION file (present only on release branches).
The QML regex then never matched, so the badge added in logos-co#188 was invisible
in every pre-release AppImage published since the merge.

Two changes:

- flake.nix: when no VERSION file is present, fall back to
  "pre-release-{sha7}" from self.rev (defined on clean CI checkouts,
  absent on dirty local builds which intentionally show nothing).

- SidebarPanel.qml: replace the suffix regex with a plain non-empty
  check (same pattern already used in DashboardView.qml). Until 1.0
  every build — stable, RC, or pre-release — benefits from being
  identifiable at a glance.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Copy link
Copy Markdown

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 fixes the version badge visibility for pre-release (master/CI) builds by ensuring a non-empty build version is baked into the build when VERSION is absent, and by updating the sidebar badge visibility logic to show whenever a version string is present.

Changes:

  • flake.nix: when ./VERSION is missing, derive buildInfo.version as pre-release-{sha7} from self.rev (otherwise keep it empty).
  • src/qml/panels/SidebarPanel.qml: show the version badge whenever backend.buildVersion is non-empty (instead of matching pre-release suffixes).

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
flake.nix Adds a self.rev-based fallback version string for non-release builds so LOGOS_BASECAMP_VERSION is populated on master/CI.
src/qml/panels/SidebarPanel.qml Updates version badge visibility to a non-empty check so it renders for all builds with a baked version string.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +64 to +67
// Version badge — shown for any build whose version string is
// non-empty (pre-release CI builds, RCs, and stable releases alike).
// Keeps screenshots and bug reports self-documenting. Hidden only for
// dirty local dev builds where no version is baked in.
Comment thread flake.nix
Comment on lines +43 to +47
# VERSION is only present on release branches. On master (pre-release
# CI builds) there is no VERSION file, so fall back to a
# "pre-release-{sha7}" string derived from self.rev — available on
# every clean CI checkout. Dirty local builds lack self.rev and get
# an empty string, which hides the badge (intentional for dev).
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.

Version badge under sidebar logo (PR #188) is never shown — buildVersion is always empty on master builds

3 participants