Skip to content

Thulasizwe/en/button group#3096

Merged
James-Baloyi merged 4 commits intoshesha-io:mainfrom
czwe-01:thulasizwe/en/button-group
Apr 2, 2025
Merged

Thulasizwe/en/button group#3096
James-Baloyi merged 4 commits intoshesha-io:mainfrom
czwe-01:thulasizwe/en/button-group

Conversation

@czwe-01
Copy link
Copy Markdown
Collaborator

@czwe-01 czwe-01 commented Apr 2, 2025

Summary by CodeRabbit

  • New Features

    • Introduced a "No Default Styling" option for container components with an associated toggle, streamlining the interface by removing redundant positioning settings.
  • Style

    • Simplified thumbnail sizing and updated default border appearance for a more consistent visual display.
    • Standardized label casing for directional and positioning options.
    • Enhanced input field display by falling back to label text when tooltips aren’t provided.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Apr 2, 2025

Walkthrough

This pull request streamlines several UI and styling elements. It simplifies the CSS logic for thumbnail dimensions, adjusts option label casing, and introduces a new noDefaultStyling property in container components with corresponding settings updates. Default border styles are updated, and the InputComponent now falls back on an alternative label for tooltips. Overall, the changes reduce code complexity and provide enhanced configuration options.

Changes

File(s) Change Summary
shesha-reactjs/src/components/.../styles.ts Simplified CSS variable logic for thumbnail dimensions and added explicit width/height to .ant-upload-list-item.
shesha-reactjs/src/designer-components/_settings/.../utils.tsx Adjusted option arrays by changing labels from capitalized to lowercase for gradientDirectionOptions and positionOptions.
shesha-reactjs/src/designer-components/container/... Introduced noDefaultStyling property in ComponentsContainer; updated default border values in defaultStyles; added a new settings input while removing positioning settings panel.
shesha-reactjs/src/designer-components/inputComponent/index.tsx Modified addonAfter prop in InputComponent to fall back from tooltip to label if tooltip is not provided.

Sequence Diagram(s)

sequenceDiagram
    participant U as User
    participant S as SettingsForm
    participant C as ContainerComponent
    participant R as Renderer

    U->>S: Toggle "No Default Styling" switch
    S->>C: Update model with noDefaultStyling flag
    C->>R: Render container with/without default styling
Loading

Suggested reviewers

  • James-Baloyi

Poem

I'm a rabbit hopping through the code,
Where changes sprout like carrots in a row.
Styles refined and settings anew,
I nibble on updates, joyful and true.
With each little tweak, my heart does glow! 🐇✨


📜 Recent review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between 36a24ac and 25094e3.

📒 Files selected for processing (6)
  • shesha-reactjs/src/components/storedFilesRendererBase/styles/styles.ts (2 hunks)
  • shesha-reactjs/src/designer-components/_settings/utils/background/utils.tsx (2 hunks)
  • shesha-reactjs/src/designer-components/container/containerComponent.tsx (1 hunks)
  • shesha-reactjs/src/designer-components/container/data.ts (1 hunks)
  • shesha-reactjs/src/designer-components/container/settingsForm.ts (2 hunks)
  • shesha-reactjs/src/designer-components/inputComponent/index.tsx (1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (1)
  • GitHub Check: build-and-test
🔇 Additional comments (9)
shesha-reactjs/src/designer-components/_settings/utils/background/utils.tsx (2)

64-71: Caption case changed to sentence case in gradient direction options

The labels for gradient direction options have been adjusted from caption case to sentence case (e.g., "To Right" → "To right"). This improves consistency in the UI presentation.


117-120: Caption case changed to sentence case in position options

The labels for position options have been adjusted from caption case to sentence case (e.g., "Top Left" → "Top left"). This matches the style changes made to gradient direction options and improves UI consistency.

shesha-reactjs/src/designer-components/inputComponent/index.tsx (1)

144-144: Improved fallback for icon tooltip

Added label as a fallback when tooltip is not provided, enhancing the user experience by ensuring that informative text is displayed even when a tooltip is missing.

shesha-reactjs/src/designer-components/container/data.ts (1)

162-163: Updated default border styling

Changed default border style from 'solid' to 'none' and default border width from '0px' to '1px'. This is a sensible update that improves the initial container appearance by hiding borders by default while maintaining a standard width when borders are enabled.

shesha-reactjs/src/designer-components/container/containerComponent.tsx (1)

116-116: Added noDefaultStyling prop to ComponentsContainer

This change passes the noDefaultStyling property from the model to the ComponentsContainer component, allowing greater control over styling. This implementation correctly complements the existing defaultStyles function and styling logic.

shesha-reactjs/src/components/storedFilesRendererBase/styles/styles.ts (2)

22-23: Logical improvement to thumbnail width and height CSS variables

The logic for setting --thumbnail-width and --thumbnail-height has been simplified to use a consistent pattern. The updated approach provides a clearer fallback strategy: use the provided dimension when layout is true, otherwise use 100%.


55-56: Good consistency with adding explicit width/height to list items

The width and height properties have been added to the .ant-upload-list-item class using the same conditional logic as the CSS variables. This creates a more consistent styling approach across the component.

shesha-reactjs/src/designer-components/container/settingsForm.ts (2)

72-80: New option for disabling default styling

The addition of a "No Default Styling" switch input provides users with the ability to disable default styling in the container component. This is a useful enhancement for custom styling scenarios.


104-145: Commented out position settings panel

The positioning panel has been commented out, which removes the ability to configure position-related properties through the UI. Make sure this was intentional and doesn't negatively impact existing functionality.

Was this panel commented out because the positioning functionality is being deprecated, moved elsewhere, or replaced with a different approach? Consider adding a comment explaining why this code is commented rather than removed if it's temporary.

✨ Finishing Touches
  • 📝 Generate Docstrings

🪧 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.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai plan to trigger planning for file edits and PR creation.
  • @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.

@czwe-01 czwe-01 requested a review from James-Baloyi April 2, 2025 06:55
@James-Baloyi James-Baloyi merged commit 031c058 into shesha-io:main Apr 2, 2025
2 of 4 checks passed
This was referenced Nov 7, 2025
This was referenced Nov 24, 2025
@coderabbitai coderabbitai bot mentioned this pull request Jan 9, 2026
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.

2 participants