-
Notifications
You must be signed in to change notification settings - Fork 75
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: move icon to be next to label if present in StudioDisplayTile
#14451
Conversation
Warning There were issues while running some tools. Please review the errors and either fix the tool’s configuration or disable the tool if it’s a critical failure. 🔧 eslint
frontend/libs/studio-components/src/components/StudioDisplayTile/StudioDisplayTile.module.cssOops! Something went wrong! :( ESLint: 8.57.1 ESLint couldn't find the plugin "eslint-plugin-storybook". (The package "eslint-plugin-storybook" was not found when loaded as a Node module from the directory "/frontend/libs/studio-components".) It's likely that the plugin isn't installed correctly. Try reinstalling by running the following:
The plugin "eslint-plugin-storybook" was referenced from the config file in "frontend/libs/studio-components/.eslintrc.js". If you still can't figure out the problem, please stop by https://eslint.org/chat/help to chat with the team. 📝 WalkthroughWalkthroughThe pull request modifies the Changes
Possibly related PRs
Suggested labels
Suggested reviewers
📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (3)
💤 Files with no reviewable changes (1)
🚧 Files skipped from review as they are similar to previous changes (2)
⏰ Context from checks skipped due to timeout of 90000ms (4)
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
StudioDisplayTile
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🧹 Nitpick comments (2)
frontend/libs/studio-components/src/components/StudioDisplayTile/StudioDisplayTile.module.css (1)
13-15
: LGTM! Consider adding focus styles for accessibility.The flexbox layout is a good choice for aligning the icon with the label. The use of CSS variables for spacing maintains consistency with the design system.
Consider adding focus styles to improve accessibility when navigating with keyboard:
.label { display: flex; align-items: center; gap: var(--fds-spacing-1); font-weight: 500; + &:focus-within { + outline: 2px solid var(--fds-focus-border-color); + outline-offset: 2px; + } }frontend/libs/studio-components/src/components/StudioDisplayTile/StudioDisplayTile.tsx (1)
32-33
: LGTM! Consider prop for icon spacing.The icon placement inside Label works well with the flexbox layout.
Consider adding an optional prop to control icon spacing for cases where different gaps might be needed:
export type StudioDisplayTileProps = { icon?: React.ReactNode; label: string; value: string; showPadlock?: boolean; + iconSpacing?: 'small' | 'medium' | 'large'; } & HTMLAttributes<HTMLDivElement>;
Then use it in the Label's style:
<Label size='small' - className={classes.label} + className={cn(classes.label, { + [classes.iconSpacingSmall]: iconSpacing === 'small', + [classes.iconSpacingMedium]: iconSpacing === 'medium', + [classes.iconSpacingLarge]: iconSpacing === 'large', + })} >
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (2)
frontend/libs/studio-components/src/components/StudioDisplayTile/StudioDisplayTile.module.css
(1 hunks)frontend/libs/studio-components/src/components/StudioDisplayTile/StudioDisplayTile.tsx
(1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (2)
- GitHub Check: Build environment and run e2e test
- GitHub Check: Testing
🔇 Additional comments (1)
frontend/libs/studio-components/src/components/StudioDisplayTile/StudioDisplayTile.tsx (1)
26-26
: LGTM! Clean class name assignment.The simplified className assignment improves code readability.
cbc68a4
to
f92e6bf
Compare
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #14451 +/- ##
==========================================
- Coverage 95.69% 95.69% -0.01%
==========================================
Files 1889 1889
Lines 24573 24572 -1
Branches 2822 2821 -1
==========================================
- Hits 23515 23514 -1
Misses 799 799
Partials 259 259 ☔ View full report in Codecov by Sentry. |
StudioDisplayTile
StudioDisplayTile
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Test OK 🚀
Description
move icon to be next to label if precent for
StudioDisplayTile
.This is how it looks for all cases:
Prefix icon and lock

only prefix icon

Only lock icon

No icons

Related Issue(s)
StudioDisplayTile
to align withStudioToggleableTextfield
design #14401Verification
Summary by CodeRabbit