Skip to content

[doc] Theme generator review step added#2420

Open
Jialecl wants to merge 4 commits intotheme-generatorfrom
jialecl/themeGenerator-review
Open

[doc] Theme generator review step added#2420
Jialecl wants to merge 4 commits intotheme-generatorfrom
jialecl/themeGenerator-review

Conversation

@Jialecl
Copy link
Collaborator

@Jialecl Jialecl commented Mar 6, 2026

Checklist
(Check off all the items before submitting)

  • Build process is done without errors. All tests pass in the /lib directory.
  • Self-reviewed the code before submitting.
  • Meets accessibility standards.
  • Added/updated documentation to /website as needed.
  • Added/updated tests as needed.

Purpose
Theme generator third step added.

image

@PelayoFelgueroso PelayoFelgueroso self-assigned this Mar 6, 2026
@raquelarrojo raquelarrojo self-requested a review March 6, 2026 11:21
>
<DxcFlex direction="column" gap="var(--spacing-gap-ml)">
<DxcTypography fontSize="var(--typography-title-l)" fontWeight="var(--typography-title-bold)">
Branding Assets
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Assets should be in lower case

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed

const ReviewBrandingAssets = ({ logos }: { logos: Logos }) => {
return (
<DxcGrid templateColumns={["repeat(4, 1fr)"]} templateRows={["156px"]} gap="var(--spacing-gap-m)">
<BrandingAsset label="Main Logo" logo={logos.mainLogo[0]?.preview || ""} />
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Logo should be in lowercase, like others

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed


const ReviewBrandingAssets = ({ logos }: { logos: Logos }) => {
return (
<DxcGrid templateColumns={["repeat(4, 1fr)"]} templateRows={["156px"]} gap="var(--spacing-gap-m)">
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Where do we get 156px?

Copy link
Collaborator Author

@Jialecl Jialecl Mar 6, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I set the height to the wrong element. The title + logo preview was 156px in design, but it was the image preview the one with a set height of 130px in the design. I have changed the element with the set height.


const ReviewBrandingAssets = ({ logos }: { logos: Logos }) => {
return (
<DxcGrid templateColumns={["repeat(4, 1fr)"]} templateRows={["156px"]} gap="var(--spacing-gap-m)">
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Gap should be 16px instead of 12px

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed

<DxcContainer width="250px" height="100%">
<DxcFlex direction="column" gap="var(--spacing-gap-xs)" fullHeight>
<DxcTypography fontWeight="var(--typography-label-semibold)">{label}</DxcTypography>
<DxcContainer
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we show anything if there is no logo selected?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I did change this to show empty grey containers. There are some solutions that we can argue about:

  • having default logos and use those by default
  • leaving empty grey placeholders like now
  • removing the Branding assets section in the review step if there are no logos and showing only those that do have a logo assigned

return (
<DxcContainer height="100%" overflow="auto" borderRadius="var(--border-radius-m)">
<DxcTypography as="pre" fontSize="var(--typography-body-xs)" whiteSpace="pre">
{themeJson}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This tokens list should also include logos, does it?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed. Moved the json string creation to ReviewDetails instead to avoid code repetition.

});
};
return (
<>
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pleas remove this fragment

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The component is returning two DxcContainers without this fragment we would receive an error.

/>
</DxcFlex>
<DxcGrid templateColumns={["2fr", "1fr"]} templateRows={["368px"]} gap="var(--spacing-gap-m)">
<DxcFlex justifyContent="center">
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Where do we get 368px?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is the height applied in the design.

{logo && (
<DxcFlex alignItems="center" justifyContent="center" fullHeight>
<DxcImage width="100%" height="100%" objectFit="contain" src={logo} alt={label} />
</DxcFlex>
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is less padding space than in the design:

Image

Design:

Image

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Right now based on the design the padding that we would apply is not correct:
image
The image oversteps the padding.

warning: CssColor;
};

export type ColorGroups = {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should it be TokenGroups intead of ColorGroups?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed

);
};

export default ReviewTokensGrid;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

{group} should be capitalized, as it is in the design

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed

const ReviewTokensList = ({ generatedTokens }: { generatedTokens: Tokens }) => {
const themeJson = useMemo(() => JSON.stringify(generatedTokens, null, 2), [generatedTokens]);
return (
<DxcContainer height="100%" overflow="auto" borderRadius="var(--border-radius-m)">
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The scrollbar of this container is not the same as in the design, and is not positioned in the same spot.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This topic has been discussed with design already.

const ReviewBrandingAssets = ({ logos }: { logos: Logos }) => {
return (
<DxcGrid templateColumns={["repeat(4, 1fr)"]} templateRows={["156px"]} gap="var(--spacing-gap-m)">
<BrandingAsset label="Main Logo" logo={logos.mainLogo[0]?.preview || ""} />
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Instead of rendering the same component 4 times, we can define an array with the label and the logo key(mainLogo, footerLogo...).
Then iterate over that array and render .

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed

import { Logos } from "screens/theme-generator/types";

const BrandingAsset = ({ label, logo }: { label: string; logo: string }) => {
return (
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Taking into account the comment about creating an array with a label and logo(l.30), we should check here if the logo exists or not.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed

return (
<DxcGrid templateColumns={["repeat(4, 1fr)"]} templateRows={["156px"]} gap="var(--spacing-gap-m)">
<BrandingAsset label="Main Logo" logo={logos.mainLogo[0]?.preview || ""} />
<BrandingAsset label="Footer logo" logo={logos.footerLogo[0]?.preview || ""} />
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm just curious as to why we're setting a fallback value (|| "") instead of typing the prop as a string | undefined.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You are totally right. It was an oversight from my part

const ReviewBrandingAssets = ({ logos }: { logos: Logos }) => {
return (
<DxcGrid templateColumns={["repeat(4, 1fr)"]} templateRows={["156px"]} gap="var(--spacing-gap-m)">
<BrandingAsset label="Main Logo" logo={logos.mainLogo[0]?.preview || ""} />
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For consistency, change 'Main Logo' to 'Main logo'.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed

>
{SHADE_VALUES.map((value, index) =>
index === 0 ? (
<DxcGrid.Item column={"2/3"}>
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add 'key' to avoid warnings(do not use 'index' as its value).

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed

</DxcFlex>
{colors.map((color: string, index: number) => (
<div
key={index}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Avoid using 'index' as key.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed

};
return (
<>
<DxcContainer
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Both containers (L.21 and L.50) share the exact same props. Consider extracting a shared component to avoid duplication.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed

@@ -0,0 +1,70 @@
import { DxcButton, DxcContainer, DxcFlex, DxcGrid, DxcTypography, useToast } from "@dxc-technology/halstack-react";
import { Logos, Tokens } from "../types";
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Import paths are inconsistent: ReviewTokensGrid and ReviewTokensList use absolute paths while ReviewBrandingAssets and copyToClipboard use relative paths. For consistency, consider unifying to one style.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed.


const ReviewDetails = ({ generatedTokens, logos }: { generatedTokens: Tokens; logos: Logos }) => {
const toast = useToast();
const handleCopy = (value: string) => {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just as a comment: I think the same copyToClipboard + Toast pattern is used in the first step. If it ends up being needed in more places, it would be worth extracting it into a 'useCopyToClipboard' hook to centralise the logic.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I do like the idea I will work on it in the mean time I will first push a commit with the rest of the requested changes/feedback.

- Fixed and added some keys in maps
- Fixed capitalization in some labels/titles
- Avoided some redundancy creating components for repeated elements
- Changed some types' names
- Some other minor changes
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants