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

feat(web): plugin playground presets sidebar #1315

Merged
merged 2 commits into from
Dec 16, 2024

Conversation

OpeDada
Copy link
Contributor

@OpeDada OpeDada commented Dec 13, 2024

Overview

What I've done

What I haven't done

How I tested

Which point I want you to review particularly

Memo

Summary by CodeRabbit

  • New Features

    • Introduced a categorized structure for displaying plugins, enhancing organization.
    • Added a dedicated section for shared plugins.
    • Launched a new sidebar plugin with UI behavior and configuration options.
    • Enhanced the "UI" category by including the sidebar plugin in the preset plugins.
  • Bug Fixes

    • Ensured unique keys for plugin rendering to improve performance.
  • Documentation

    • Updated type definitions for better clarity on plugin categories and structure.

Copy link

coderabbitai bot commented Dec 13, 2024

Walkthrough

The changes in this pull request involve modifications to the Plugins component, including the addition of sharedPlugins to the UsePluginsReturn type. The rendering logic has been updated to categorize plugins, enhancing their organization. A new sidebar plugin has been introduced, which includes metadata and UI behavior. Additionally, the presetPlugins constant has been updated to include the new sidebar plugin under the "UI" category.

Changes

File Path Change Summary
web/src/beta/features/PluginPlayground/Plugins/index.tsx Updated UsePluginsReturn type to include sharedPlugins. Modified rendering logic to categorize plugins and added a section for sharedPlugins.
web/src/beta/features/PluginPlayground/Plugins/presets/index.ts Updated presetPlugins to include sidebar in the "UI" category.
web/src/beta/features/PluginPlayground/Plugins/presets/ui/sidebar.ts Introduced a new sidebar plugin with yamlFile and widgetFile, defining metadata and UI behavior for the sidebar.

Possibly related PRs

Suggested reviewers

  • mkumbobeaty
  • airslice
  • m-abe-dev
  • ZTongci

🐰 In the plugin playground, we hop and play,
With shared plugins brightening our day.
Categories now, so neat and fine,
In the sidebar, our widgets align.
Let's code and create, with joy we'll sing,
For each little plugin, new wonders we bring! 🎉

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. This feature will be included in our Pro Plan when released.


📜 Recent review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between 9942f11 and 09a0de8.

