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

fix(web): add missing "extended" prop to plugin #1325

Merged
merged 1 commit into from
Dec 24, 2024

Conversation

mulengawilfred
Copy link
Contributor

@mulengawilfred mulengawilfred commented Dec 23, 2024

Overview

Adding this prop so that its possible to use "extended" feature for plugin.

What I've done

After applying the change in this PR, I tested my changing the values in reearth.yml file in the My Plugin folder in the Plugin Playground as below

id: my-plugin
name: My plugin
version: 1.0.0
extensions:
  - id: demo-widget
    type: widget
    name: Demo Widget
    description: Demo widget
    widgetLayout:
      extended: true
      defaultLocation:
        zone: outer
        section: left
        area: middle  

In the changes above, the extended: true value is added and the area is changed to middle. I also made these changes in the demo-widget.js file to test:

 html,
  body {
    width: 300px;
    height: 100%;
  }

And to the wrapper class, I added height: 100%;

Below is a screenshot of the change in plugin playground
Screenshot 2024-12-23 at 10 52 50 AM

And here is a screenshot of the change in editor. I noticed that on editor, the plugin didn't take the full height on inital load but only after re-sizing the browser screen (i.e opening the browser console )
Screenshot 2024-12-23 at 11 48 13 AM

What I haven't done

How I tested

Which point I want you to review particularly

Memo

Summary by CodeRabbit

  • New Features
    • Introduced a new extended property to enhance widget configuration options.
  • Bug Fixes
    • Improved widget object construction to include the extended state without affecting existing functionality.

Copy link

coderabbitai bot commented Dec 23, 2024

Walkthrough

The pull request introduces an extended boolean property to the widgetLayout type within the ReearthYML structure in the hook.ts file. This new property defaults to false and is integrated into the executeCode function, allowing for additional configuration of widget objects. The change enhances the widget configuration by providing a new optional flag that can be used to modify widget behavior or appearance.

Changes

File Change Summary
web/src/beta/features/PluginPlayground/Code/hook.ts Added extended: boolean to widgetLayout type in ReearthYML structure; modified executeCode function to include extended property when creating widget objects

Possibly related PRs

Suggested labels

web

Suggested reviewers

  • mkumbobeaty
  • airslice

Poem

🐰 A widget's tale of extension bright,
With extended flag now taking flight,
Boolean whispers of config's might,
In code's domain, a rabbit's delight!
New possibilities take their height 🚀

Tip

CodeRabbit's docstrings feature is now available as part of our Early Access Program! Simply use the command @coderabbitai generate docstrings to have CodeRabbit automatically generate docstrings for your pull request. We would love to hear your feedback on Discord.


Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

❤️ 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.
    • 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.

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.

Copy link

netlify bot commented Dec 23, 2024

Deploy Preview for reearth-web ready!

Name Link
🔨 Latest commit 43e4c5c
🔍 Latest deploy log https://app.netlify.com/sites/reearth-web/deploys/676924b99a68dd0008ed4c4d
😎 Deploy Preview https://deploy-preview-1325--reearth-web.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

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 (1)
web/src/beta/features/PluginPlayground/Code/hook.ts (1)

21-21: Add clarity on the “extended” property usage.

Consider adding a short comment in the type definition to describe how this property should be used and its expected effects in the widget’s behavior.

📜 Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 769a278 and 43e4c5c.

📒 Files selected for processing (1)
  • web/src/beta/features/PluginPlayground/Code/hook.ts (3 hunks)
🔇 Additional comments (2)
web/src/beta/features/PluginPlayground/Code/hook.ts (2)

148-149: Good use of optional chaining and fallback.

This approach gracefully handles cases where “extended” is omitted from the YAML by defaulting to false.


168-169: Property placement looks correct.

Including the “extended” flag in the widget object is consistent with how other widget properties are stored and passed along.

@mulengawilfred mulengawilfred changed the title fix: add missing "extended" prop to plugin fix(web): add missing "extended" prop to plugin Dec 23, 2024
@mulengawilfred mulengawilfred merged commit b422148 into main Dec 24, 2024
26 checks passed
@mulengawilfred mulengawilfred deleted the fix/add-extended-prop-to-plugin branch December 24, 2024 07:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants