Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions .changeset/35280-about-version.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
---
'@object-ui/app-shell': patch
'@object-ui/i18n': patch
---

fix(console): the About dialog names the ObjectStack version first, then the console build

Clause-②: no
Metadata-protocol: none

Help → About showed one row, the console build (a git short sha), and nowhere the ObjectStack version. The dialog now opens on an **ObjectStack version** row filled with exactly the `version` the server's discovery document answers (an operator's `OS_RUNTIME_VERSION` stamp where one is set), read through the shell's adapter from the discovery document the console already holds, so opening it sends no new request. **Console build** stays as the second row, so a deployment can still be traced to a commit. While the read is in flight the version row says it is loading; when discovery cannot be read or names no version, it says so in words ("Unknown version (the server did not report one)"), never an empty field.

New locale keys `help.aboutVersion` and `help.aboutVersionUnknown` in all eleven packs, and `help.aboutDescription` now names both rows. No props or exports change.
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/bug-report.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ body:
id: version
attributes:
label: Version
description: The output of `os --version`, or the build shown under About in the Console's help menu.
description: The output of `os --version`, or the ObjectStack version shown under About in the Console's help menu.
- type: textarea
id: what-happened
attributes:
Expand Down
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/feature-request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ body:
id: version
attributes:
label: Version
description: The output of `os --version`, or the build shown under About in the Console's help menu.
description: The output of `os --version`, or the ObjectStack version shown under About in the Console's help menu.
- type: textarea
id: what-happened
attributes:
Expand Down
81 changes: 73 additions & 8 deletions ui/packages/app-shell/src/layout/AboutDialog.tsx
Original file line number Diff line number Diff line change
@@ -1,18 +1,29 @@
// Copyright (c) 2026 ObjectStack. Licensed under the Apache-2.0 license.

/**
* AboutDialog — the help menu's About entry (objectui#12970).
* AboutDialog — the help menu's About entry (objectui#12970, objectstack#35280).
*
* Names the build this console was compiled from, so a reviewer can tell which
* objectui build a deployment serves. The value is the shared build identity
* (`buildIdentity.ts`), the same read Sentry's release falls back to. A console
* built without one says so in words; the field is never left empty.
* Two rows, the version first:
*
* The runtime's own build identity is deliberately not shown here: the shell
* has no request that reads it today, and adding one is outside this dialog.
* 1. **ObjectStack version** — the `version` the runtime's discovery document
* answers (`DiscoverySchema`'s System Identity field, resolved server-side
* by `resolveDiscoveryVersion()`; an operator's `OS_RUNTIME_VERSION` stamp
* where one is set). It is read through the shell's adapter
* (`getDiscovery()`), which hands back the document its `connect()` already
* holds from the console's one shared discovery read — no second request.
* The value is shown exactly as discovery answers it, never trimmed.
* 2. **Console build** — the build this console was compiled from: the shared
* build identity (`buildIdentity.ts`), the same read Sentry's release falls
* back to, so a deployment can still be traced to a commit.
*
* Neither field is ever left empty: while the read is in flight the version
* row says it is loading, a discovery that cannot be read or answers no
* version says so in words, and a console built without an identity says so
* too.
* @module
*/

