feat: improve React Basic Catalog layout and update samples#1167
feat: improve React Basic Catalog layout and update samples#1167jacobsimionato wants to merge 2 commits intogoogle:mainfrom
Conversation
There was a problem hiding this comment.
Code Review
This pull request introduces significant updates to the UI styling and layout system, including the adoption of a 'gap' based layout for Rows and Columns, updated design tokens for borders and radii, and refined typography styles. While these changes improve the visual consistency, several issues were identified: the headerReset object in Text.tsx should be moved outside the component to avoid unnecessary re-creations on render, hardcoded style values in utils.ts should be extracted into constants for better maintainability, and several JSON example files contain formatting regressions where closing braces are incorrectly placed on the same line as properties.
| const headerReset: React.CSSProperties = { | ||
| margin: 0, | ||
| fontWeight: 600, | ||
| lineHeight: 1.2, | ||
| }; |
There was a problem hiding this comment.
| boxShadow: '0 4px 12px rgba(0, 0, 0, 0.05), 0 1px 2px rgba(0, 0, 0, 0.1)', | ||
| boxSizing: 'border-box', | ||
| backgroundColor: '#fff', |
There was a problem hiding this comment.
The boxShadow and backgroundColor values are hardcoded in getBaseContainerStyle. To maintain consistency with other design tokens in this file (like STANDARD_BORDER and STANDARD_RADIUS) and to facilitate easier theming or global updates in the future, these should be extracted into named constants at the top of the file.
| ], | ||
| "align": "center" | ||
| }, | ||
| "align": "center"}, |
There was a problem hiding this comment.
The closing brace for the object is placed on the same line as the last property. This deviates from the standard JSON formatting used throughout the repository and reduces readability. This pattern appears in several other places in this PR (e.g., lines 65, 87). Please ensure the JSON is properly formatted, ideally by using an auto-formatter as suggested in the style guide.
"align": "center"
},References
- Code should follow the relevant style guides, and use the correct auto-formatter, for each language. (link)
Description of Changes
This PR improves the visual quality and layout consistency of the React Basic Catalog renderer and updates several A2UI samples.
Renderer Changes (Basic Catalog)
gap: 12px) inRowandColumncomponents.h1-h5margins inText.tsxto prevent inconsistent vertical spacing caused by browser defaults.captionvariant with uppercase styling, better letter spacing, and reduced font size for better hierarchy.Cardshadows andSTANDARD_BORDERfor a more modern, professional look.Sample Improvements
captionvariant and ensured the main column stretches to fill the viewport.borderlessbutton variant.Rationale
The previous margin-based approach led to 'doubled' spacing between adjacent components. Moving to a centralized
gapmodel on containers and resetting child margins ensures clean alignment and consistent whitespace. The typography and aesthetic refinements bring the Basic Catalog output closer to a production-ready design system.Testing/Running Instructions