mirror of
https://github.com/mauriceboe/TREK.git
synced 2026-10-23 07:26:30 +00:00
feat(notices): bring the release notes back on every update
The release modal takes the 4.3.0 design: the release and its headline cards on the left, the note and the support links on the right, at the design's own size. The cards carry small drawings of the features instead of an icon. The 4.0.0 entry is retired. In its place sits one entry, release-notes, that every big release rewrites and keeps. It recurs per version with no upper bound, so every user sees it once on each update, whatever they did with it before, and a reload of the same version keeps it closed. An integration test holds that promise through the real entry and the real dismiss route. All 23 locales carry the new copy and drop the 4.0.0 strings.
This commit is contained in:
@@ -54,32 +54,33 @@ describe('systemNoticeDtoSchema', () => {
|
||||
|
||||
it('accepts a release notice and keeps its optional pieces optional', () => {
|
||||
const base = {
|
||||
id: 'release-4-0-0',
|
||||
id: 'release-notes',
|
||||
display: 'modal' as const,
|
||||
severity: 'info' as const,
|
||||
titleKey: 't',
|
||||
bodyKey: 'b',
|
||||
dismissible: true,
|
||||
release: {
|
||||
version: '4.0.0',
|
||||
version: '4.3.0',
|
||||
eyebrowKey: 'e',
|
||||
tagKey: 'tag',
|
||||
headlineKey: 'h',
|
||||
introKey: 'i',
|
||||
featuresLabelKey: 'fl',
|
||||
features: [
|
||||
{ iconName: 'Smartphone', titleKey: 'f1t', bodyKey: 'f1b' },
|
||||
{ iconName: 'BookOpen', titleKey: 'f2t', bodyKey: 'f2b', badgeKey: 'beta' },
|
||||
{ iconName: 'Database', titleKey: 'f1t', bodyKey: 'f1b' },
|
||||
{ iconName: 'Route', visual: 'roadtrip', titleKey: 'f2t', bodyKey: 'f2b' },
|
||||
],
|
||||
note: {
|
||||
eyebrowKey: 'ne',
|
||||
titleKey: 'nt',
|
||||
bodyKey: 'nb',
|
||||
promiseLabelKey: 'pl',
|
||||
promiseLeadKey: 'plead',
|
||||
promiseTextKey: 'pt',
|
||||
bodyAfterKey: 'nba',
|
||||
closingKey: 'nc',
|
||||
signatureKey: 'ns',
|
||||
},
|
||||
supportLeadKey: 'slead',
|
||||
supportTextKey: 's',
|
||||
},
|
||||
};
|
||||
@@ -89,7 +90,7 @@ describe('systemNoticeDtoSchema', () => {
|
||||
...base,
|
||||
release: {
|
||||
...base.release,
|
||||
stats: [{ value: '~150', labelKey: 'bugs' }],
|
||||
featuresAsideKey: 'fa',
|
||||
notes: { labelKey: 'notes', href: 'https://example.test' },
|
||||
footnoteKey: 'fn',
|
||||
},
|
||||
@@ -107,12 +108,13 @@ describe('systemNoticeDtoSchema', () => {
|
||||
bodyKey: 'b',
|
||||
dismissible: true,
|
||||
release: {
|
||||
version: '4.0.0',
|
||||
version: '4.3.0',
|
||||
eyebrowKey: 'e',
|
||||
tagKey: 'tag',
|
||||
headlineKey: 'h',
|
||||
introKey: 'i',
|
||||
featuresLabelKey: 'fl',
|
||||
features: [],
|
||||
supportLeadKey: 'slead',
|
||||
supportTextKey: 's',
|
||||
},
|
||||
}).success,
|
||||
|
||||
@@ -42,18 +42,15 @@ const noticeCtaSchema = z.discriminatedUnion('kind', [
|
||||
}),
|
||||
]);
|
||||
|
||||
/** One "what changed" row in the release panel: icon, headline, prose, optional badge. */
|
||||
/**
|
||||
* One headline card in the release panel. `visual` names a small illustration the
|
||||
* client draws for it; a name the client does not know falls back to the icon.
|
||||
*/
|
||||
const noticeReleaseFeatureSchema = z.object({
|
||||
iconName: z.string(),
|
||||
visual: z.string().optional(),
|
||||
titleKey: z.string(),
|
||||
bodyKey: z.string(),
|
||||
badgeKey: z.string().optional(),
|
||||
});
|
||||
|
||||
/** A number worth stating next to the release — the figure itself is not translated. */
|
||||
const noticeReleaseStatSchema = z.object({
|
||||
value: z.string(),
|
||||
labelKey: z.string(),
|
||||
});
|
||||
|
||||
/**
|
||||
@@ -63,28 +60,32 @@ const noticeReleaseStatSchema = z.object({
|
||||
* shows lives here rather than inside the component.
|
||||
*/
|
||||
const noticeReleaseSchema = z.object({
|
||||
/** Shown as the display figure ("4.0.0") — a version string, not a semver gate. */
|
||||
/** Shown as the display figure ("4.3.0"), a version string, not a semver gate. */
|
||||
version: z.string(),
|
||||
eyebrowKey: z.string(),
|
||||
tagKey: z.string(),
|
||||
headlineKey: z.string(),
|
||||
introKey: z.string(),
|
||||
featuresLabelKey: z.string(),
|
||||
featuresAsideKey: z.string().optional(),
|
||||
/** Two to four cards; the grid lays out any of those counts. */
|
||||
features: z.array(noticeReleaseFeatureSchema),
|
||||
stats: z.array(noticeReleaseStatSchema).optional(),
|
||||
notes: z.object({ labelKey: z.string(), href: z.string() }).optional(),
|
||||
footnoteKey: z.string().optional(),
|
||||
note: z.object({
|
||||
eyebrowKey: z.string(),
|
||||
titleKey: z.string(),
|
||||
/** Markdown paragraphs above the promise box. */
|
||||
/** Paragraphs above the promise box, separated by a blank line. */
|
||||
bodyKey: z.string(),
|
||||
promiseLabelKey: z.string(),
|
||||
/** The promise's opening sentence, set in bold before the rest. */
|
||||
promiseLeadKey: z.string(),
|
||||
promiseTextKey: z.string(),
|
||||
/** Markdown paragraphs below the promise box. */
|
||||
/** Paragraphs below the promise box, separated by a blank line. */
|
||||
bodyAfterKey: z.string(),
|
||||
closingKey: z.string(),
|
||||
signatureKey: z.string(),
|
||||
}),
|
||||
/** The support footer's opening sentence, set in bold before the rest. */
|
||||
supportLeadKey: z.string(),
|
||||
supportTextKey: z.string(),
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user