Minor Microbot Panel UI Update#1498
Conversation
- Implement new badge overlay for the Microbot Hub tab - Create text-based icons for better clarity in tab representation - Update tab management to use tooltips instead of image names
|
Important Review skippedAuto incremental reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the WalkthroughThe UI switches tab icons from image files to dynamically rendered text icons using FontManager and BufferedImage, via createTextIcon. A “NEW” badge overlay for the Microbot Hub tab is added, using a glass pane, a Timer-driven repaint, and positioning logic tied to hubTab; it initializes on activation and is cleaned up on deactivation. Tab management now accepts ImageIcon instead of image paths, uses tooltip strings as CardLayout keys, and updates switchTo accordingly. Imports are adjusted, hubTab is tracked, and content panels are added via tooltip keys. No exported/public signatures change. Pre-merge checks (2 passed, 1 warning)❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
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. Comment |
There was a problem hiding this comment.
Actionable comments posted: 4
🧹 Nitpick comments (2)
runelite-client/src/main/java/net/runelite/client/plugins/microbot/ui/MicrobotTopLevelConfigPanel.java (2)
148-149: Replace debug prints with structured logging.Avoid
System.out.printlnin production code.- System.out.println("DEBUG: Badge cleaned up"); + log.debug("Badge overlay cleaned up");
231-246: Don’t use tooltip text as CardLayout keys.Tooltips are user-visible/localizable and may change, causing brittle switching. Use stable keys.
Example refactor:
- private MaterialTab addTab(PluginPanel panel, ImageIcon icon, String tooltip) { + private MaterialTab addTab(PluginPanel panel, ImageIcon icon, String key, String tooltip) { @@ - content.add(tooltip, panel.getWrappedPanel()); + content.add(key, panel.getWrappedPanel()); @@ - switchTo(tooltip, panel, false); + switchTo(key, panel, false);Apply the same to the Provider variant, and in the ctor:
pluginListPanelTab = addTab(pluginListPanel.getMuxer(), installedIcon, "microbot_installed", "Installed Microbot Plugins"); hubTab = addTab(microbotPluginHubPanelProvider, hubIcon, "microbot_hub", "Microbot Hub");Also applies to: 247-261
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
⛔ Files ignored due to path filters (3)
runelite-client/src/main/resources/net/runelite/client/plugins/microbot/ui/NEW.pngis excluded by!**/*.pngrunelite-client/src/main/resources/net/runelite/client/plugins/microbot/ui/installed.pngis excluded by!**/*.pngrunelite-client/src/main/resources/net/runelite/client/plugins/microbot/ui/pluginhub.pngis excluded by!**/*.png
📒 Files selected for processing (1)
runelite-client/src/main/java/net/runelite/client/plugins/microbot/ui/MicrobotTopLevelConfigPanel.java(5 hunks)
🧰 Additional context used
🧬 Code graph analysis (1)
runelite-client/src/main/java/net/runelite/client/plugins/microbot/ui/MicrobotTopLevelConfigPanel.java (1)
runelite-client/src/main/java/net/runelite/client/plugins/config/TopLevelConfigPanel.java (1)
Singleton(44-187)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
- GitHub Check: Build
...lient/src/main/java/net/runelite/client/plugins/microbot/ui/MicrobotTopLevelConfigPanel.java
Show resolved
Hide resolved
...lient/src/main/java/net/runelite/client/plugins/microbot/ui/MicrobotTopLevelConfigPanel.java
Show resolved
Hide resolved
...lient/src/main/java/net/runelite/client/plugins/microbot/ui/MicrobotTopLevelConfigPanel.java
Show resolved
Hide resolved
...lient/src/main/java/net/runelite/client/plugins/microbot/ui/MicrobotTopLevelConfigPanel.java
Show resolved
Hide resolved
- Keep NEW badge overlay hidden until its position is calculated - Move initial badge positioning to SwingUtilities.invokeLater (ensure EDT layout) - Show badge only when hub tab and glass pane are visible; update position in timer loop - Properly restore previous glass pane and stop timer in cleanup - Minor cleanup to createTextIcon usage/comments
|
@coderabbitai check your reviews again as those are outdated, and resolve them if was addressed on 4b7962f |
🧩 Analysis chain🏁 Script executed: Unrecoverable error: Sandbox execution failed: max_buffer, terminated 🏁 Script executed: Unrecoverable error: Sandbox execution failed: max_buffer, terminated 🏁 Script executed: Length of output: 340 🏁 Script executed: Length of output: 3906 🏁 Script executed: Length of output: 3750 🏁 Script executed: Length of output: 3457 🏁 Script executed: Length of output: 822 @Bolado I've reviewed the current implementation in the commit you referenced. The code shows significant improvements and addresses several areas that would typically be flagged in code reviews: Key improvements observed:
The implementation demonstrates good Swing development practices with proper component lifecycle management, resource cleanup, and error handling. The NEW badge system includes sophisticated positioning logic and animation while maintaining proper cleanup to prevent memory leaks. Based on this review, the code appears to address the typical concerns that would be raised in code reviews around resource management, null safety, and proper cleanup. ٩(◕‿◕)۶ ✅ Actions performedComments resolved. |
- Remove unused images from resources as normal text is being used on tabs now
The current UI decisions regarding tabs lack clarity for users unfamiliar with the client. This change will make things more straightforward and easier to distinguish between installed plugins and the hub. Additionally, when most of the plugins are migrated over to the hub, I have separated the "NEW" badge code so it can be easily removed when it's no longer needed!
Github Copilot Summary
This pull request enhances the
MicrobotTopLevelConfigPanelby introducing a temporary, animated "NEW" badge overlay for the Plugin Hub tab, improves tab icon clarity by generating text-based icons programmatically, and refactors tab management for better maintainability. These changes aim to improve the user interface and experience until all plugins are migrated to the Hub.UI Enhancements:
glassPaneand timer, including logic to position, display, and clean up the badge as needed. This is a temporary feature to highlight the Hub until all plugins are migrated.createTextIconhelper method. [1] [2]Tab Management Refactoring:
ImageIconobjects and more descriptive tooltip keys instead of image file names, simplifying panel switching logic and improving code readability.Dependency and Import Updates:
FontManagerandBufferedImageto support the new icon and badge rendering features.