Skip to content

hidding panels ion filename type#3100

Merged
James-Baloyi merged 4 commits intoshesha-io:mainfrom
czwe-01:thulasizwe/en/fileList
Apr 3, 2025
Merged

hidding panels ion filename type#3100
James-Baloyi merged 4 commits intoshesha-io:mainfrom
czwe-01:thulasizwe/en/fileList

Conversation

@czwe-01
Copy link
Copy Markdown
Collaborator

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

Summary by CodeRabbit

  • New Features

    • Enabled primary color customization across several components, allowing users to tailor the theme.
    • Introduced a new color picker in attachments settings with a renamed tab for improved clarity.
  • Style

    • Enhanced styling to conditionally apply a custom primary color with a built-in fallback.
    • Streamlined border settings by removing unnecessary labels for a cleaner interface.
    • Improved button styling to ensure better layout and text handling.
    • Updated styles for buttons and toolbar elements to enhance display and text handling.
    • Removed maximum width constraint from toolbar button styles for improved layout flexibility.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Apr 2, 2025

Walkthrough

The pull request introduces an optional primaryColor property across multiple components, enhancing their styling capabilities. This property has been added to various interfaces, including ICustomFileProps, IStoredFilesRendererBaseProps, and IAttachmentsEditorProps. Additionally, the useStyles function in the stored files renderer has been updated to utilize this property with a fallback mechanism. Other changes include simplifications to the border utility by removing unnecessary labels and property names, and adjustments to settings inputs and styles in the attachments editor and button components.

Changes

File(s) Summary of Changes
shesha-reactjs/src/components/customFile/index.tsx
shesha-reactjs/src/components/storedFilesRendererBase/index.tsx
shesha-reactjs/src/designer-components/attachmentsEditor/attachmentsEditor.tsx
Added an optional primaryColor prop to component interfaces.
shesha-reactjs/.../storedFilesRendererBase/styles/styles.ts Updated useStyles to accept a primaryColor parameter and apply custom styling with a fallback to token.colorPrimary.
shesha-reactjs/.../attachmentsEditor/settings.ts Changed tab title from "Display" to "Common", added a new "Primary Color" settings input, and conditionally hid several panels based on data?.listType.
shesha-reactjs/.../border/utils.tsx Removed the tooltip input label and property name for the border icon by updating the getBorderInputs function.
shesha-reactjs/src/components/mainLayout/styles/indexStyles.ts Removed max-width: 100%; from the .sha-toolbar-btn-configurable class.
shesha-reactjs/src/components/mainLayout/styles/styles.ts Added a stray character 'z' after the width definition in the .layout-sider-children class.
shesha-reactjs/src/designer-components/button/configurableButton/index.tsx Added import for useStyles and updated className to use dynamic styles.
shesha-reactjs/src/designer-components/button/configurableButton/style.ts Introduced a new file defining styles for the configurable button component.
shesha-reactjs/src/designer-components/button/util.ts Updated maxWidth from 'auto' to '100%' in the defaultStyles function.
shesha-reactjs/src/designer-components/propertiesTabs/style.ts Removed a line defining styles for .ant-tabs-tab and .ant-tabs-nav-operations classes.

Sequence Diagram(s)

sequenceDiagram
    participant UI as Settings/UI
    participant AE as AttachmentsEditor
    participant SFR as StoredFilesRendererBase
    participant S as Styles Module

    UI->>AE: Provide primaryColor value
    AE->>SFR: Forward primaryColor prop
    SFR->>S: Call useStyles(primaryColor)
    S-->>SFR: Return computed styles (custom or default)
Loading

Possibly related PRs

Suggested reviewers

  • James-Baloyi

Poem

I'm a coding rabbit with a joyful cheer,
Hopping through components, bringing colors near.
A new "primaryColor" lights up the code,
With styles that switch, in a smooth abode.
In this digital garden, my heart does dance,
Embracing changes with a happy prance! 🐇🌈


📜 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 3eba27b and a80d85f.

📒 Files selected for processing (2)
  • shesha-reactjs/src/designer-components/_settings/utils/border/utils.tsx (1 hunks)
  • shesha-reactjs/src/designer-components/propertiesTabs/style.ts (0 hunks)
💤 Files with no reviewable changes (1)
  • shesha-reactjs/src/designer-components/propertiesTabs/style.ts
🚧 Files skipped from review as they are similar to previous changes (1)
  • shesha-reactjs/src/designer-components/_settings/utils/border/utils.tsx
⏰ Context from checks skipped due to timeout of 90000ms (1)
  • GitHub Check: build-and-test

🪧 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 13:08
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 695c2fe and d7ca5c5.

