Stats: Label build/version information clearly #37

Closed
opened 2026-06-27 15:41:15 +02:00 by bullitt · 1 comment
Owner

Problem

The Uptime StatCard shows vc4c2c44 as the version (the sub prop). This is a raw git commit hash leaking into the UI. It reads like a broken version string.

Root cause

File: frontend/src/pages/Stats.tsx line ~197:

sub={`v${health.version}`}

The health.version field from /api/health contains a git SHA or short hash, not a semver. The v prefix makes it look like a version tag when it's actually a commit reference.

Implementation

Option A — Label it as "build"

sub={`build ${health.version}`}

Option B — Backend fix

In main.py, the /api/health route should return a proper version. Check if there's a VERSION file, pyproject.toml, or env var. If available, expose it as version in the health response instead of the git hash.

In config.py, add:

APP_VERSION = os.getenv("APP_VERSION", "dev")

In main.py /api/health route, use config.APP_VERSION.

In the Docker build (CI pipeline), pass --build-arg APP_VERSION=<tag> and set ENV APP_VERSION in the Dockerfile.

If CI doesn't inject a version, fall back to "build {hash}" in the frontend.

Acceptance criteria

  • The Uptime card does not show raw vc4c2c44-style strings
  • Either shows a semver (v1.2.3), a clean build label (build c4c2c44), or dev

Brand identity alignment

Trackbox should feel technical and transparent, but raw hashes should be labeled honestly. A git SHA is useful as build provenance, not a user-facing semantic version by itself.

Brand-compliant implementation notes

  • Use build c4c2c44 for commit hashes, v1.2.3 only for actual versions, and dev for local development.
  • Keep build metadata secondary in Slate/muted text.
  • If both version and commit are available, show version first and commit as build metadata.

Additional acceptance criteria

  • The UI does not prefix arbitrary hashes with v.
  • Build provenance is still visible for self-hosters.
  • The Uptime card remains a system health signal, not a branding surface.

Migrated from GitHub issue #16: https://github.com/bullitt186/trackbox/issues/16
Original author: @bullitt186
Original created: 2026-06-27T13:24:32Z
Original labels: ux

## Problem The Uptime StatCard shows `vc4c2c44` as the version (the `sub` prop). This is a raw git commit hash leaking into the UI. It reads like a broken version string. ## Root cause File: `frontend/src/pages/Stats.tsx` line ~197: ```tsx sub={`v${health.version}`} ``` The `health.version` field from `/api/health` contains a git SHA or short hash, not a semver. The `v` prefix makes it look like a version tag when it's actually a commit reference. ## Implementation ### Option A — Label it as "build" ```tsx sub={`build ${health.version}`} ``` ### Option B — Backend fix In `main.py`, the `/api/health` route should return a proper version. Check if there's a `VERSION` file, `pyproject.toml`, or env var. If available, expose it as `version` in the health response instead of the git hash. In `config.py`, add: ```python APP_VERSION = os.getenv("APP_VERSION", "dev") ``` In `main.py` `/api/health` route, use `config.APP_VERSION`. In the Docker build (CI pipeline), pass `--build-arg APP_VERSION=<tag>` and set `ENV APP_VERSION` in the Dockerfile. ### Recommended: Option B, fallback to Option A If CI doesn't inject a version, fall back to "build {hash}" in the frontend. ## Acceptance criteria - The Uptime card does not show raw `vc4c2c44`-style strings - Either shows a semver (`v1.2.3`), a clean build label (`build c4c2c44`), or `dev` ## Brand identity alignment Trackbox should feel technical and transparent, but raw hashes should be labeled honestly. A git SHA is useful as build provenance, not a user-facing semantic version by itself. ## Brand-compliant implementation notes - Use `build c4c2c44` for commit hashes, `v1.2.3` only for actual versions, and `dev` for local development. - Keep build metadata secondary in Slate/muted text. - If both version and commit are available, show version first and commit as build metadata. ## Additional acceptance criteria - The UI does not prefix arbitrary hashes with `v`. - Build provenance is still visible for self-hosters. - The Uptime card remains a system health signal, not a branding surface. --- Migrated from GitHub issue #16: https://github.com/bullitt186/trackbox/issues/16 Original author: @bullitt186 Original created: 2026-06-27T13:24:32Z Original labels: ux
bullitt changed title from Stats: Fix version display — shows raw git hash instead of version string to Stats: Label build/version information clearly 2026-06-27 15:46:22 +02:00
Author
Owner

Implemented in commit bd6b0e7. Changed the Uptime StatCard subtitle from v${health.version} to build ${health.version}. Git SHAs are now labelled as build references rather than semantic versions, which is honest about what the value represents. Self-hosters can still read the exact commit from the UI without confusion.

Implemented in commit bd6b0e7. Changed the Uptime StatCard subtitle from ``v${health.version}`` to ``build ${health.version}``. Git SHAs are now labelled as build references rather than semantic versions, which is honest about what the value represents. Self-hosters can still read the exact commit from the UI without confusion.
Sign in to join this conversation.
No labels
arch
harness
security
ux
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
bullitt/trackbox#37
No description provided.