fix(i18n): localise mobile build revision metadata
This commit is contained in:
@@ -0,0 +1,11 @@
|
||||
# Mobile build metadata localisation
|
||||
|
||||
3 November 2026. Independent bounded UI-language fix on `codex/i18n-build-metadata`, based on accepted integration `d3d338376444b8abdcaf7200f682faa3daf1ad10`. The existing i18n worktree was reused; original codex/i18n-accessible-labels ref remains4172c23d. This branch does not include the newer A3 foundation/navigation increments and must not replace their tree wholesale.
|
||||
|
||||
Defect reproduced: in the Bokmål mobile account menu, the version was translated but the revision line remained literal `commit abc1234`, while the existing catalogue already provides `applicationVersionCommit` with `revisjon`. The new regression passed for English and failed for Bokmål before the fix.
|
||||
|
||||
The existing AppShell now uses the existing combined localised version/revision message in that menu, retaining the version-only fallback when no commit was supplied. Caller-controlled admin metadata visibility is unchanged. No new keys, enabled locales, provider/model operation, API, data model or physical document changes. Historical188 dynamic-call reviews are not reopened or recounted; AppShell is absent from that resolution register. This is a static literal correction, not complete European localisation.
|
||||
|
||||
Validation: 24 targeted tests in five suites PASSED (new EN/NB commit and version-only menu checks plus existing metadata/visibility, mobile readiness, catalogue and language-provider checks). Typecheck, scoped zero-warning ESLint and a fresh static production build PASSED. An initial test used an unsupported Testing Library `exact` role option; removed it, retaining exact string-name matching. The failed intermediate typecheck/build were superseded by the final successful run. Native Jest report: evidence/mobile-build-metadata/TESTS.json. No fresh browser/native-device, provider, backend or integrated security qualification is claimed for this separate branch.
|
||||
|
||||
Integration requirement: preserve pending navigation review artifact992608c7. When the next relevant implementation entry is authorised, port only this small AppShell hunk and its regression test onto the reconciled A3 branch, then run combined navigation/metadata/language checks and build as appropriate. Do not cherry-pick older branch application/theme files or alter the original frozen translation register. No main merge or deployment.
|
||||
@@ -0,0 +1,24 @@
|
||||
{
|
||||
"recordedAtUtc": "2026-11-03T07:52:44.745521+00:00",
|
||||
"base": "d3d338376444b8abdcaf7200f682faa3daf1ad10",
|
||||
"policy": "UTF8 text/JSON SHA-256 after LF normalisation",
|
||||
"sources": {
|
||||
"job-tracker-ui/src/layout/AppShell.tsx": "603afbe21d854ec4af7b17ec75a58cfdd65cc053e72d63769d20df7a81c7acc3",
|
||||
"job-tracker-ui/src/build-metadata-localisation.test.tsx": "065c5550a18f7b3c7dca9bbb26c5564a53a53eaf389e7c9695596fcbb2c06f6e",
|
||||
"job-tracker-ui/src/i18n/translations.ts": "ed99d129f8702181429e10ec02f65f734220409fcba4de51d0d77a0d60871ea4",
|
||||
"job-tracker-ui/package.json": "3745394e406cefa40d30a87e840bccb359be147bac6ffba736e2ae90898a8626",
|
||||
"job-tracker-ui/package-lock.json": "bf31e90d7af03e8af059db2aaf893925b9e8881a30a1688034ed88ef45d4fcab"
|
||||
},
|
||||
"testReport": "1c7fb362460f2475fb4a782e26b56d1ee112595c3883cd6294a5b7ac6d72dd15",
|
||||
"validation": {
|
||||
"tests": "24 passed,5 suites",
|
||||
"typecheck": "exit0",
|
||||
"scopedLint": "exit0",
|
||||
"productionBuild": "exit0"
|
||||
},
|
||||
"limits": [
|
||||
"no fresh browser/native acceptance",
|
||||
"not combined with pending A3 navigation review992608c7",
|
||||
"188 historical dynamic-call review remains unchanged"
|
||||
]
|
||||
}
|
||||
File diff suppressed because one or more lines are too long
@@ -0,0 +1,26 @@
|
||||
import React from "react";
|
||||
import "@testing-library/jest-dom";
|
||||
import { fireEvent, render, screen, within } from "@testing-library/react";
|
||||
import JobTrackerThemeProvider from "./ThemeProvider";
|
||||
import { I18nProvider } from "./i18n/I18nProvider";
|
||||
import AppShell from "./layout/AppShell";
|
||||
|
||||
jest.mock("@mui/material/useMediaQuery", () => ({ __esModule: true, default: () => true }));
|
||||
afterEach(() => localStorage.clear());
|
||||
|
||||
test.each([
|
||||
["en", "User", "commit abc1234", "abc1234"],
|
||||
["nb", "Bruker", "revisjon abc1234", "abc1234"],
|
||||
["en", "User", "Application version 2.4.1", undefined],
|
||||
["nb", "Bruker", "Applikasjonsversjon 2.4.1", undefined],
|
||||
] as const)("%s mobile account menu localises the supplied build metadata (%s)", (language, user, expected, commit) => {
|
||||
localStorage.setItem("uiLanguage", language);
|
||||
render(<JobTrackerThemeProvider preference="light" systemPrefersDark={false}><I18nProvider>
|
||||
<AppShell pageTitle="Page" breadcrumbs={[]} pathname="/dashboard" nav={[]} navBottom={[]}
|
||||
drawerOpen={false} onNavigate={jest.fn()} onToggleDrawer={jest.fn()} user={{ userName: "Sample" }}
|
||||
buildMetadata={{ version: "2.4.1", commitSha: commit }}><div>Sample content</div></AppShell>
|
||||
</I18nProvider></JobTrackerThemeProvider>);
|
||||
fireEvent.click(screen.getByRole("button", { name: user }));
|
||||
expect(screen.getByRole("menu")).toHaveTextContent(expected);
|
||||
expect(within(screen.getByRole("menu")).getByText(/2\.4\.1/)).toBeVisible();
|
||||
});
|
||||
@@ -559,8 +559,7 @@ export default function AppShell({
|
||||
>
|
||||
{isMobile && buildVersion ? (
|
||||
<ListSubheader disableSticky role="presentation" sx={{ maxWidth: 280, py: 1, lineHeight: 1.5, overflowWrap: "anywhere" }}>
|
||||
<Typography variant="body2">{t("applicationVersion", { version: buildVersion })}</Typography>
|
||||
{buildCommit ? <Typography variant="caption">commit {buildCommit}</Typography> : null}
|
||||
<Typography variant="body2">{buildCommit ? t("applicationVersionCommit", { version: buildVersion, commit: buildCommit }) : t("applicationVersion", { version: buildVersion })}</Typography>
|
||||
</ListSubheader>
|
||||
) : null}
|
||||
<MenuItem
|
||||
|
||||
Reference in New Issue
Block a user