import { useEffect, useState } from 'react';
import {
Dialog,
DialogContent,
Expand All @@ -21,6 +32,7 @@ import {
DialogDescription,
} from '@object-ui/components';
import { useObjectTranslation } from '@object-ui/i18n';
import { useAdapter } from '../providers/AdapterProvider.js';

export interface AboutDialogProps {
open: boolean;
Expand All @@ -29,18 +41,71 @@ export interface AboutDialogProps {
build: string | null;
}

/** The discovery document's `version`, or `null` when it names none. */
function discoveryVersion(discovery: unknown): string | null {
const version = (discovery as { version?: unknown } | null)?.version;
return typeof version === 'string' && version !== '' ? version : null;
}

/**
* The runtime's version as discovery answers it, read each time the dialog
* opens: `undefined` before the first answer, `null` when discovery could not
* be read or named no version. A later open keeps the last answer on screen
* while it reads again.
*/
function useRuntimeVersion(open: boolean): string | null | undefined {
const adapter = useAdapter();
const [version, setVersion] = useState<string | null | undefined>(undefined);
useEffect(() => {
if (!open) return;
if (!adapter) {
setVersion(null);
return;
}
let cancelled = false;
// `getDiscovery()` answers `null` when the adapter cannot connect; it does
// not reject.
void adapter.getDiscovery().then((discovery) => {
if (!cancelled) setVersion(discoveryVersion(discovery));
});
return () => {
cancelled = true;
};
}, [open, adapter]);
return version;
}

export function AboutDialog({ open, onOpenChange, build }: AboutDialogProps) {
const { t } = useObjectTranslation();
const version = useRuntimeVersion(open);
return (
<Dialog open={open} onOpenChange={onOpenChange}>
<DialogContent className="sm:max-w-md" data-testid="overlay:about">
<DialogHeader>
<DialogTitle>{t('help.aboutTitle', { defaultValue: 'About this console' })}</DialogTitle>
<DialogDescription>
{t('help.aboutDescription', { defaultValue: 'The build this console was compiled from.' })}
{t('help.aboutDescription', {
defaultValue: 'The ObjectStack version this console runs on, and the build it was compiled from.',
})}
</DialogDescription>
</DialogHeader>
<dl className="grid grid-cols-[auto_1fr] gap-x-4 gap-y-2 pt-2 text-sm">
<dt className="text-muted-foreground">
{t('help.aboutVersion', { defaultValue: 'ObjectStack version' })}
</dt>
<dd data-testid="about:runtime-version" className="min-w-0 break-all">
{version ? (
<code className="font-mono">{version}</code>
) : (
<span className="text-muted-foreground">
{version === undefined
? t('common.loading', { defaultValue: 'Loading…' })
: t('help.aboutVersionUnknown', {
defaultValue: 'Unknown version (the server did not report one)',
})}
</span>
)}
</dd>
<dt className="text-muted-foreground">
{t('help.aboutBuild', { defaultValue: 'Console build' })}
</dt>
Expand Down
7 changes: 4 additions & 3 deletions ui/packages/app-shell/src/layout/HelpMenu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@
* 3. 「Keyboard shortcuts」 — inside an app, the dialog the `?` key opens
* (C2/C3: the `?shortcuts=1` URL param);
* 4. 「Online documentation」 — the public docs site;
* 5. 「About」 — the console's own build (objectui#12970).
* 5. 「About」 — the ObjectStack version and the console's own build
* (objectui#12970, objectstack#35280).
*/

import { useCallback, useState } from 'react';
Expand Down Expand Up @@ -149,8 +150,8 @@ export function HelpMenu({ inApp, appPackageId, triggerClassName, triggerTestId
{t('help.onlineDocs', { defaultValue: 'Online documentation' })}
</a>
</DropdownMenuItem>
{/* About — names the console's own build, on every variant
(objectui#12970). */}
{/* About — names the ObjectStack version and the console's own
build, on every variant (objectui#12970). */}
<DropdownMenuItem
className="cursor-pointer"
data-testid="action:about:open"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@
* the tenant console's `app` bar and the control plane's `home` / `orgs` /
* `studio` bars are the one component — the help menu carries 「关于」 / About,
* and the dialog it opens names the build this console was compiled from.
* Since objectstack#35280 it names the ObjectStack version first: the
* `version` the discovery document answers, read through the adapter's
* `getDiscovery()`, stubbed here through a mutable answer.
*
* The build identity is `buildIdentity.ts`'s one read, stubbed here through a
* mutable reading: this repo's Vitest setup cannot put a `VITE_*` value on
Expand Down Expand Up @@ -151,8 +154,18 @@ vi.mock('../../providers/MetadataProvider', () => ({
}),
}));

/**
* What the adapter's `getDiscovery()` answers; each case sets it. The adapter
* answers `null` when it cannot connect, and never rejects.
*/
let discoveryAnswer: Promise<unknown> = Promise.resolve(null);

/** Stable identity: the header's readers key their effects on the adapter. */
const fakeAdapter = { find: () => Promise.resolve({ data: [] }), getClient: () => undefined };
const fakeAdapter = {
find: () => Promise.resolve({ data: [] }),
getClient: () => undefined,
getDiscovery: () => discoveryAnswer,
};

vi.mock('../../providers/AdapterProvider', () => ({
useAdapter: () => fakeAdapter,
Expand Down Expand Up @@ -209,6 +222,7 @@ function openAbout() {

beforeEach(() => {
consoleBuild = null;
discoveryAnswer = Promise.resolve({ version: '18.5.0' });
vi.stubGlobal('fetch', vi.fn(async () => ({ ok: true, status: 200, json: async () => ({ data: [] }) })));
});

Expand Down Expand Up @@ -257,3 +271,47 @@ describe('AppHeader help menu: About names the console build (objectui#12970)',
},
);
});

describe('About names the ObjectStack version first, read from discovery (objectstack#35280)', () => {
it.each(['18.5.0', '18.6.0-rc.2+deploy.41'])(
'discovery answering `%s` fills the first row with exactly that value; the build row follows',
async (version) => {
consoleBuild = '0707b4ae';
discoveryAnswer = Promise.resolve({ name: 'objectstack', version, services: {} });
renderHeader('app');

const dialog = openAbout();
const value = within(dialog).getByTestId('about:runtime-version');
expect(await within(value).findByText(version)).toBeInTheDocument();
expect(value.textContent).toBe(version);

const terms = Array.from(dialog.querySelectorAll('dt')).map((dt) => dt.textContent);
expect(terms).toEqual(['«help.aboutVersion»', '«help.aboutBuild»']);
const values = Array.from(dialog.querySelectorAll('dd')).map((dd) => dd.getAttribute('data-testid'));
expect(values).toEqual(['about:runtime-version', 'about:console-build']);
expect(within(dialog).getByTestId('about:console-build')).toHaveTextContent('0707b4ae');
},
);

it.each<[string, unknown]>([
['discovery cannot be read (the adapter answers null)', null],
['discovery answers no version', { name: 'objectstack', services: {} }],
['discovery answers an empty version', { version: '' }],
])('%s: the row says so in words, never an empty field', async (_case, answer) => {
discoveryAnswer = Promise.resolve(answer);
renderHeader('home');

const value = within(openAbout()).getByTestId('about:runtime-version');
expect(await within(value).findByText('«help.aboutVersionUnknown»')).toBeInTheDocument();
expect(value.textContent?.trim()).not.toBe('');
});

it('while the read is in flight the row says it is loading, never an empty field', () => {
discoveryAnswer = new Promise(() => {});
renderHeader('app');

const value = within(openAbout()).getByTestId('about:runtime-version');
expect(value).toHaveTextContent('«common.loading»');
expect(within(value).queryByText('«help.aboutVersionUnknown»')).not.toBeInTheDocument();
});
});
4 changes: 3 additions & 1 deletion ui/packages/i18n/src/locales/ar.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3716,7 +3716,9 @@ const ar = {
diagram: 'مخطط',
about: 'حول',
aboutTitle: 'حول وحدة التحكم هذه',
aboutDescription: 'الإصدار الذي بُنيت منه وحدة التحكم هذه.',
aboutDescription: 'إصدار ObjectStack الذي تعمل عليه وحدة التحكم هذه، والإصدار الذي بُنيت منه.',
aboutVersion: 'إصدار ObjectStack',
aboutVersionUnknown: 'إصدار غير معروف (لم يُبلغ الخادم عن أي إصدار)',
aboutBuild: 'إصدار وحدة التحكم',
aboutBuildUnknown: 'إصدار غير معروف (لم يُحدَّد أي إصدار عند بناء وحدة التحكم هذه)',
},
Expand Down
4 changes: 3 additions & 1 deletion ui/packages/i18n/src/locales/de.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3401,7 +3401,9 @@ const de = {
diagram: 'Diagramm',
about: 'Über',
aboutTitle: 'Über diese Konsole',
aboutDescription: 'Der Build, aus dem diese Konsole kompiliert wurde.',
aboutDescription: 'Die ObjectStack-Version, auf der diese Konsole läuft, und der Build, aus dem sie kompiliert wurde.',
aboutVersion: 'ObjectStack-Version',
aboutVersionUnknown: 'Unbekannte Version (der Server hat keine gemeldet)',
aboutBuild: 'Konsolen-Build',
aboutBuildUnknown: 'Unbekannter Build (beim Erstellen dieser Konsole wurde keine Version gesetzt)',
},
Expand Down
4 changes: 3 additions & 1 deletion ui/packages/i18n/src/locales/en.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4075,7 +4075,9 @@ const en = {
diagram: 'Diagram',
about: 'About',
aboutTitle: 'About this console',
aboutDescription: 'The build this console was compiled from.',
aboutDescription: 'The ObjectStack version this console runs on, and the build it was compiled from.',
aboutVersion: 'ObjectStack version',
aboutVersionUnknown: 'Unknown version (the server did not report one)',
aboutBuild: 'Console build',
aboutBuildUnknown: 'Unknown build (no version was set when this console was built)',
},
Expand Down
4 changes: 3 additions & 1 deletion ui/packages/i18n/src/locales/es.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3481,7 +3481,9 @@ const es = {
diagram: 'Diagrama',
about: 'Acerca de',
aboutTitle: 'Acerca de esta consola',
aboutDescription: 'La compilación a partir de la cual se generó esta consola.',
aboutDescription: 'La versión de ObjectStack sobre la que se ejecuta esta consola y la compilación a partir de la cual se generó.',
aboutVersion: 'Versión de ObjectStack',
aboutVersionUnknown: 'Versión desconocida (el servidor no informó ninguna)',
aboutBuild: 'Compilación de la consola',
aboutBuildUnknown: 'Compilación desconocida (no se definió ninguna versión al compilar esta consola)',
},
Expand Down
4 changes: 3 additions & 1 deletion ui/packages/i18n/src/locales/fr.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3477,7 +3477,9 @@ const fr = {
diagram: 'Diagramme',
about: 'À propos',
aboutTitle: 'À propos de cette console',
aboutDescription: 'Le build à partir duquel cette console a été compilée.',
aboutDescription: 'La version d’ObjectStack sur laquelle cette console s’exécute, et le build à partir duquel elle a été compilée.',
aboutVersion: 'Version d’ObjectStack',
aboutVersionUnknown: 'Version inconnue (le serveur n’en a signalé aucune)',
aboutBuild: 'Build de la console',
aboutBuildUnknown: 'Build inconnu (aucune version n’a été définie lors de la compilation de cette console)',
},
Expand Down
4 changes: 3 additions & 1 deletion ui/packages/i18n/src/locales/ja.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3403,7 +3403,9 @@ const ja = {
diagram: '図',
about: 'バージョン情報',
aboutTitle: 'このコンソールについて',
aboutDescription: 'このコンソールのコンパイル元となったビルドです。',
aboutDescription: 'このコンソールが動作している ObjectStack のバージョンと、コンパイル元となったビルドです。',
aboutVersion: 'ObjectStack のバージョン',
aboutVersionUnknown: '不明なバージョン(サーバーがバージョンを報告しませんでした)',
aboutBuild: 'コンソールのビルド',
aboutBuildUnknown: '不明なビルド(このコンソールのビルド時にバージョンが設定されていません)',
},
Expand Down
4 changes: 3 additions & 1 deletion ui/packages/i18n/src/locales/ko.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3401,7 +3401,9 @@ const ko = {
diagram: '다이어그램',
about: '정보',
aboutTitle: '이 콘솔 정보',
aboutDescription: '이 콘솔이 컴파일된 빌드입니다.',
aboutDescription: '이 콘솔이 실행 중인 ObjectStack 버전과 이 콘솔이 컴파일된 빌드입니다.',
aboutVersion: 'ObjectStack 버전',
aboutVersionUnknown: '알 수 없는 버전(서버가 버전을 보고하지 않음)',
aboutBuild: '콘솔 빌드',
aboutBuildUnknown: '알 수 없는 빌드(이 콘솔을 빌드할 때 버전이 설정되지 않음)',
},
Expand Down
4 changes: 3 additions & 1 deletion ui/packages/i18n/src/locales/pt-BR.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3476,7 +3476,9 @@ const pt = {
diagram: 'Diagrama',
about: 'Sobre',
aboutTitle: 'Sobre este console',
aboutDescription: 'A build a partir da qual este console foi compilado.',
aboutDescription: 'A versão do ObjectStack em que este console é executado e a build a partir da qual ele foi compilado.',
aboutVersion: 'Versão do ObjectStack',
aboutVersionUnknown: 'Versão desconhecida (o servidor não informou nenhuma)',
aboutBuild: 'Build do console',
aboutBuildUnknown: 'Build desconhecida (nenhuma versão foi definida ao compilar este console)',
},
Expand Down
4 changes: 3 additions & 1 deletion ui/packages/i18n/src/locales/ru.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3566,7 +3566,9 @@ const ru = {
diagram: 'Схема',
about: 'О программе',
aboutTitle: 'Об этой консоли',
aboutDescription: 'Сборка, из которой скомпилирована эта консоль.',
aboutDescription: 'Версия ObjectStack, на которой работает эта консоль, и сборка, из которой она скомпилирована.',
aboutVersion: 'Версия ObjectStack',
aboutVersionUnknown: 'Неизвестная версия (сервер её не сообщил)',
aboutBuild: 'Сборка консоли',
aboutBuildUnknown: 'Неизвестная сборка (при сборке этой консоли версия не была задана)',
},
Expand Down
4 changes: 3 additions & 1 deletion ui/packages/i18n/src/locales/zh-Hans.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3482,7 +3482,9 @@ const zh = {
diagram: '图示',
about: '关于',
aboutTitle: '关于此控制台',
aboutDescription: '此控制台编译所用的构建。',
aboutDescription: '此控制台运行的 ObjectStack 版本,以及它编译所用的构建。',
aboutVersion: 'ObjectStack 版本',
aboutVersionUnknown: '未知版本(服务器未报告版本)',
aboutBuild: '控制台构建',
aboutBuildUnknown: '未知构建(构建此控制台时未设置版本)',
},
Expand Down
4 changes: 3 additions & 1 deletion ui/packages/i18n/src/locales/zh-Hant.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3482,7 +3482,9 @@ const zhHant = {
diagram: '圖示',
about: '關於',
aboutTitle: '關於此控制台',
aboutDescription: '此控制台編譯所用的構建。',
aboutDescription: '此控制台執行的 ObjectStack 版本,以及它編譯所用的構建。',
aboutVersion: 'ObjectStack 版本',
aboutVersionUnknown: '未知版本(伺服器未報告版本)',
aboutBuild: '控制台構建',
aboutBuildUnknown: '未知構建(構建此控制台時未設定版本)',
},
Expand Down
Loading