Skip to content

Thulasizwe/en/container container#3241

Merged
James-Baloyi merged 8 commits intoshesha-io:mainfrom
czwe-01:thulasizwe/en/container-container
May 14, 2025
Merged

Thulasizwe/en/container container#3241
James-Baloyi merged 8 commits intoshesha-io:mainfrom
czwe-01:thulasizwe/en/container-container

Conversation

@czwe-01
Copy link
Copy Markdown
Collaborator

@czwe-01 czwe-01 commented May 13, 2025

Summary by CodeRabbit

  • New Features

    • Added enhanced overflow and scrollbar styling options for panels, containers, and tabs, allowing for more flexible content display and improved appearance control.
    • Introduced support for hiding scrollbars across different browsers.
  • Refactor

    • Unified and streamlined overflow style handling across various components, consolidating related style logic for consistency.
    • Simplified panel header styling and removed obsolete context and properties for cleaner component structure.
    • Improved default background styling for panel headers.
    • Updated container and tab components to leverage new styling hooks and classes for better style management.
  • Chores

    • Updated interface definitions to support new overflow styling features and removed deprecated overflow properties from input styles.
    • Removed obsolete settings inputs and imports related to overflow and button types.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented May 13, 2025

Walkthrough

This change introduces a new overflow styling mechanism across several UI components. It adds an overflowStyle prop to panels, updates style hooks and utility functions to handle overflow and scrollbar visibility, and refactors components and style interfaces to centralize and standardize overflow-related styling. Some redundant overflow controls are removed.

Changes

File(s) Change Summary
src/components/panel/index.tsx Added overflowStyle prop to ICollapsiblePanelProps and updated CollapsiblePanel to accept and pass it to styles; removed panelHeadType from style hook parameters.
src/components/panel/styles/styles.ts
src/designer-components/tabs/styles.ts
Extended useStyles to accept and apply overflow styles; refactored CSS to use new overflow prop and explicitly set sizing; removed conditional styles based on panelHeadType.
src/designer-components/_settings/utils/overflow/util.tsx Introduced getOverflowStyle utility for generating cross-browser overflow and scrollbar styles with optional scrollbar hiding.
src/designer-components/button/buttonGroup/settingsForm.ts Removed overflow dropdown from button group settings and its related import.
src/designer-components/collapsiblePanel/collapsiblePanelComponent.tsx Removed PanelContext and related logic; simplified CollapsiblePanel usage; passed overflowStyle prop using model’s allStyles.overflowStyles.
src/designer-components/container/containerComponent.tsx Refactored to use new useStyles hook and classnames; applied overflowStyles and consolidated container styling; removed explicit width, height, and scrollbar styles from inline styles.
src/designer-components/container/data.ts Set default display to 'flex' and added a transparent background object in defaultStyles.
src/designer-components/container/styles.ts Added new useStyles hook for container component with thin scrollbar styling.
src/designer-components/tabs/index.tsx Removed explicit overflow and scrollbar props; now uses allStyles.overflowStyles for overflow handling in styles; removed inline style props related to overflow.
src/hooks/formComponentHooks.ts Updated useFormComponentStyles to compute and merge overflowStyles using new utility and model properties; included overflow and hideScrollBar in destructuring.
src/providers/dynamicActions/implementations/dataSourceDynamicMenu/entityDynamicMenuItem/entitySettings.ts Removed button type dropdown input from entity settings, replaced with a configurable action input; minor indentation adjustments.
src/providers/form/models.ts Moved overflow and hideScrollBar in IStyleType; removed overflow from IInputStyles; added overflowStyles to IFormComponentStyles.
src/components/storedFilesRendererBase/styles/styles.ts Replaced max-height: auto with explicit CSS custom properties for width and height constraints on container and upload list elements.
src/designer-components/collapsiblePanel/utils.ts Enhanced defaultHeaderStyles background object by adding repeat, position, and size properties for background rendering control.

Sequence Diagram(s)

sequenceDiagram
    participant Model
    participant useFormComponentStyles
    participant getOverflowStyle
    participant Component

    Model->>useFormComponentStyles: Provides overflow, hideScrollBar, and other style props
    useFormComponentStyles->>getOverflowStyle: Calls with overflow, hideScrollBar
    getOverflowStyle-->>useFormComponentStyles: Returns overflowStyles object
    useFormComponentStyles-->>Component: Returns allStyles including overflowStyles
    Component->>UI: Applies overflowStyles via props or style hooks
Loading

Possibly related PRs

  • Thulasizwe/en/panel #3217: Both PRs modify the useStyles function and related styling logic in src/components/panel/styles/styles.ts, focusing on panel styling adjustments including overflow and border styles.

Suggested reviewers

  • James-Baloyi

Poem

A hop and a skip, new styles in the air,
Overflow’s handled with careful flair.
Scrollbars now thin, or hidden from sight,
Panels and tabs dressed up just right.
Containers flex proudly, backgrounds so clear—
This rabbit approves, and gives a big cheer!
🐇✨

Tip

⚡️ Faster reviews with caching
  • CodeRabbit now supports caching for code and dependencies, helping speed up reviews. This means quicker feedback, reduced wait times, and a smoother review experience overall. Cached data is encrypted and stored securely. This feature will be automatically enabled for all accounts on May 16th. To opt out, configure Review - Disable Cache at either the organization or repository level. If you prefer to disable all data retention across your organization, simply turn off the Data Retention setting under your Organization Settings.

Enjoy the performance boost—your workflow just got faster.


📜 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 87b8ed2 and 6f3ca24.

📒 Files selected for processing (2)
  • shesha-reactjs/src/designer-components/collapsiblePanel/collapsiblePanelComponent.tsx (4 hunks)
  • shesha-reactjs/src/designer-components/tabs/styles.ts (4 hunks)
