Skip to content

fix(ui): show the LevelCode release version in the update tooltip and About - #24

Merged
ndemianc merged 2 commits into
developfrom
fix/levelcode-version-in-update-ui
Jul 20, 2026
Merged

fix(ui): show the LevelCode release version in the update tooltip and About#24
ndemianc merged 2 commits into
developfrom
fix/levelcode-version-in-update-ui

Conversation

@ndemianc

Copy link
Copy Markdown
Contributor

The bug

After the first real auto-update, the tooltip read:

Current Version: 1.126.0 (cdf2549)
Released 22 Jun 2026

A Code-OSS version next to a LevelCode commit, dated from the upstream base's build rather than the release actually installed.

The commit is correct and deliberatebuild-macos.sh stamps LevelCode's HEAD so releases stay distinguishable to the update feed. Only the version and date were still Code-OSS's.

Why version can't just be renamed

product.json version is what extensions' engines.vscode is validated against. Setting it to 0.8.0 would reject every extension requiring ^1.x. So the release identity rides alongside it:

field value who reads it
version 1.126.0 engines.vscode compatibility
levelcodeVersion 0.8.0 humans (update UI, About)
levelcodeReleaseDate build commit's date humans
  • scripts/stamp-levelcode-version.mjs (new) stamps both into the built app's product.json. It refuses anything that isn't a plain dotted version (exit 1), so a bad git describe fails the build rather than shipping Current Version: v0.8.
  • build-macos.sh runs it tag-derived, after the existing strip steps. No reachable tag (dev builds) → skipped, UI falls back to version.
  • Tooltip shows levelcodeVersion ?? version. About shows both (0.8.0 — Code-OSS 1.126.0) — it gets pasted into bug reports, where the base version explains extension-compat behaviour.

Latest Version: already used the feed's productVersion and needed no change.

Patch-workflow hazard worth knowing about

vscode/ is gitignored, so these three core edits live in patches/levelcode-core.patch (11 → 14 entries).

