[JEWEL-1150] Create Got It Tooltip Component#3451
[JEWEL-1150] Create Got It Tooltip Component#3451DanielSouzaBertoldi wants to merge 2 commits intoJetBrains:masterfrom
Conversation
add missing jbpopuprenderer to commits
28b30e9 to
0061cbe
Compare
13e3184 to
2d05628
Compare
2d05628 to
84ed9e3
Compare
| val shouldListenForEscapeKeyPress by | ||
| rememberUpdatedState(visible && currentOnEscapePress != null || buttons.hasNoButtons()) |
There was a problem hiding this comment.
So, we have a decision to make here. I humbly ask for your input :)
In GotItComponentBuilder from IJP, there's this function:
/**
* Sets the action to be executed when the escape key is pressed.
* Note that the popup will be closed after the action execution.
* If escape action is not set, the popup won't be closed on the escape key.
*/
fun onEscapePressed(action: () -> Unit): GotItComponentBuilder {
this.escapeAction = action
return this
}
The last line in the comment states pretty convincingly that, if users don't set a escape action, then the popup will not be closed on the escape key.
This however, is false. It doesn't matter if you set up a escape action or not, the popup will always be dismissed when users press escape.
The funny thing is, it doesn't say anything about how the component can be closed if there's no buttons, so that's why I added a "escape hatch" for such cases. If there are no buttons, then users can (and should, unless developers externally set visible to false on some other condition) close the popup when pressing the escape key.
So, I decided on follow what's actually written in the code instead of its actual behavior.
What do you think? Stick to the code intention or the actual behavior?
Important
This PR is a direct continuation of #3449! While that PR is not merged, just ignore these three files changed:
JBPopupRenderer.kt,Popup.ktandJDialogRenderer.ktContext
This PR adds the greatest component EVER to Jewel's arsenal. Don't let the "tooltip" part in its name fool you. This does NOT act like a tooltip at all, since a tooltip by definition should only be active while your cursor is hovering a component, and this weird guy loves to behave like your plain 'ol popup. It won't disappear unless you click its main button (actually there are other ways to close it which you'll find out during code review, yes this your encouragement to go through the code carefully and find out all its features. Or just check the screen recordings below if you feel like cheating and don't mind a guilty conscience), and hangs around basically begging for the user's attention.
The cool thing though is that you are free to choose where it's going to show up below, on top or at the start/end of another component, and it has a very cool custom shape that resembles a balloon. Everybody loves balloons!
Current limitations
Changes
GotItTooltipcomposable with balloon popup, auto-positioning, and configurableGotItBodyDSLBalloonShapefor drawing the balloon outline with directional arrow tipBalloonPopupPositionProviderfor positioning the balloon relative to its anchorcalculateBalloonPositionandcreateBalloonOutlineas@InternalJewelApitop-level functions inBalloonInternalsreadGotItTooltipStyle/readGotItButtonStyleinIntUiBridgeGotItTooltipDemo
Themes
Appearance
Main Options
Buttons
Screen.Recording.2026-03-09.at.14.57.54.mov
Screen.Recording.2026-03-09.at.14.59.25.mov
Screen.Recording.2026-03-09.at.15.01.12.mov
Screen.Recording.2026-03-09.at.15.00.29.mov
Screen.Recording.2026-03-09.at.15.04.34.mov
Screen.Recording.2026-03-09.at.15.03.51.mov
Screen.Recording.2026-03-09.at.15.05.20.mov
Screen.Recording.2026-03-09.at.15.05.41.mov
Note: Yes, on click shouldn't show a blue outline. However, that would take a bit of refactoring on the Button composable side which is not part of this PR!
Body text
Screen.Recording.2026-03-09.at.15.56.04.mov
Screen.Recording.2026-03-09.at.15.53.36.mov
Behavioral
Screen.Recording.2026-03-09.at.16.21.36.mov
Screen.Recording.2026-03-09.at.16.18.22.mov
Screen.Recording.2026-03-09.at.16.22.38.mov
Screen.Recording.2026-03-09.at.16.23.18.mov
Screen.Recording.2026-03-09.at.16.26.55.mov
Screen.Recording.2026-03-09.at.16.26.08.mov
Screen.Recording.2026-03-09.at.16.29.09.mov
Screen.Recording.2026-03-09.at.16.36.31.mov
Screen.Recording.2026-03-09.at.16.55.19.mov
onEscapePressdefinedonEscapePressundefinedGot It in its full glory (aka all possible customizations at once)
Popup Renderer
Screen.Recording.2026-03-10.at.09.04.26.mov
Screen.Recording.2026-03-10.at.09.07.41.mov
Screen.Recording.2026-03-10.at.09.09.43.mov
Screen.Recording.2026-03-10.at.09.05.06.mov
Screen.Recording.2026-03-10.at.09.08.28.mov
Screen.Recording.2026-03-10.at.09.10.19.mov
Release notes
New features
GotItTooltipcomponent with a balloon popup, rich body DSL (text, link, shortcut segments), optional header, primary/secondary buttons, step indicator, timeout auto-dismiss, and keyboard escape support. Check the showcase for all possible customizations.