🚧 Files skipped from review as they are similar to previous changes (2)
  • shesha-reactjs/src/designer-components/collapsiblePanel/collapsiblePanelComponent.tsx
  • shesha-reactjs/src/designer-components/tabs/styles.ts
⏰ Context from checks skipped due to timeout of 90000ms (1)
  • GitHub Check: build-attempt
✨ Finishing Touches
  • 📝 Generate Docstrings

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share
🪧 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.
    • Explain this complex logic.
    • 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 explain this code block.
    • @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 explain its main purpose.
    • @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.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

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 generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @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.

@czwe-01 czwe-01 requested a review from James-Baloyi May 13, 2025 05:47
Copy link
Copy Markdown
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: 1

🧹 Nitpick comments (1)
shesha-reactjs/src/designer-components/collapsiblePanel/collapsiblePanelComponent.tsx (1)

56-57: Minor readability improvement in useFormComponentStyles call

The double spread ({ ...{ ...model.headerStyles ... } }) is redundant and slightly obscures the intent. A single-level spread is sufficient and makes the expression easier to scan.

-const headerStyles = useFormComponentStyles({ ...{ ...model.headerStyles, border: ghost ? null : model.headerStyles.border } }).fullStyle;
+const headerStyles = useFormComponentStyles({
+  ...model.headerStyles,
+  border: ghost ? null : model.headerStyles.border,
+}).fullStyle;
📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between 5f859c6 and 4ee5048.

📒 Files selected for processing (5)
  • shesha-reactjs/src/components/panel/index.tsx (2 hunks)
  • shesha-reactjs/src/components/panel/styles/styles.ts (6 hunks)
  • shesha-reactjs/src/components/storedFilesRendererBase/styles/styles.ts (2 hunks)
  • shesha-reactjs/src/designer-components/collapsiblePanel/collapsiblePanelComponent.tsx (4 hunks)
  • shesha-reactjs/src/designer-components/collapsiblePanel/utils.ts (1 hunks)
✅ Files skipped from review due to trivial changes (1)
  • shesha-reactjs/src/components/storedFilesRendererBase/styles/styles.ts
🚧 Files skipped from review as they are similar to previous changes (2)
  • shesha-reactjs/src/components/panel/styles/styles.ts
  • shesha-reactjs/src/components/panel/index.tsx
⏰ Context from checks skipped due to timeout of 90000ms (1)
  • GitHub Check: build-attempt
🔇 Additional comments (2)
shesha-reactjs/src/designer-components/collapsiblePanel/collapsiblePanelComponent.tsx (1)

68-90: overflowStyle may be undefined for legacy models – add a safe default

Older models migrated before the new overflow mechanism will not have model.allStyles.overflowStyles.
If CollapsiblePanel blindly spreads an undefined object into the style props it could cause:

  1. A runtime error if the implementation does ...overflowStyle.
  2. Missing styles while the user expects the panel to scroll.

Consider supplying a defensive fallback:

- overflowStyle={model.allStyles.overflowStyles}
+ overflowStyle={model.allStyles?.overflowStyles ?? { overflow: 'auto' }}

or let CollapsiblePanel itself handle the default internally.

Double-check other call-sites (designer preview, rendered runtime) to confirm none of them pass undefined today.

shesha-reactjs/src/designer-components/collapsiblePanel/utils.ts (1)

36-42: Verify that IStyleType.background accommodates repeat, position, and size keys

You extended the background style with repeat, position, and size. Please confirm that:

  1. IStyleType['background'] lists those properties, otherwise TypeScript will complain or consumers will silently ignore them.
  2. Down-stream utilities that stringify / transform style objects (e.g., CSS-in-JS converters) propagate the new keys; if they filter unknown fields, the extra props will be dropped.

If the interface is missing the fields, extend it first:

export interface IBackgroundStyle {
  type: 'color' | 'image';
  color?: string;
  url?: string;
  repeat?: 'repeat' | 'no-repeat';
  position?: string;
  size?: string;
}

Run tsc --noEmit (or your CI) to ensure the new interface satisfies all call-sites.

Copy link
Copy Markdown
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: 1

📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between 4ee5048 and 87b8ed2.

📒 Files selected for processing (1)
  • shesha-reactjs/src/designer-components/tabs/styles.ts (4 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (1)
  • GitHub Check: build-attempt
🔇 Additional comments (4)
shesha-reactjs/src/designer-components/tabs/styles.ts (4)

3-3: Function signature updated to support explicit overflow control

The useStyles function now accepts an overflow parameter, which aligns with centralizing overflow style handling across components. This change is consistent with the overarching goal of standardizing overflow styling.


35-40: Good refactoring for explicit dimension property extraction

Explicitly extracting dimension properties from the styles object improves code clarity and maintainability compared to using a generic rest operator. This change makes it clearer which specific dimension properties are being used.


81-87: Explicit dimension properties with card height adjustment

These explicit dimension properties with !important ensure consistent sizing and precedence. The height calculations that subtract the card height properly account for the tab header space.


113-118: Centralized overflow style application

Applying the overflow styles directly to the .ant-tabs-content selector is a good approach. It centralizes overflow handling and injects the passed overflow styles at the appropriate level in the DOM hierarchy.

@James-Baloyi James-Baloyi merged commit d99eafd into shesha-io:main May 14, 2025
2 checks passed
@coderabbitai coderabbitai bot mentioned this pull request May 20, 2025
@coderabbitai coderabbitai bot mentioned this pull request Aug 27, 2025
@coderabbitai coderabbitai bot mentioned this pull request Sep 25, 2025
@coderabbitai coderabbitai bot mentioned this pull request Jan 22, 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