Repository navigation
feat(app-shell): the help menu's About names the console build (objectui#12970) - #12976
Merged
Merged
Conversation
…tui#12970) The help menu on every console bar gains an About entry. Its dialog names the build the console was compiled from: VITE_APP_VERSION from the build's environment, or the short sha of HEAD the console's Vite config reads from git when that is unset. With neither, it states "Unknown build" in words. One reader, buildIdentity.ts, serves both the dialog and Sentry's release fallback. Text through new help.about* keys in all ten packs. Co-authored-by: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01XVp19E1MYUTFM3dnkwz8gB
Contributor
✅ Console Performance Budget
The eager closure is every chunk the entry reaches through static imports — what the browser fetches and parses before the app renders. The entry chunk on its own is a small fraction of it. 📦 Bundle Size Report
Size Limits
|
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.
Fixes #12970
Clause-②: no
What this does
The help menu gains 「关于」 / About on every console bar. The tenant console (
appvariant) and the control plane (home/orgs/studio) all draw the help menu from the same component,AppHeader, so the item is added once and appears on both planes. It opens a small dialog that names the build the console was compiled from:VITE_APP_VERSIONfrom the build's environment, when it is set (cloud's Dockerfiles will pass it as a build-arg once this lands; that half is cloud's, ⛔ not changed here).HEADthatapps/console/vite.config.tsreads from git at build time.One reader, shared:
packages/app-shell/src/buildIdentity.ts(resolveConsoleBuild/getConsoleBuild). The dialog reads it. Sentry's release fallback reads it through the new pureresolveSentryRelease:VITE_SENTRY_RELEASE, else the build identity, else'unknown'. There is no second spelling.Text goes through five new keys,
help.about,help.aboutTitle,help.aboutDescription,help.aboutBuildandhelp.aboutBuildUnknown, in all ten packs. No new runtime-config key.The runtime's build identity is not shown. app-shell has no request that reads
/api/v1/healthtoday. Showing it would need a new request path, so the dispatch ruling says to skip it.A1: how the value reaches the bundle (measured)
define, not env passthrough. The console config computesconsoleBuild = process.env.VITE_APP_VERSION?.trim() || readGitShortSha(). When the result is non-empty, the config bakes it asdefine['import.meta.env.VITE_APP_VERSION']. Vite 8.2.2 mergesimport.meta.env.*defines into theimport.meta.envobject it substitutes at build time (read in vite'sdist/node/chunks/node.js,userDefineEnv).@object-ui/app-shellbuilds with baretsc, so itsdist/still readsimport.meta.env.VITE_APP_VERSION. The APP's Vite build substitutes the value. The library itself reads nothing at build time.vite.resolveConfig, then bundlesbuildIdentity.tswith the resulting define and imports the output:VITE_APP_VERSION=0707b4ae: define"0707b4ae", and the bundledgetConsoleBuild()returns"0707b4ae"."1c4bed6f91"(=git rev-parse --short HEAD), and the bundled read returns"1c4bed6f91".--depth 1clone with a detached HEAD,git rev-parse --short HEADanswers (shallow=true,branch=HEAD). In a directory with no.git, it exits 128. The config catches that, bakes nothing, and the dialog states the fallback.Tests (at
1c4bed6f91)packages/app-shell/src/layout/__tests__/AppHeader.aboutBuild-12970.test.tsxcovers three cases:appandhome, the dialog names a baked commit.help.aboutBuildUnknown, never empty text.packages/app-shell/src/__tests__/buildIdentity-12970.test.tscovers the pure reader (trim; absent, empty or non-string gives null).resolveSentryReleasefalls back to exactly whatresolveConsoleBuildreads, and to'unknown'when the build named neither.AppHeader.*suite,sentry.test.ts, the product-neutral ratchet, and the i18ndead-pack-keys-retired-8754,residue-namespaces-3546,all-locales-key-parity,en-zh-key-parityandmachineLocaleCensus-9909suites.scripts/ablation-replace.mjs:DropdownMenuItem. It hit 1 time, went 1 to 0, and the blob changedb1af036b0a0fto8f5f9e1872db.b1af036b0a0fequals HEAD, andgit diff HEADis empty.Gates (exit codes, at
1c4bed6f91)turbo run build --filter=@object-ui/app-shell^... --concurrency=2: 28/28 tasks, exit 0.type-checkexit 0 for@object-ui/app-shelland for@object-ui/i18n.apps/consoletsc -b tsconfig.node.json --force(it coversvite.config.ts) exit 0..ts/.tsxfiles (--no-inline-config --format json): 17 files linted, 0 errors. All warnings areno-explicit-any/no-unused-vars, in pre-existing code or in mock-shape lines copied from the sibling AppHeader suites.eslint.config.js(noparserOptions.project), so this diff cannot move any untouched file's verdict.check:phantom-deps,self-import,unreferenced-sources,doc-example-readers,handler-key-reads,side-effects-array,element-data-source-declaration,spec-symbols,action-forward-parity,designer-field-key-parity,icon-record-names,i18n-keys,i18n-drift,i18n-designer-parity,control-bytes,scripts/check-hand-rolled-comment-mask.mjs,scripts/check-changeset-fixed.mjs,scripts/check-changeset-presence.mjs, and objectstack'scheck-nul-bytes.packages/app-shell/,packages/i18n/andapps/console/vitest directories (not run whole locally, per the dispatch), andpnpm lint.Acceptance notes
apps/console/docs/error-tracking.mdstill saysVITE_SENTRY_RELEASE"Defaults toVITE_APP_VERSION, thenunknown". That remains true, but the doc does not mention the new git-sha fallback. The doc is outside this claim's file surface, so it is left for a follow-up docs touch.Built by the dispatched dev of seat
domain:ui#2, sessionhttps://claude.ai/code/session_01XVp19E1MYUTFM3dnkwz8gB.Generated by Claude Code