Skip to content

Commit c682330

Browse files
feat(ui): updated whats new handling and v5.4.1 items
1 parent c064257 commit c682330

File tree

2 files changed

+25
-27
lines changed

2 files changed

+25
-27
lines changed

invokeai/frontend/web/public/locales/en.json

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2102,8 +2102,10 @@
21022102
},
21032103
"whatsNew": {
21042104
"whatsNewInInvoke": "What's New in Invoke",
2105-
"line1": "<StrongComponent>Layer Merging</StrongComponent>: New <StrongComponent>Merge Down</StrongComponent> and improved <StrongComponent>Merge Visible</StrongComponent> for all layers, with special handling for Regional Guidance and Control Layers.",
2106-
"line2": "<StrongComponent>HF Token Support</StrongComponent>: Upload models that require Hugging Face authentication.",
2105+
"items": [
2106+
"<StrongComponent>SD 3.5</StrongComponent>: Support for Text-to-Image in Workflows with SD 3.5 Medium and Large.",
2107+
"<StrongComponent>Canvas</StrongComponent>: Streamlined Control Layer processing and improved default Control settings."
2108+
],
21072109
"readReleaseNotes": "Read Release Notes",
21082110
"watchRecentReleaseVideos": "Watch Recent Release Videos",
21092111
"watchUiUpdatesOverview": "Watch UI Updates Overview"

invokeai/frontend/web/src/features/ui/components/WhatsNew.tsx

Lines changed: 21 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -2,45 +2,41 @@ import { ExternalLink, Flex, ListItem, Text, UnorderedList } from '@invoke-ai/ui
22
import { createSelector } from '@reduxjs/toolkit';
33
import { useAppSelector } from 'app/store/storeHooks';
44
import { selectConfigSlice } from 'features/system/store/configSlice';
5+
import type { ReactNode } from 'react';
56
import { useMemo } from 'react';
67
import { Trans, useTranslation } from 'react-i18next';
78
import { useGetAppVersionQuery } from 'services/api/endpoints/appInfo';
89

910
const selectIsLocal = createSelector(selectConfigSlice, (config) => config.isLocal);
1011

12+
const components = {
13+
StrongComponent: <Text as="span" color="white" fontSize="sm" fontWeight="semibold" />,
14+
};
15+
1116
export const WhatsNew = () => {
1217
const { t } = useTranslation();
1318
const { data } = useGetAppVersionQuery();
1419
const isLocal = useAppSelector(selectIsLocal);
1520

16-
const highlights = useMemo(() => (data?.highlights ? data.highlights : []), [data]);
21+
const items = useMemo<ReactNode[]>(() => {
22+
if (data?.highlights?.length) {
23+
return data.highlights.map((highlight, index) => <ListItem key={`${highlight}-${index}`}>{highlight}</ListItem>);
24+
}
25+
26+
const tKeys = t<string, { returnObjects: true }, string[]>('whatsNew.items', {
27+
returnObjects: true,
28+
});
29+
30+
return tKeys.map((key, index) => (
31+
<ListItem key={`${key}-${index}`}>
32+
<Trans i18nKey={key} components={components} />
33+
</ListItem>
34+
));
35+
}, [data?.highlights, t]);
1736

1837
return (
1938
<Flex gap={4} flexDir="column">
20-
<UnorderedList fontSize="sm">
21-
{highlights.length ? (
22-
highlights.map((highlight, index) => <ListItem key={index}>{highlight}</ListItem>)
23-
) : (
24-
<>
25-
<ListItem>
26-
<Trans
27-
i18nKey="whatsNew.line1"
28-
components={{
29-
StrongComponent: <Text as="span" color="white" fontSize="sm" fontWeight="semibold" />,
30-
}}
31-
/>
32-
</ListItem>
33-
<ListItem>
34-
<Trans
35-
i18nKey="whatsNew.line2"
36-
components={{
37-
StrongComponent: <Text as="span" color="white" fontSize="sm" fontWeight="semibold" />,
38-
}}
39-
/>
40-
</ListItem>
41-
</>
42-
)}
43-
</UnorderedList>
39+
<UnorderedList fontSize="sm">{items}</UnorderedList>
4440
<Flex flexDir="column" gap={1}>
4541
<ExternalLink
4642
fontSize="sm"

0 commit comments

Comments
 (0)