Skip to content
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

feat(UserGuide): replace elementStyles with elementClassName and add classname to the step #1593

Merged
merged 3 commits into from
Feb 25, 2025

Conversation

JoannaSikora
Copy link
Contributor

@JoannaSikora JoannaSikora commented Feb 24, 2025

Resolves: # n/a

Description

The main updates involve:

  • replacing the elementStyles prop with elementClassName for better styling management
  • added classname prop to UserGuideStep

Storybook

https://feature-userguide-styles-fix--613a8e945a5665003a05113b.chromatic.com

Checklist

Obligatory:

  • Self review (use this as your final check for proposed changes before requesting the review)
  • Add correct label
  • Assign pull request with the correct issue

Summary by CodeRabbit

  • New Features

    • Introduced a new highlighted appearance for guidance elements with refined visual properties such as rounded corners, shadow effects, and background enhancements.
    • Added a new prop to the UserGuideStep component for additional styling customization.
  • Style

    • Updated the user guide’s styling mechanism to use predefined CSS classes instead of inline styles for improved consistency.
    • Adjusted z-index properties for better layering and visibility of the User Guide component.
    • Made minor text adjustments to ensure uniform typography in guidance content.

Copy link
Contributor

coderabbitai bot commented Feb 24, 2025

Walkthrough

The changes update the styling approach of the UserGuide components. The inline style property (elementStyles) has been replaced by a class name property (elementClassName) in the state, props, and interface. This update affects the reducer, the rendering logic of cloned elements, and the dependency management. Additionally, text in UserGuideStep components has been modified to use straight quotes, and a new CSS class has been added for highlighted elements.

Changes

File(s) Change Summary
packages/react-components/src/components/UserGuide/UserGuide.stories.tsx, packages/react-components/src/components/UserGuide/UserGuide.tsx, packages/react-components/src/components/UserGuide/types.ts Replaced elementStyles with elementClassName across state, props, and interfaces. Updated reducer logic, dependency arrays, and rendering methods; adjusted apostrophe style in UserGuideStep components.
packages/react-components/src/components/UserGuide/UserGuideStories.css Added new CSS class .element-highlighted with styles for border radius, box shadow, background color, and nested svg color.
packages/react-components/src/components/UserGuide/components/UserGuideStep/UserGuideStep.tsx, packages/react-components/src/components/UserGuide/components/UserGuideStep/types.ts Introduced new className prop to UserGuideStep component and updated interface to include className.

Possibly related PRs

  • fix(UserGuide): fix sizing for images and videos #1532 – The changes in the main PR are related to the modifications of the elementStyles and elementClassName properties in the UserGuide component, which are also reflected in the UserGuideStep component's styling updates in the retrieved PR.
  • fix(UserGuide): add animation and transition duration examples #1582 – The changes in the main PR are related to the modifications of the elementStyles property to elementClassName in the UserGuide component, which aligns with the introduction of the UserGuideBubbleStepExampleWithAnimation component in the retrieved PR that also deals with user guide animations.

Suggested labels

documentation

Suggested reviewers

  • vladko-uxds

🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

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)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR. (Beta)
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@JoannaSikora JoannaSikora marked this pull request as ready for review February 24, 2025 12:58
@JoannaSikora JoannaSikora added the bug Something isn't working label Feb 24, 2025
@JoannaSikora JoannaSikora changed the title feat(UserGuide): replace elementStyles with elementClassName feat(UserGuide): replace elementStyles with elementClassName and add classname to the step Feb 25, 2025
@JoannaSikora JoannaSikora added feature New feature or request and removed bug Something isn't working labels Feb 25, 2025
Copy link
Contributor

@coderabbitai coderabbitai bot left a 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)
packages/react-components/src/components/UserGuide/UserGuide.module.scss (1)

51-51: Floating Z-index Magic Number
The hardcoded value 10001 guarantees the floating element appears above others. Consider introducing a SCSS variable for clarity and maintainability if this value needs to be reused or adjusted later.

packages/react-components/src/components/UserGuide/UserGuide.mdx (1)

69-69: Refine Styling Documentation Text
The sentence could be rephrased to avoid a split infinitive. Consider: "The component lets you style the highlighted element easily by passing a custom className."

🧰 Tools
🪛 LanguageTool

[style] ~69-~69: Style-wise, it’s not ideal to insert an adverb (‘easily’) in the middle of an infinitive construction (‘to style’). Try moving the adverb to avoid split infinitives.
Context: ...ted element Component allows to easily style the highlighted element by passing a custom className. To do th...

(SPLIT_INFINITIVE)


[style] ~69-~69: Consider a more expressive alternative.
Context: ...ement by passing a custom className. To do this, you need to provide the `UserGuid...

(DO_ACHIEVE)

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 6bf34a6 and 872498e.

📒 Files selected for processing (2)
  • packages/react-components/src/components/UserGuide/UserGuide.mdx (3 hunks)
  • packages/react-components/src/components/UserGuide/UserGuide.module.scss (2 hunks)
🧰 Additional context used
🪛 LanguageTool
packages/react-components/src/components/UserGuide/UserGuide.mdx

[style] ~69-~69: Style-wise, it’s not ideal to insert an adverb (‘easily’) in the middle of an infinitive construction (‘to style’). Try moving the adverb to avoid split infinitives.
Context: ...ted element Component allows to easily style the highlighted element by passing a custom className. To do th...

(SPLIT_INFINITIVE)


[style] ~69-~69: Consider a more expressive alternative.
Context: ...ement by passing a custom className. To do this, you need to provide the `UserGuid...

(DO_ACHIEVE)

⏰ Context from checks skipped due to timeout of 90000ms (2)
  • GitHub Check: build
  • GitHub Check: chromatic-deployment
🔇 Additional comments (5)
packages/react-components/src/components/UserGuide/UserGuide.module.scss (1)

29-29: Overlay Z-index Update
Changing the overlay’s z-index to $stacking-context-level-modal aligns it with modal stacking; ensure this fits overall stacking context expectations.

packages/react-components/src/components/UserGuide/UserGuide.mdx (4)

42-42: Prop Name Change Verified
The elementClassName prop now correctly replaces the old inline style prop. This update is in line with the intended design improvements.


74-74: Consistent Code Snippet Styling
The code snippet now uses elementClassName as intended. Ensure all usage examples mirror this update across documentation.


90-91: Quotation Mark Consistency in Example
The text for UserGuideStep now uses straight quotes consistently. This improves readability and consistency in the documentation.


79-79: Dynamic Class Management Explanation
The added note on state management for dynamic class names is clear. Verify that the language matches your design system terminology.

@JoannaSikora JoannaSikora merged commit 46c60fe into main Feb 25, 2025
7 checks passed
@JoannaSikora JoannaSikora deleted the feature/userguide-styles-fix branch February 25, 2025 10:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants