fix(ui): show the LevelCode release version in the update tooltip and About - #24
Merged
Merged
Conversation
… 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>
Contributor
There was a problem hiding this comment.
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.mjsto writelevelcodeVersionandlevelcodeReleaseDateinto the built app’sproduct.json. - Update
scripts/build-macos.shto 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 indocs/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.
…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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The bug
After the first real auto-update, the tooltip read:
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 deliberate —
build-macos.shstamps LevelCode's HEAD so releases stay distinguishable to the update feed. Only the version and date were still Code-OSS's.Why
versioncan't just be renamedproduct.jsonversionis what extensions'engines.vscodeis validated against. Setting it to0.8.0would reject every extension requiring^1.x. So the release identity rides alongside it:version1.126.0engines.vscodecompatibilitylevelcodeVersion0.8.0levelcodeReleaseDatescripts/stamp-levelcode-version.mjs(new) stamps both into the built app'sproduct.json. It refuses anything that isn't a plain dotted version (exit 1), so a badgit describefails the build rather than shippingCurrent Version: v0.8.build-macos.shruns it tag-derived, after the existing strip steps. No reachable tag (dev builds) → skipped, UI falls back toversion.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'sproductVersionand needed no change.Patch-workflow hazard worth knowing about
vscode/is gitignored, so these three core edits live inpatches/levelcode-core.patch(11 → 14 entries).Regenerating wholesale is not safe from a built checkout.
CORE-PATCHES.mdNOTE 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 Exitrewrites into thefiles.contribution.tsentry. Those belong inde-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.versionuntouched, strips avprefix, normalises the date, exits 1 on a bad version, warns-but-continues on a bad date.git apply --check --reverseexit 0, appended entries contain noaka.msstrips, 6[LevelCode]markers.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 shows0.8.1 — Code-OSS 1.126.0.🤖 Generated with Claude Code