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

refactor(web): support tooltip on icon button [VIZ-1401] #1514

Merged
merged 10 commits into from
Mar 26, 2025

Conversation

mkumbobeaty
Copy link
Contributor

@mkumbobeaty mkumbobeaty commented Mar 18, 2025

Overview

Improve the way we handle tooltip in icon button

What I've done

  • Support popup tip in IconButton
  • Improve Tooltip component

What I haven't done

How I tested

Which point I want you to review particularly

Memo

Summary by CodeRabbit

  • New Features

    • Upgraded traditional buttons to modern icon-based buttons with larger size and enhanced border styling, improving interaction in code execution and plugin areas.
    • Enhanced tooltip functionality, now offering customizable triggers for a more dynamic user guidance experience.
  • Style

    • Refined visual accents, including updated tooltip panel backgrounds and popup arrow colors for improved visual consistency.
    • Introduced new shadow styling for tooltips to enhance the visual design options.

Copy link

coderabbitai bot commented Mar 18, 2025

Walkthrough

The pull request updates various UI components within the Plugin Playground and the shared UI library. The primary change is replacing the traditional Button component with the new IconButton, which now includes props such as size="large" and hasBorder. Additionally, the IconButton has been enhanced to conditionally wrap itself with a Tooltip when a tooltip text is provided. Minor styling adjustments have been applied within the Popup and Tooltip components, with no change to the functionality of event handlers.

Changes

File(s) Change Summary
web/src/beta/features/PluginPlayground/Code/index.tsx
web/src/beta/features/PluginPlayground/Plugins/index.tsx
Replaced Button with IconButton, added size="large" and hasBorder, removed iconButton prop, while preserving tooltip and click functionalities.
web/src/beta/lib/reearth-ui/components/IconButton/index.tsx Integrated conditional rendering of a Tooltip based on the presence of tooltipText; simplified Icon props; now wraps the IconButton in a Tooltip when applicable.
web/src/beta/lib/reearth-ui/components/Tooltip/index.tsx Introduced a new optional triggerComponent property; updated trigger logic with useMemo; changed the TipPanel background from theme.bg[1] to theme.bg[2].
web/src/beta/lib/reearth-ui/components/Popup/index.tsx Modified the FloatingArrow's fill style by updating the color from theme.bg[1] to theme.bg[2].
web/src/services/theme/reearthTheme/common/shadow.ts Added a new tooltip property to the shadow object for tooltip styling.

Possibly related PRs

Suggested reviewers

  • airslice
  • ZTongci
  • m-abe-dev

Poem

I'm Bunny, happy to announce,
New IconButtons now ready to pounce!
Hopping through code with a gleeful stare,
Tooltips and borders add flair so rare.
Carrot-powered changes, crisp and neat,
My little paws dance to the updated beat!
CodeRabbit cheers with every feat!


📜 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 a31bb8f and 2ee0f72.

📒 Files selected for processing (1)
  • web/src/services/theme/reearthTheme/common/shadow.ts (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • web/src/services/theme/reearthTheme/common/shadow.ts
⏰ Context from checks skipped due to timeout of 90000ms (6)
  • GitHub Check: Redirect rules - reearth-web
  • GitHub Check: Header rules - reearth-web
  • GitHub Check: ci-server / ci-server-test
  • GitHub Check: ci-web / ci
  • GitHub Check: ci-server / ci-server-lint
  • GitHub Check: Pages changed - reearth-web

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

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 Mar 18, 2025

Deploy Preview for reearth-web ready!

Name Link
🔨 Latest commit 2ee0f72
🔍 Latest deploy log https://app.netlify.com/sites/reearth-web/deploys/67e3a1dfc985800008c7ac81
😎 Deploy Preview https://deploy-preview-1514--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.

@mkumbobeaty mkumbobeaty changed the title refactor(web): support popup tip on icon button refactor(web): support popup tip on icon button [VIZ-1401] Mar 18, 2025
@mkumbobeaty mkumbobeaty marked this pull request as ready for review March 18, 2025 14:53
@mkumbobeaty mkumbobeaty requested a review from airslice as a code owner March 18, 2025 14:53
@mkumbobeaty mkumbobeaty changed the title refactor(web): support popup tip on icon button [VIZ-1401] refactor(web): support tooltip on icon button [VIZ-1401] Mar 18, 2025
@mkumbobeaty mkumbobeaty merged commit 92d9b8e into main Mar 26, 2025
17 checks passed
@mkumbobeaty mkumbobeaty deleted the refactor/support-tooltip branch March 26, 2025 08:36
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