Repository navigation
[MarkdownEditorHelpButton] Add optional tooltipPosition - #9546
Conversation
There was a problem hiding this comment.
Pull request overview
Adds an optional tooltipPosition prop to EuiMarkdownEditorHelpButton so consumers (e.g., Dashboard’s markdown editor header layout) can control where the help tooltip renders without affecting existing usages (default remains top).
Changes:
- Extends
EuiMarkdownEditorHelpButtonprops with optionaltooltipPosition?: ToolTipPositions - Wires the new prop through to
EuiToolTip’spositionprop
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
weronikaolejniczak
left a comment
There was a problem hiding this comment.
Hey @Zacqary! Awesome to see you contribute to our lib, very happy about that! 💚
The ask is legitimate, the code is straightforward. Changelog is ok. Prop tables in docs will be automatically populated, no need to add docs about this.
The 3 concerns I have:
Prop name
Customarily in EUI we use e.g. <component>Props pattern, e.g. badgeProps, tooltipProps and spread them on the component. For tooltip specifically, we could omit content and children in the type and put content={syntaxTitle} after the spread.
Note: please use tooltipProps and not toolTipProps. It's "tooltip", one word.
Only works for standalone usage
I understand this will work for your use case where you render EuiMarkdownEditorHelpButton directly. But we need to consider the bigger picture.
If we do allow the position to be changed from the help button, we should likely allow it to be changed from EuiMarkdownEditor level as well (similarly as was done with toolbarProps before). It could look like:
footerProps?: {
helpButtonProps?: Pick<EuiMarkdownEditorHelpButtonProps, 'toolTipProps'>;
};
That would be the more consistent, complete API.
What for...?
Isn't a simpler solution just rendering that tooltip always to the bottom? That requires a design decision though.
Got it, I saw
By default, In our use case, we disable the footer and move the button to the header, which warrants the position change. I think it's unlikely anyone would want to change the tooltip position if they're putting the button in the footer. Happy to add this |
💚 Build SucceededHistory
|
💚 Build Succeeded
History
|
…e-window target (#260782) ## Summary Closes #253431 Closes #257733 This fixes a couple of regressions in the new Markdown panel which resulted from us switching from our own bespoke Markdown editor to `EuiMarkdownEditor` ### Fix relative links I've added a new parsing plugin to our implementation of the markdown editor which handles space-relative links like `[discover](discover)` linking to `/app/discover`. The EUI link validator strips these as invalid, so the new parsing plugin will resolve them to full paths before the link validator runs. It also handles other document-relative links like `../../../upper-level-path` I have opened an [EUI PR](elastic/eui#9554) to commit these changes upstream to the link validator plugin. Once that merges, we can revert this custom plugin and just pass `allowDocumentRelative: true` to the default EUI Markdown plugins' `parsingConfig`. ### Add open-in-new-tab setting This restores the previous toggle setting for opening links in a new tab or not. The user can do this through a new settings popover. In legacy, it defaulted to `false`. I'm keeping it `true` by default in the new implementation, but allowing the user to disable it. <img width="1168" height="509" alt="Screenshot 2026-04-01 at 2 38 15 PM" src="https://github.com/user-attachments/assets/4570163e-ee76-491b-8ee6-caf0fda74887" /> #### Known design bug To prevent the settings button tooltip from covering the Editor/Preview toggle, I set the tooltip position to `bottom` <img width="996" height="196" alt="Screenshot 2026-03-31 at 3 10 26 PM" src="https://github.com/user-attachments/assets/c07fbe15-d7e1-431f-b89e-c556de68a806" /> But because of EUI limitations, I can't do the same for the help button: <img width="265" height="150" alt="Screenshot 2026-03-31 at 3 42 08 PM" src="https://github.com/user-attachments/assets/6274b0d0-3456-45a2-b295-14841f818ef1" /> I've submitted an upstream [EUI PR](elastic/eui#9546) to allow us to fix this. ### Checklist - [x] Any text added follows [EUI's writing guidelines](https://elastic.github.io/eui/#/guidelines/writing), uses sentence case text and includes [i18n support](https://github.com/elastic/kibana/blob/main/src/platform/packages/shared/kbn-i18n/README.md) - [ ] [Documentation](https://www.elastic.co/guide/en/kibana/master/development-documentation.html) was added for features that require explanation or tutorials - [x] [Unit or functional tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html) were updated or added to match the most common scenarios --------- Co-authored-by: kibanamachine <[email protected]>
weronikaolejniczak
left a comment
There was a problem hiding this comment.
I thought about this some more and I think this targeted update is fine. If there is a need for footerProps, we'll add it. Thank you for addressing my feedback and for the contribution, Zac! 💚
## Dependency updates - `@elastic/eui` - v114.0.0 ⏩ v114.1.0 - `@elastic/eslint-plugin-eui` - v2.11.0 ⏩ v2.11.1 --- ## Package updates ### @elastic/eui [`v114.1.0`](https://github.com/elastic/eui/releases/v114.1.0) - Added an optional `tooltipProps` prop to `EuiMarkdownEditorHelpButton` ([#9546](elastic/eui#9546)) - Added a warning when non-recommended units are used in `width`, `minWidth` or `maxWidth` props on `<EuiTableFooterCell>`, `<EuiTableHeaderCell>`, `<EuiTableHeaderCellCheckbox>` as well as the `columns` configuration on `<EuiBasicTable>` and `<EuiInMemoryTable>` ([#9540](elastic/eui#9540)) - Added `transitionBottomIn` and `transitionBottomOut` icons to `EuiIcon` ([#9528](elastic/eui#9528)) **Bug fixes** - Fixed `EuiFlyoutManager` animation flickering when switching between flyout sessions by removing intermediate transition stages (backgrounding, returning, closing) and limiting opening animations to the initial flyout and first child only ([#9514](elastic/eui#9514)) - Fixed rendering of `EuiTableHeaderMobile` when `responsiveBreakpoint=false` prop is set ([#9531](elastic/eui#9531)) ### @elastic/eslint-plugin-eui v2.11.1 **Bug fixes** - Fixed `no-css-color` ESLint rule crash when analyzing functions that return `undefined` or non-object values ([#9368](elastic/eui#9368)) Co-authored-by: Elastic Machine <[email protected]>
## Dependency updates - `@elastic/eui` - v114.0.0 ⏩ v114.1.0 - `@elastic/eslint-plugin-eui` - v2.11.0 ⏩ v2.11.1 --- ## Package updates ### @elastic/eui [`v114.1.0`](https://github.com/elastic/eui/releases/v114.1.0) - Added an optional `tooltipProps` prop to `EuiMarkdownEditorHelpButton` ([elastic#9546](elastic/eui#9546)) - Added a warning when non-recommended units are used in `width`, `minWidth` or `maxWidth` props on `<EuiTableFooterCell>`, `<EuiTableHeaderCell>`, `<EuiTableHeaderCellCheckbox>` as well as the `columns` configuration on `<EuiBasicTable>` and `<EuiInMemoryTable>` ([elastic#9540](elastic/eui#9540)) - Added `transitionBottomIn` and `transitionBottomOut` icons to `EuiIcon` ([elastic#9528](elastic/eui#9528)) **Bug fixes** - Fixed `EuiFlyoutManager` animation flickering when switching between flyout sessions by removing intermediate transition stages (backgrounding, returning, closing) and limiting opening animations to the initial flyout and first child only ([elastic#9514](elastic/eui#9514)) - Fixed rendering of `EuiTableHeaderMobile` when `responsiveBreakpoint=false` prop is set ([elastic#9531](elastic/eui#9531)) ### @elastic/eslint-plugin-eui v2.11.1 **Bug fixes** - Fixed `no-css-color` ESLint rule crash when analyzing functions that return `undefined` or non-object values ([elastic#9368](elastic/eui#9368)) Co-authored-by: Elastic Machine <[email protected]>
Summary
Adds an optional
tooltipPositionto the EuiMarkdownEditorHelpButton.This is needed for the Dashboard markdown editor, as we put the help button on the header and use a floating Edit/Preview toggle.
In elastic/kibana#253431 we're adding a Settings button, which we can successfully assign
position: bottom:But we can't do the same for the help button:
An undefined
tooltipPositiondefaults totop, so this change will have no impact on other uses of the help button.