📒 Files selected for processing (3)
  • web/src/beta/features/PluginPlayground/Plugins/index.tsx (1 hunks)
  • web/src/beta/features/PluginPlayground/Plugins/presets/index.ts (2 hunks)
  • web/src/beta/features/PluginPlayground/Plugins/presets/ui/sidebar.ts (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (3)
  • web/src/beta/features/PluginPlayground/Plugins/presets/index.ts
  • web/src/beta/features/PluginPlayground/Plugins/index.tsx
  • web/src/beta/features/PluginPlayground/Plugins/presets/ui/sidebar.ts

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.

@github-actions github-actions bot requested a review from m-abe-dev December 13, 2024 06:06
Copy link

netlify bot commented Dec 13, 2024

Deploy Preview for reearth-web canceled.

Name Link
🔨 Latest commit 09a0de8
🔍 Latest deploy log https://app.netlify.com/sites/reearth-web/deploys/675f26082054180008b29bfb

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: 4

🧹 Outside diff range and nitpick comments (4)
web/src/beta/features/PluginPlayground/Plugins/presets/ui/responsivePanel.ts (2)

4-23: Consider enhancing the plugin metadata

The YAML configuration could benefit from additional metadata fields such as:

  • description: To provide more context about the plugin's purpose
  • author: To identify the maintainer
  • repository: To link to the source code

31-74: Improve CSS maintainability with custom properties

Consider using CSS custom properties for colors and spacing to improve maintainability:

+    :root {
+      --color-text: #36454F;
+      --color-border: #ccc;
+      --color-background: #fff;
+      --spacing-unit: 8px;
+      --border-radius: 4px;
+    }

     li {
-      margin: 8px 0;
-      padding: 12px 16px;
-      color: #36454F;
-      background: #fff;
-      border: 1px solid #ccc;
-      border-radius: 4px;
+      margin: var(--spacing-unit) 0;
+      padding: calc(1.5 * var(--spacing-unit)) calc(2 * var(--spacing-unit));
+      color: var(--color-text);
+      background: var(--color-background);
+      border: 1px solid var(--color-border);
+      border-radius: var(--border-radius);
web/src/beta/features/PluginPlayground/Plugins/usePlugins.ts (2)

7-8: Consider memoizing the flattened plugins array.

While the current implementation works well for static presets, if presetPlugins becomes dynamic in the future, consider moving the flattening operation to a useMemo hook for better performance.

+ const flattenedPlugins = useMemo(
+   () => presetPlugins.map((category) => category.plugins).flat(),
+   [presetPlugins]
+ );
- const [plugins, setPlugins] = useState<PluginType[]>(
-   presetPlugins.map((category) => category.plugins).flat()
- );
+ const [plugins, setPlugins] = useState<PluginType[]>(flattenedPlugins);

Also applies to: 12-14


Line range hint 1-214: Well-structured hook with good separation of concerns.

The hook demonstrates good practices:

  • Consistent error handling with notifications
  • Proper memoization of callbacks
  • Atomic file operations
  • Clear separation between plugin and file management

Consider documenting the expected plugin structure with TypeScript interfaces or JSDoc comments for better maintainability.

📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between 3432cde and 6e8055b.

📒 Files selected for processing (14)
  • web/src/beta/features/PluginPlayground/Code/HtmlEditModal.tsx (2 hunks)
  • web/src/beta/features/PluginPlayground/Code/hook.ts (1 hunks)
  • web/src/beta/features/PluginPlayground/Code/index.tsx (0 hunks)
  • web/src/beta/features/PluginPlayground/Console/index.tsx (2 hunks)
  • web/src/beta/features/PluginPlayground/Plugins/FileListItem.tsx (2 hunks)
  • web/src/beta/features/PluginPlayground/Plugins/constants.ts (0 hunks)
  • web/src/beta/features/PluginPlayground/Plugins/index.tsx (4 hunks)
  • web/src/beta/features/PluginPlayground/Plugins/presets/common.ts (1 hunks)
  • web/src/beta/features/PluginPlayground/Plugins/presets/custom/myPlugin.ts (1 hunks)
  • web/src/beta/features/PluginPlayground/Plugins/presets/index.ts (1 hunks)
  • web/src/beta/features/PluginPlayground/Plugins/presets/ui/responsivePanel.ts (1 hunks)
  • web/src/beta/features/PluginPlayground/Plugins/presets/ui/sidebar.ts (1 hunks)
  • web/src/beta/features/PluginPlayground/Plugins/usePlugins.ts (2 hunks)
  • web/src/beta/features/PluginPlayground/hooks.tsx (4 hunks)
💤 Files with no reviewable changes (2)
  • web/src/beta/features/PluginPlayground/Code/index.tsx
  • web/src/beta/features/PluginPlayground/Plugins/constants.ts
✅ Files skipped from review due to trivial changes (1)
  • web/src/beta/features/PluginPlayground/Plugins/presets/common.ts
🧰 Additional context used
📓 Learnings (5)
web/src/beta/features/PluginPlayground/Plugins/presets/index.ts (1)
Learnt from: airslice
PR: reearth/reearth-visualizer#1299
File: web/src/beta/features/PluginPlayground/Plugins/usePlugins.ts:203-203
Timestamp: 2024-12-03T03:49:26.713Z
Learning: In the `web/src/beta/features/PluginPlayground/Plugins/usePlugins.ts` file, returning `presetPlugins` instead of `plugins` is acceptable for now. We plan to refactor this code to return `plugins` when we add support for importing plugins, ensuring that the state includes user-added or modified plugins.
web/src/beta/features/PluginPlayground/Console/index.tsx (1)
Learnt from: airslice
PR: reearth/reearth-visualizer#1299
File: web/src/beta/features/PluginPlayground/Console/index.tsx:19-21
Timestamp: 2024-12-03T03:50:19.816Z
Learning: In the `Console` component (`web/src/beta/features/PluginPlayground/Console/index.tsx`), when displaying outputs for each file, we intentionally use `{output || "✔"}` to display "✔" even when `output` is an empty string or any other falsy value.
web/src/beta/features/PluginPlayground/Plugins/usePlugins.ts (1)
Learnt from: airslice
PR: reearth/reearth-visualizer#1299
File: web/src/beta/features/PluginPlayground/Plugins/usePlugins.ts:203-203
Timestamp: 2024-12-03T03:49:26.713Z
Learning: In the `web/src/beta/features/PluginPlayground/Plugins/usePlugins.ts` file, returning `presetPlugins` instead of `plugins` is acceptable for now. We plan to refactor this code to return `plugins` when we add support for importing plugins, ensuring that the state includes user-added or modified plugins.
web/src/beta/features/PluginPlayground/hooks.tsx (1)
Learnt from: airslice
PR: reearth/reearth-visualizer#1299
File: web/src/beta/features/PluginPlayground/Plugins/usePlugins.ts:203-203
Timestamp: 2024-12-03T03:49:26.713Z
Learning: In the `web/src/beta/features/PluginPlayground/Plugins/usePlugins.ts` file, returning `presetPlugins` instead of `plugins` is acceptable for now. We plan to refactor this code to return `plugins` when we add support for importing plugins, ensuring that the state includes user-added or modified plugins.
web/src/beta/features/PluginPlayground/Plugins/index.tsx (1)
Learnt from: airslice
PR: reearth/reearth-visualizer#1299
File: web/src/beta/features/PluginPlayground/Plugins/usePlugins.ts:203-203
Timestamp: 2024-12-03T03:49:26.713Z
Learning: In the `web/src/beta/features/PluginPlayground/Plugins/usePlugins.ts` file, returning `presetPlugins` instead of `plugins` is acceptable for now. We plan to refactor this code to return `plugins` when we add support for importing plugins, ensuring that the state includes user-added or modified plugins.
🪛 Biome (1.9.4)
web/src/beta/features/PluginPlayground/Plugins/index.tsx

[error] 41-41: Missing key property for this element in iterable.

The order of the items may change, and having a key can help React identify which item was moved.
Check the React documentation.

(lint/correctness/useJsxKeyInIterable)

🔇 Additional comments (13)
web/src/beta/features/PluginPlayground/Plugins/presets/index.ts (1)

15-26: Structuring presetPlugins enhances plugin organization

The introduction of presetPlugins with categorized plugins improves the organization and scalability of the plugin system. This aligns with our future plans to support importing plugins and managing user-added plugins.

web/src/beta/features/PluginPlayground/Console/index.tsx (1)

19-21: Use of <Typography> and fallback output enhances UI consistency

Replacing the <div> with <Typography> improves semantic structure and UI consistency. Additionally, using {output || "✔"} ensures a default success indicator is displayed when output is falsy, which aligns with the intended design.

web/src/beta/features/PluginPlayground/Plugins/presets/custom/myPlugin.ts (1)

1-40: Addition of myPlugin preset is well-implemented

The new myPlugin preset is correctly defined with appropriate files and integrates properly with the preset plugins structure. This enhances the customization options available in the Plugin Playground.

web/src/beta/features/PluginPlayground/Code/HtmlEditModal.tsx (1)

25-25: LGTM! UI improvements enhance usability

The changes improve the modal's usability by:

  • Increasing modal size for better HTML editing experience
  • Adding consistent padding using theme spacing

Also applies to: 57-58

web/src/beta/features/PluginPlayground/Plugins/FileListItem.tsx (2)

7-7: Import path aligns with React hook naming conventions

The change from ./hook to ./usePlugins follows React's standard hook naming pattern, improving code maintainability.


97-97: UX improvement: Added cursor pointer style

Adding cursor pointer style improves user experience by visually indicating clickable items.

web/src/beta/features/PluginPlayground/hooks.tsx (2)

92-92: UI consistency: Capitalized tab name

Changed tab name from "code" to "Code" for consistent capitalization in the UI.


14-14: Consistent renaming from plugins to presetPlugins

The renaming aligns with the planned refactoring to support importing plugins in the future, as mentioned in the retrieved learning.

Also applies to: 62-62, 76-76

✅ Verification successful

The term 'plugins' is still being used appropriately in the codebase

The search results show that the remaining uses of 'plugins' are correct and serve different purposes than the renamed 'presetPlugins':

  • In usePlugins.ts, 'plugins' represents the flattened array of active plugins derived from presetPlugins
  • In presets/index.ts, 'plugins' is used as a property name in type definitions and category objects
  • In hooks.tsx, 'plugins' is used as a tab identifier

The renaming from 'plugins' to 'presetPlugins' was specifically for the imported preset configuration, while other usages of 'plugins' remain semantically correct in their contexts.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Verify consistent renaming across codebase
rg -l 'plugins(?!.*preset)' web/src/beta/features/PluginPlayground/

Length of output: 299


Script:

#!/bin/bash
# Search for 'plugins' usage in the PluginPlayground directory
rg --pcre2 'plugins(?!.*preset)' web/src/beta/features/PluginPlayground/ -B 2 -A 2

# Also check for any remaining references to just 'plugins' in case the regex is too strict
rg '\bplugins\b' web/src/beta/features/PluginPlayground/ -B 2 -A 2

Length of output: 12915

web/src/beta/features/PluginPlayground/Plugins/presets/ui/responsivePanel.ts (1)

111-115: LGTM!

The plugin export is well-structured and follows the expected pattern.

web/src/beta/features/PluginPlayground/Code/hook.ts (1)

133-134: Verify impact on existing plugins

The new condition filters out non-widget extensions. While this change makes sense, we should verify that:

  1. All existing plugins are compatible with this change
  2. No functionality is broken for plugins that might have relied on non-widget extensions
✅ Verification successful

Let me analyze the results and generate a new script to better understand the extension types in the codebase.

The previous search revealed various type declarations but we need to:

  1. Identify which are top-level extension types vs property types
  2. Find how these types are used in the TypeScript code
  3. Understand if non-widget extensions are supported in the codebase

This will help us determine if filtering out non-widget extensions is a breaking change.


Let me try one more search to specifically look for extension type references in TypeScript files with a corrected syntax:

This will help us understand how extension types are used in the TypeScript code and whether filtering non-widget types could break existing functionality.


Based on the search results, I can now generate the final response. The codebase analysis shows that:

  1. The type field is used to distinguish different extension types including "widget", "primitive", "visualizer", "infobox", "block", "story", "storyBlock", and "cluster"
  2. The TypeScript interfaces show that extensions are part of a plugin system where each extension has a specific type
  3. The filtering in the code is used in a widget-specific context (PluginPlayground/Code/hook.ts)

Filtering non-widget extensions is safe in this context

The condition if (cur.type !== "widget") return prv is appropriate because:

  1. It's in a widget-specific playground component
  2. The codebase shows clear separation between different extension types
  3. Other extension types (primitive, visualizer, etc.) are handled by their respective components
🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Search for extensions with types other than "widget"
echo "Searching for non-widget extensions in YAML files..."
rg -A 5 "type:\s*(?!widget)[a-zA-Z]+" --type yaml

# Search for potential extension type declarations
echo "Searching for extension type declarations..."
ast-grep --pattern 'type: $_'

Length of output: 28606


Script:

#!/bin/bash
# Search for extension type declarations in manifest files, focusing on top-level type fields
echo "Searching for top-level extension types..."
rg -A 1 '^\s+type:' --type yaml

# Search for any references to extension types in TypeScript files
echo "Searching for extension type references in TypeScript..."
rg -A 2 'type\s*[=:]\s*["\']?(widget|primitive|visualizer|infobox|block|story|storyBlock|cluster|infoboxBlock)' --type ts

Length of output: 56215


Script:

#!/bin/bash
# Search for extension type references in TypeScript files
echo "Searching for extension type references in TypeScript..."
rg -A 2 '"type":\s*"(widget|primitive|visualizer|infobox|block|story|storyBlock|cluster|infoboxBlock)"' --type ts

# Search for type-related imports and interfaces
echo "Searching for type definitions..."
rg -A 2 'interface.*Extension|type.*Extension' --type ts

Length of output: 38609

web/src/beta/features/PluginPlayground/Plugins/presets/ui/sidebar.ts (1)

4-23: Similar improvements needed as in responsivePanel.ts

web/src/beta/features/PluginPlayground/Plugins/usePlugins.ts (2)

Line range hint 203-214: LGTM! Change aligns with future plans.

The switch to return presetPlugins instead of plugins is aligned with the planned refactoring to support plugin imports in the future, as noted in the retrieved learning.


17-19: Verify handling of empty plugin state.

The current initialization falls back to an empty string when no files exist. This could lead to issues if other parts of the code assume a valid file ID.

Let's verify how empty states are handled:

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: 2

📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between 6e8055b and 13f709b.

📒 Files selected for processing (2)
  • web/src/beta/features/PluginPlayground/Plugins/index.tsx (1 hunks)
  • web/src/beta/features/PluginPlayground/Plugins/usePlugins.ts (3 hunks)
🧰 Additional context used
📓 Learnings (2)
web/src/beta/features/PluginPlayground/Plugins/usePlugins.ts (1)
Learnt from: airslice
PR: reearth/reearth-visualizer#1299
File: web/src/beta/features/PluginPlayground/Plugins/usePlugins.ts:203-203
Timestamp: 2024-12-03T03:49:26.713Z
Learning: In the `web/src/beta/features/PluginPlayground/Plugins/usePlugins.ts` file, returning `presetPlugins` instead of `plugins` is acceptable for now. We plan to refactor this code to return `plugins` when we add support for importing plugins, ensuring that the state includes user-added or modified plugins.
web/src/beta/features/PluginPlayground/Plugins/index.tsx (1)
Learnt from: airslice
PR: reearth/reearth-visualizer#1299
File: web/src/beta/features/PluginPlayground/Plugins/usePlugins.ts:203-203
Timestamp: 2024-12-03T03:49:26.713Z
Learning: In the `web/src/beta/features/PluginPlayground/Plugins/usePlugins.ts` file, returning `presetPlugins` instead of `plugins` is acceptable for now. We plan to refactor this code to return `plugins` when we add support for importing plugins, ensuring that the state includes user-added or modified plugins.
🔇 Additional comments (2)
web/src/beta/features/PluginPlayground/Plugins/index.tsx (1)

Line range hint 28-28: Add a key prop to the <div> element in the map function

In your code, the key prop is added to the CategoryTitle component, but the key prop should be on the <div> element directly inside the map function. This helps React identify which items have changed, are added, or are removed in a list.

Apply this diff to add the missing key prop:

{presetPlugins.map((category) => (
-  <div>
+  <div key={category.id}>
    <CategoryTitle>{category.title}</CategoryTitle>
    {category.plugins.map((plugin) => (
      <EntryItem
        key={plugin.id}
        highlighted={selectedPlugin.id === plugin.id}
        onClick={() => selectPlugin(plugin.id)}
        title={plugin.title}
        optionsMenu={[
          {
            id: "0",
            title: "share",
            icon: "paperPlaneTilt",
            onClick: () => handleShareIconClicked(plugin.id)
          }
        ]}
        optionsMenuWidth={100}
      />
    ))}
  </div>
))}
web/src/beta/features/PluginPlayground/Plugins/usePlugins.ts (1)

3-4: ⚠️ Potential issue

Remove duplicate imports from 'react'

The imports from 'react' are duplicated at lines 3 and 4. Consolidating them into a single import statement improves code clarity and prevents potential issues.

Apply this diff to consolidate the imports:

-import { useCallback, useMemo, useState } from "react";
-import { useCallback, useEffect, useMemo, useState } from "react";
+import { useCallback, useEffect, useMemo, useState } from "react";

Likely invalid or redundant comment.

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

🧹 Outside diff range and nitpick comments (3)
web/src/beta/features/PluginPlayground/Plugins/index.tsx (3)

49-50: Remove redundant key prop from CategoryTitle

The key prop is already present on the parent div element. Having the same key on the child CategoryTitle component is unnecessary.

Apply this diff to remove the redundant key:

  <div key={category.id}>
-   <CategoryTitle key={category.id}>{category.title}</CategoryTitle>
+   <CategoryTitle>{category.title}</CategoryTitle>

Line range hint 66-66: Add key prop to shared plugins container

For consistency with the preset plugins section, add a key prop to the shared plugins container div.

Apply this diff:

-  <div>
+  <div key="shared">

Line range hint 52-64: Refactor duplicated options menu configuration

The options menu configuration is duplicated between preset and shared plugins. Consider extracting this into a reusable constant.

Apply this refactor:

+ const PLUGIN_OPTIONS_MENU = (handleShare: (id: string) => void) => [{
+   id: "0",
+   title: "share",
+   icon: "paperPlaneTilt",
+   onClick: (id: string) => handleShare(id)
+ }];

  // Then in the render:
  <EntryItem
    key={plugin.id}
    highlighted={selectedPlugin.id === plugin.id}
    onClick={() => selectPlugin(plugin.id)}
    title={plugin.title}
-   optionsMenu={[
-     {
-       id: "0",
-       title: "share",
-       icon: "paperPlaneTilt",
-       onClick: () => handleShareIconClicked(plugin.id)
-     }
-   ]}
+   optionsMenu={PLUGIN_OPTIONS_MENU(() => handleShareIconClicked(plugin.id))}
    optionsMenuWidth={100}
  />

Also applies to: 69-81

📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between 13f709b and 9942f11.

📒 Files selected for processing (1)
  • web/src/beta/features/PluginPlayground/Plugins/index.tsx (1 hunks)
🧰 Additional context used
📓 Learnings (1)
web/src/beta/features/PluginPlayground/Plugins/index.tsx (1)
Learnt from: airslice
PR: reearth/reearth-visualizer#1299
File: web/src/beta/features/PluginPlayground/Plugins/usePlugins.ts:203-203
Timestamp: 2024-12-03T03:49:26.713Z
Learning: In the `web/src/beta/features/PluginPlayground/Plugins/usePlugins.ts` file, returning `presetPlugins` instead of `plugins` is acceptable for now. We plan to refactor this code to return `plugins` when we add support for importing plugins, ensuring that the state includes user-added or modified plugins.

@mulengawilfred mulengawilfred force-pushed the feat/plugin-playground-presets-sidebar branch from 9942f11 to 09a0de8 Compare December 15, 2024 18:55
@mulengawilfred
Copy link
Contributor

mulengawilfred commented Dec 15, 2024

Sorry @OpeDada . I accidentally updated your branch with main ( using git rebase 🫨 ) . No changes to the original code but will need it to be re-approved. Sorry about that. 🙇

@airslice , kindly asking to give this one a thumb up as it was approved earlier. Sorry about that.

@airslice airslice merged commit bf23f0c into main Dec 16, 2024
19 checks passed
@airslice airslice deleted the feat/plugin-playground-presets-sidebar branch December 16, 2024 07:31
ZTongci pushed a commit that referenced this pull request Dec 17, 2024
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.

3 participants