Skip to content

feat: Add custom CSS styling for info panel items #2788

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

Merged
merged 4 commits into from
May 6, 2025

Conversation

mtrezza
Copy link
Member

@mtrezza mtrezza commented May 6, 2025

New Pull Request Checklist

Issue Description

Adds custom CSS styling to info panel items.

Approach

  • Each item has a style property to which the style for the element can be defined in general.
  • Some items may have additional style properties like titleStyle which allows to style a specific HTML element within the item.

Example:

{
  "type": "text",
  "text": "This user has a high churn risk!",
  "style": { "backgroundColor": "red" },
}

TODOs before merging

  • Add changes to documentation (guides, repository pages, in-code descriptions)

Summary by CodeRabbit

  • New Features

    • Added support for custom CSS styling of info panel segments and items, allowing users to personalize the appearance of text, key-value, table, image, video, audio, button, and panel elements in the dashboard.
  • Documentation

    • Updated documentation to describe new style customization options for info panel configuration, including usage examples and improved formatting for clarity.

Copy link

parse-github-assistant bot commented May 6, 2025

🚀 Thanks for opening this pull request! We appreciate your effort in improving the project. Please let us know once your pull request is ready for review.

Copy link

coderabbitai bot commented May 6, 2025

Warning

Rate limit exceeded

@parseplatformorg has exceeded the limit for the number of commits or files that can be reviewed per hour. Please wait 29 minutes and 4 seconds before requesting another review.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

📥 Commits

Reviewing files that changed from the base of the PR and between 084fb9c and e5ff4ae.

📒 Files selected for processing (1)
  • README.md (13 hunks)
📝 Walkthrough

Walkthrough

The changes introduce support for custom inline CSS styling of info panel segments and items in Parse Dashboard. Documentation in README.md was updated to describe these new styling options. The AggregationPanel component and its subcomponents were modified to accept and apply optional style props, enabling users to customize the appearance of info panel elements via configuration.

Changes

File(s) Change Summary
README.md Documentation updated to describe new optional style and titleStyle fields for info panel segments and items. Examples and configuration parameter tables were revised for clarity and to demonstrate the new styling capabilities.
src/components/AggregationPanel/AggregationPanel.js Enhanced to accept a new optional style prop, applied to nested panel headers and propagated to segment containers, headings, and items. Segment and item-level styles are now supported and passed to subcomponents as appropriate.
src/components/AggregationPanel/AggregationPanelComponents.js All exported components (TextElement, KeyValueElement, TableElement, ImageElement, VideoElement, AudioElement, ButtonElement) now accept and apply an optional style prop to their root elements.

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant DashboardConfig
    participant AggregationPanel
    participant PanelComponent
    participant ItemComponent

    User->>DashboardConfig: Defines info panel with segments/items and style fields
    DashboardConfig->>AggregationPanel: Passes segments/items with style/titleStyle
    AggregationPanel->>PanelComponent: Renders segment containers with segment.style
    AggregationPanel->>PanelComponent: Renders headings with segment.titleStyle
    AggregationPanel->>ItemComponent: Renders each item with item.style
Loading

Possibly related PRs


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 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.

@mtrezza mtrezza changed the title feat: Add CSS styling to Info Panel items feat: Add CSS styling to info panel items May 6, 2025
@parseplatformorg
Copy link
Contributor

parseplatformorg commented May 6, 2025

🎉 Snyk checks have passed. No issues have been found so far.

security/snyk check is complete. No issues have been found. (View Details)

@mtrezza mtrezza changed the title feat: Add CSS styling to info panel items feat: Add custom CSS styling for info panel items May 6, 2025
Copy link

@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 (4)
README.md (1)

902-903: Fix typo in style example.

There's a typo in the example CSS property.

-        "style": { "backgroudColor": "lightgray", "font-size": "10px" },
+        "style": { "backgroundColor": "lightgray", "fontSize": "10px" },
src/components/AggregationPanel/AggregationPanelComponents.js (3)

26-28: Consider consistent style application location.

The style is applied to the <table> element rather than the root <div> as in other components. This is functional but inconsistent with the pattern used in other elements.

Consider applying the style to the root div for consistency:

