Skip to content

Conversation

DavidAnson
Copy link
Contributor

@DavidAnson DavidAnson commented Jul 25, 2025

This PR completes the request @haslinghuis made in #4460 (comment) to remove jBox from the project by using the Floating Vue tooltip implementation.

Notes:

  • The two tooltip implementations are similar enough in practice that the changes here are fairly limited.
  • Visual styling of tooltips (color, etc.) should be the same as before, though by default the callout triangle is not exactly the same size and the placement is slightly different.
  • Default values for behavioral concerns (show and hide delay, etc.) and other visual aspects have been used instead of trying to replicate previous values (which may have themselves been arbitrary).
  • In practice, tooltips sometimes (rarely) fail to close automatically (on Safari), but I attribute this to issues with the Floating Vue library (which may be addressed in a future release).

Related:

Summary by CodeRabbit

  • New Features

    • Enhanced tooltip functionality and styling throughout the application using a new tooltip library.
    • Custom and wide tooltip themes now available for improved user experience.
  • Refactor

    • Replaced legacy tooltip implementation with a modern solution for more consistent and maintainable tooltips.
    • Updated tooltip styling to align with the new system.
  • Chores

    • Updated dependencies to remove unused packages and add the new tooltip library.

Copy link
Contributor

coderabbitai bot commented Jul 25, 2025

"""

Walkthrough

The changes replace the tooltip library jBox with floating-vue across the project. This includes updating dependencies, refactoring tooltip initialization and destruction in JavaScript files, globally registering tooltip components in the Vue app, and updating CSS selectors and styles to match the new library's classes and themes.

Changes

Files / Areas Change Summary
package.json Removed jbox dependency, added floating-vue dependency.
src/components/init.js Imported and globally registered floating-vue Tooltip; added custom tooltip themes during Vue app setup.
src/css/main.less Replaced .jBox-* tooltip styles with .v-popper--theme-tooltip.v-popper--theme-custom* styles; removed legacy .jBox classes.
src/js/browserMain.js Removed import of jBox CSS.
src/js/gui.js Replaced jBox tooltip creation with floating-vue's createTooltip for .cf_tip and .cf_tip_wide elements.
src/js/tabs/osd.js Switched from jBox to floating-vue for tooltip lifecycle: uses createTooltip and destroyTooltip for .osd_tip elements.

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant DOM Element
    participant JS (gui.js/osd.js)
    participant FloatingVue

    User->>DOM Element: Hover/focus on .cf_tip/.cf_tip_wide/.osd_tip
    JS (gui.js/osd.js)->>FloatingVue: createTooltip(element, content, theme)
    FloatingVue-->>DOM Element: Show tooltip with custom theme
    User->>DOM Element: Move away or blur
    JS (gui.js/osd.js)->>FloatingVue: destroyTooltip(element)
    FloatingVue-->>DOM Element: Remove tooltip
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~15–20 minutes

Suggested labels

RN: REFACTOR

Suggested reviewers

  • haslinghuis
    """

Note

⚡️ Unit Test Generation is now available in beta!

Learn more here, or try it out under "Finishing Touches" below.


📜 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 ec07b04 and 9b506dc.

📒 Files selected for processing (2)
  • src/js/gui.js (2 hunks)
  • src/js/tabs/osd.js (2 hunks)
🚧 Files skipped from review as they are similar to previous changes (2)
  • src/js/gui.js
  • src/js/tabs/osd.js
✨ Finishing Touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment

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 docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai generate unit tests to generate unit tests for 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.

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.

@haslinghuis
Copy link
Member

Excellent, found two issues

image image

@DavidAnson
Copy link
Contributor Author

@haslinghuis,

The top issue of multiple tool tips showing at once seems like a case of what I described in my notes above where Floating Vue sometimes fails to hide tooltips. I can search their issue tracker to see if this is discussed, but don't see how it could be a problem with this PR because things usually work correctly and there is nothing timing-sensitive in the changes I made.

The bottom issue where there seems to be a little bubble next to the tooltip triangle is something I have not seen. If you know how to reproduce that, it could be helpful. Again, I can search the issue tracker to see if this is mentioned, but do not think it is a problem that can be fixed in this PR.

I do not have the time to try to debug and fix the Floating Vue library right now.

@haslinghuis
Copy link
Member

Yeah you asked me for something to work on - but it turns out to be definite more complicated then I thought :)

@DavidAnson
Copy link
Contributor Author

@haslinghuis, the issue of tooltips sometimes not hiding seems a lot like Akryum/floating-vue#1081. Unfortunately, we need popperTriggers to include hover to allow the mouse to move "into" the tooltip and click on any links in it.

@DavidAnson
Copy link
Contributor Author

@haslinghuis, please try again, I think I have addressed the issue causing empty tooltips on the Motors tab in a commit I just pushed. (That tab invokes content_ready multiple times.)

Copy link

Copy link
Contributor

Preview URL: https://9b506dcb.betaflight-configurator.pages.dev

@haslinghuis
Copy link
Member

I'm used to jquery - as Vue3 seems to have quirks in updates - but impressed with the effort.

Example: on configuration tab.

image

@haslinghuis
Copy link
Member

Superseded by #4582

@github-project-automation github-project-automation bot moved this from App to Done in 2025.12.0 Aug 30, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

2 participants