Regenerating wholesale is not safe from a built checkout. CORE-PATCHES.md NOTE 2 warns that regenerating after de-brand leaks its link-stripping in — and it does: a full regen pulled ~95 lines of [Hot Exit](https://aka.ms/…)Hot Exit rewrites into the files.contribution.ts entry. Those belong in de-brand.mjs.

So the existing 11 entries are preserved byte-identical and only the 3 new ones appended. NOTE 3 now documents that escape hatch.

Verification

  • npm run typecheck-client → exit 0.
  • Stamp script: leaves version untouched, strips a v prefix, normalises the date, exits 1 on a bad version, warns-but-continues on a bad date.
  • Patch: 14 entries, git apply --check --reverse exit 0, appended entries contain no aka.ms strips, 6 [LevelCode] markers.
  • Pre-existing entries confirmed byte-identical to the known-good patch.

Not verified — needs a build. The rendered strings. Before the next release:

./scripts/build-macos.sh arm64     # expect: [build] Stamping the LevelCode release version (v0.8.1) …

then launch and confirm the tooltip reads Current Version: 0.8.1 (<sha>) and About shows 0.8.1 — Code-OSS 1.126.0.

🤖 Generated with Claude Code

… About

The update tooltip read "Current Version: 1.126.0 (cdf2549)" — a Code-OSS
version next to a LevelCode commit — and "Released 22 Jun 2026", the upstream
base's build date rather than the release the user installed. Reported after the
first real auto-update, where it reads as a different product entirely.

The commit was already right on purpose (build-macos.sh stamps LevelCode's HEAD
so releases are distinguishable to the update feed). Only the version and date
were still Code-OSS's, and `version` cannot simply be renamed: it is what
extensions' `engines.vscode` is validated against, so setting it to 0.8.0 would
reject every extension requiring ^1.x.

So the release identity rides alongside it:

- scripts/stamp-levelcode-version.mjs (new) stamps `levelcodeVersion` +
  `levelcodeReleaseDate` into the BUILT app's product.json. Refuses anything that
  isn't a plain dotted version (exit 1), so a bad `git describe` fails the build
  rather than shipping "Current Version: v0.8".
- build-macos.sh runs it tag-derived, after the existing strip steps. No
  reachable tag (dev builds) → skipped, and the UI falls back to `version`.
- The tooltip shows `levelcodeVersion ?? version`. About shows BOTH
  ("0.8.0 — Code-OSS 1.126.0") since it gets pasted into bug reports, where the
  base version explains extension-compatibility behaviour.

Patch-workflow note: vscode/ is gitignored, so the three core edits are captured
in patches/levelcode-core.patch (11 -> 14 entries). Regenerating wholesale is
NOT safe here — the checkout is already de-branded, and a full regen pulled ~95
lines of de-brand's MS-doc-link stripping into the files.contribution.ts entry.
The existing entries are preserved byte-identical and only the three new ones
appended. CORE-PATCHES.md gains that escape hatch as NOTE 3, plus rows 12-14.

Verified: typecheck-client passes (exit 0); the stamp script leaves `version`
untouched, strips a v prefix, and exits 1 on a bad version; the 14-entry patch
reverse-applies cleanly to the checkout; the appended entries carry no de-brand
contamination and 6 [LevelCode] markers.

NOT verified: the rendered strings. That needs a full gulp build and a launched
app — see the PR for the check to run before the next release.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings July 20, 2026 04:57

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

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 release identity shown to users by stamping a human-facing LevelCode release version/date into the built app’s product.json, then teaching the update tooltip and native About dialog (via core patch) to prefer those fields over the Code-OSS base version/date.

Changes:

  • Add scripts/stamp-levelcode-version.mjs to write levelcodeVersion and levelcodeReleaseDate into the built app’s product.json.
  • Update scripts/build-macos.sh to run the stamp step for tagged builds (and skip with a warning for dev builds).
  • Extend core product typing and UI surfaces (via patches/levelcode-core.patch) to display LevelCode release version/date in the update tooltip and About dialog; document the new patch entries in docs/CORE-PATCHES.md.

Reviewed changes

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

File Description
scripts/stamp-levelcode-version.mjs New build-time stamp script to add human-facing LevelCode release fields to built product.json.
scripts/build-macos.sh Invokes the stamp script for tagged builds so the packaged app reports the correct release identity.
patches/levelcode-core.patch Core patch adds optional product fields and updates About + update tooltip to prefer LevelCode release version/date.
docs/CORE-PATCHES.md Updates patch regeneration guidance and documents the new patch entries.

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

Comment thread scripts/stamp-levelcode-version.mjs Outdated
Comment thread scripts/build-macos.sh Outdated
…e a release

Addresses the PR #24 review. Both comments were real; the first turned out to
sit on top of a latent bug worth more than the wording fix it asked for.

1. Regex vs stated intent. The comment claimed "a plain dotted version" while
   the regex allowed a -suffix. Rather than tighten the regex as suggested, the
   suffix is now REQUIRED behaviour and the comment says so — because dropping
   --abbrev=0 from `git describe` is the actual fix:

     at the tag (CI release):  v0.8.0              -> stamps 0.8.0
     off the tag (dev build):  v0.8.0-1-g404ef20   -> stamps 0.8.0-1-g404ef20

   With --abbrev=0 a dev build five commits past a release stamped a bare
   "0.8.0" and impersonated it in the UI — the exact class of confusion this PR
   exists to fix. Tightening to X.Y.Z would have locked that in, or failed dev
   builds outright once the suffix appeared. Junk ("v0.8", a branch name, an
   empty describe) still exits 1 and fails the build.

2. %cI documented as "authored". The code was right and the prose was wrong, so
   the prose changed: "Released" means when the build's commit LANDED, and a
   cherry-picked commit's author date can predate the release by weeks — the
   stability %aI offers is stability around the wrong instant. Now stated
   explicitly in the script header, build-macos.sh, and the product.ts doc
   comment. (On every release commit to date the two are identical, since they
   are GitHub merge commits.)

Verified: exact-tag input stamps 0.8.0; describe-suffix input keeps the suffix;
"v0.8" / a branch name / empty all exit 1; typecheck-client exit 0; the patch is
still 14 entries with the original 11 byte-identical, no de-brand contamination,
and reverse-applies cleanly.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@ndemianc
ndemianc merged commit ba941c1 into develop Jul 20, 2026
1 check passed
@ndemianc
ndemianc deleted the fix/levelcode-version-in-update-ui branch July 21, 2026 17:06
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