export const TableElement = ({ columns, rows, style }) => (
-  <div className="table-element">
-    <table style={style}>
+  <div className="table-element" style={style}>
+    <table>

Alternatively, if styling the table directly is intentional, this could be kept as is.


59-61: Consider consistent style application location.

The style is applied to the <video> element rather than the root <div> as in other components like TextElement and ImageElement.

Consider applying the style to the root div for consistency:

export const VideoElement = ({ url, style }) => (
-  <div className="video-element">
-    <video controls className={styles.video} style={style}>
+  <div className="video-element" style={style}>
+    <video controls className={styles.video}>

Alternatively, if styling the video element directly is intentional, this could be kept as is.


69-71: Consider consistent style application location.

Similar to the VideoElement, the style is applied to the <audio> element rather than the root <div>.

Consider applying the style to the root div for consistency:

export const AudioElement = ({ url, style }) => (
-  <div className="audio-element">
-    <audio controls className={styles.audio} style={style}>
+  <div className="audio-element" style={style}>
+    <audio controls className={styles.audio}>

Alternatively, if styling the audio element directly is intentional, this could be kept as is.

📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between 3f10ef4 and 084fb9c.

📒 Files selected for processing (3)
  • README.md (13 hunks)
  • src/components/AggregationPanel/AggregationPanel.js (4 hunks)
  • src/components/AggregationPanel/AggregationPanelComponents.js (4 hunks)
🧰 Additional context used
🧬 Code Graph Analysis (1)
src/components/AggregationPanel/AggregationPanel.js (1)
src/components/AggregationPanel/AggregationPanelComponents.js (14)
  • TextElement (5-9)
  • TextElement (5-9)
  • KeyValueElement (12-23)
  • KeyValueElement (12-23)
  • TableElement (26-47)
  • TableElement (26-47)
  • ImageElement (50-56)
  • ImageElement (50-56)
  • VideoElement (59-66)
  • VideoElement (59-66)
  • AudioElement (69-76)
  • AudioElement (69-76)
  • ButtonElement (79-103)
  • ButtonElement (79-103)
⏰ Context from checks skipped due to timeout of 90000ms (1)
  • GitHub Check: Docker linux/amd64
🔇 Additional comments (12)
src/components/AggregationPanel/AggregationPanel.js (5)

29-29: LGTM: Added style prop to component signature.

The style prop has been added to the component parameters, which enables custom styling to be passed down from parent components.


96-97: LGTM: Style properties applied to segment container and heading.

Style properties are now applied to both the segment container and its heading, allowing for customization of individual segments and their titles.


102-115: LGTM: Added style prop to all item components.

Style props have been systematically added to all item components (TextElement, KeyValueElement, TableElement, etc.), ensuring consistent styling capabilities across the entire info panel.


131-131: LGTM: Added style prop to nested panel.

Style properties are now properly passed to nested AggregationPanel instances, allowing for consistent styling across the component hierarchy.


149-149: LGTM: Style applied to nested panel header.

The style prop is now properly applied to the nested panel header container, completing the styling support for all panel elements.

README.md (3)

129-147: LGTM: Improved table formatting for better readability.

The parameter table has been reformatted with consistent column alignment, improving readability of the documentation.


886-892: LGTM: Updated segments documentation with style properties.

The segments documentation now includes the new style and titleStyle properties, properly describing the CSS styling capabilities.


922-926: LGTM: Consistently documented style properties for all item types.

The style property has been consistently added to the documentation for all item types (text, keyValue, table, image, video, audio, button, panel).

Also applies to: 949-949, 1008-1008, 1047-1047, 1067-1067, 1087-1087, 1112-1112, 1143-1143

src/components/AggregationPanel/AggregationPanelComponents.js (4)

5-6: LGTM: Added style support to TextElement.

Style prop has been added to the TextElement component and applied to the root div element.


12-13: LGTM: Added style support to KeyValueElement.

Style prop has been added to the KeyValueElement component and applied to the root div element.


50-51: LGTM: Added style support to ImageElement.

Style prop has been added to the ImageElement component and applied to the root div element.


79-79: LGTM: Added style support to ButtonElement.

Style prop has been added to the ButtonElement component and applied to the button element, which is appropriate for this case since the styling should affect the actual button.

Also applies to: 98-98

coderabbitai[bot]
coderabbitai bot previously approved these changes May 6, 2025
@mtrezza mtrezza merged commit f031e5d into parse-community:alpha May 6, 2025
8 of 11 checks passed
@mtrezza mtrezza deleted the feat/add-style-to-info-panel branch May 6, 2025 00:34
parseplatformorg pushed a commit that referenced this pull request May 6, 2025
# [7.2.0-alpha.1](7.1.1-alpha.3...7.2.0-alpha.1) (2025-05-06)

### Features

* Add custom CSS styling for info panel items ([#2788](#2788)) ([f031e5d](f031e5d))
@parseplatformorg
Copy link
Contributor

🎉 This change has been released in version 7.2.0-alpha.1

@parseplatformorg parseplatformorg added the state:released-alpha Released as alpha version label May 6, 2025
@mtrezza mtrezza linked an issue May 12, 2025 that may be closed by this pull request
3 tasks
parseplatformorg pushed a commit that referenced this pull request Jun 1, 2025
# [7.2.0](7.1.0...7.2.0) (2025-06-01)

### Bug Fixes

* Data browser not scrolling to top when changing filter while cell selected ([#2821](#2821)) ([c2527dc](c2527dc))
* Data browser table shows loading indicator when info panel is loading ([#2782](#2782)) ([da57e5e](da57e5e))
* Improperly aligned unfolding sub-items in context menu in data browser ([#2726](#2726)) ([3fed292](3fed292))
* Notifications fade out erratically when executing a script on large number of rows ([#2822](#2822)) ([3891381](3891381))
* Pagination does not reset to page 1 when clicking on class or filter ([#2798](#2798)) ([29d1447](29d1447))
* Saving new filter in data browser overwrites filters added in other dashboard instances ([#2769](#2769)) ([46bc154](46bc154))
* Selecting a saved filter in data browser may highlight a different filter ([#2783](#2783)) ([4c6e853](4c6e853))

### Features

* Add confirmation dialog before saving a Cloud Config parameter that has been modified since editing it ([#2770](#2770)) ([adb9b5c](adb9b5c))
* Add custom CSS styling for info panel items ([#2788](#2788)) ([f031e5d](f031e5d))
* Add relative date filter in data browser for date constraints relative to when the query is run ([#2736](#2736)) ([d9dfd69](d9dfd69))
* Add script execution on parallel batches with option `script.executionBatchSize` ([#2828](#2828)) ([cee8b8d](cee8b8d))
* Keyboard Enter key can be used to select item in data browser filter dialog field dropdown ([#2771](#2771)) ([dc14710](dc14710))
@parseplatformorg
Copy link
Contributor

🎉 This change has been released in version 7.2.0

@parseplatformorg parseplatformorg added the state:released Released as stable version label Jun 1, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
state:released Released as stable version state:released-alpha Released as alpha version
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Custom colors in info panel
2 participants