📒 Files selected for processing (6)
  • shesha-reactjs/src/components/customFile/index.tsx (1 hunks)
  • shesha-reactjs/src/components/storedFilesRendererBase/index.tsx (3 hunks)
  • shesha-reactjs/src/components/storedFilesRendererBase/styles/styles.ts (3 hunks)
  • shesha-reactjs/src/designer-components/_settings/utils/border/utils.tsx (2 hunks)
  • shesha-reactjs/src/designer-components/attachmentsEditor/attachmentsEditor.tsx (1 hunks)
  • shesha-reactjs/src/designer-components/attachmentsEditor/settings.ts (7 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (1)
  • GitHub Check: build-and-test
🔇 Additional comments (10)
shesha-reactjs/src/designer-components/_settings/utils/border/utils.tsx (1)

158-160:

Details

❓ Verification inconclusive

Simplified tooltip configuration without label and property name.

Removing the label and property name from the tooltip input simplifies the component, but ensure this doesn't break any code that might rely on these properties elsewhere.


🏁 Script executed:

#!/bin/bash
# Check if there are any references to 'borderIcon' property that might be affected by its removal
rg "borderIcon" --type tsx --type ts

Length of output: 64


I'll run a new shell script that searches for occurrences of "borderIcon" in TypeScript and TSX files using file glob patterns instead of file-type flags:


🏁 Script executed:

#!/bin/bash
# Search for occurrences of "borderIcon" in .tsx and .ts files using glob patterns
rg "borderIcon" -g "*.tsx" -g "*.ts"

Length of output: 185


Simplified tooltip configuration appears safe—but manual confirmation is needed.

  • In shesha-reactjs/src/designer-components/_settings/utils/border/utils.tsx (lines 158–160), the tooltip’s label and propertyName have been removed to simplify the component.
  • An automated search for "borderIcon" (as referenced in the original verification command) did not conclusively find any dependent usages. However, due to file filtering issues in the search (i.e. “No files were searched”), please manually verify that no other parts of the codebase rely on these tooltip properties.
shesha-reactjs/src/components/customFile/index.tsx (1)

30-30: Added primaryColor property for component theming.

The addition of the optional primaryColor property enhances customizability. Make sure this is used consistently across the codebase.

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

48-48:

Details

❓ Verification inconclusive

Added primaryColor property consistent with other components.

The addition of the primaryColor property maintains consistency with the changes in the CustomFile component. However, I don't see where this property is actually used in the AttachmentsEditor component implementation.


🏁 Script executed:

#!/bin/bash
# Check how primaryColor is being utilized in the AttachmentsEditor component
rg "primaryColor" --type tsx --type ts "shesha-reactjs/src/designer-components/attachmentsEditor"

Length of output: 123


Below is a revised review comment that reflects the findings based on our verification attempts. Note that the previous automated search using rg with file type filters failed, so please manually verify that any intended usage of primaryColor in the AttachmentsEditor component is correctly implemented (for example, by checking if it’s passed to child components or used for styling).

Action: Verify Usage of primaryColor Property

  • The property primaryColor was added for consistency with the CustomFile component.
  • Automated searches did not reveal any explicit usage of primaryColor within AttachmentsEditor.
  • Please confirm whether this property should be integrated into the component’s rendering (e.g., applied to styling or passed to children) or if it may be removed if it isn’t needed.
shesha-reactjs/src/components/storedFilesRendererBase/index.tsx (3)

70-70: Added primaryColor property for component theming.

Adding the primaryColor property to the interface enhances the component's customizability.


91-91: Properly destructured primaryColor from props.

The property is correctly destructured from the component props.


164-165:

Details

❓ Verification inconclusive

Passed primaryColor to the useStyles hook for styling.

The primaryColor is now properly passed to the useStyles hook, enabling dynamic styling based on this property. However, I don't see a corresponding update to the styles.ts file to use this parameter.


🏁 Script executed:

#!/bin/bash
# Check if the useStyles function in styles.ts has been updated to handle primaryColor
cat shesha-reactjs/src/components/storedFilesRendererBase/styles/styles.ts | grep -A 20 "useStyles"

# Check for primaryColor usage in any style definitions
rg "primaryColor" --type tsx --type ts "shesha-reactjs/src/components/storedFilesRendererBase/styles"

Length of output: 330


Below is an updated review comment based on the verification so far. Note that the expected file at
shesha-reactjs/src/components/storedFilesRendererBase/styles/styles.ts wasn’t found, and no occurrences of
primaryColor in any styling definitions were detected. This raises a concern that either the styles have been moved/renamed or they haven’t been updated to make use of the passed property.

Before final approval, please manually verify that the file handling styles for this component is being updated to use the primaryColor value. For instance:

  • Confirm whether the styling module (or an equivalent file) that defines the useStyles hook has been updated to handle the primaryColor parameter.
  • If the styles were moved or renamed, update the file reference or integrate the primaryColor usage accordingly.

Action Required: Double-check the styling integration for primaryColor to ensure it impacts the component as intended.

shesha-reactjs/src/designer-components/attachmentsEditor/settings.ts (3)

22-22: Improved tab title for better clarity.

The tab title change from "Display" to "Common" better represents the content of this tab, especially with the addition of the new primaryColor setting.


358-364: Good addition of the primaryColor property.

The new color picker setting allows for dynamic styling through component interfaces, enhancing the customization capabilities of the component.


377-377: Appropriate conditional display of style panels.

The hidden property ensures that the style panels (dimensions, border, background, shadow, and custom styles) are only visible when the list type is "thumbnail", which is logical since these styling options are primarily relevant for thumbnail views.

Also applies to: 464-464, 507-507, 673-673, 740-740

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

3-3: Good addition of primaryColor parameter to useStyles.

The function signature update enables the component to receive and utilize a custom primary color for styling.

@James-Baloyi James-Baloyi merged commit 07e9c36 into shesha-io:main Apr 3, 2025
2 of 4 checks passed
@coderabbitai coderabbitai bot mentioned this pull request Nov 12, 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