Skip to content

[MarkdownEditorHelpButton] Add optional tooltipPosition - #9546

Merged
weronikaolejniczak merged 3 commits into
elastic:mainfrom
Zacqary:markdown-tooltip-position
Apr 7, 2026
Merged

weronikaolejniczak merged 3 commits into
elastic:mainfrom
Zacqary:markdown-tooltip-position

Conversation

@Zacqary

@Zacqary Zacqary commented Mar 31, 2026

Copy link
Copy Markdown
Contributor

Summary

Adds an optional tooltipPosition to 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:

Screenshot 2026-03-31 at 3 10 26 PM

But we can't do the same for the help button:

Screenshot 2026-03-31 at 3 42 08 PM

An undefined tooltipPosition defaults to top, so this change will have no impact on other uses of the help button.

Copilot AI review requested due to automatic review settings March 31, 2026 20:43
@Zacqary
Zacqary requested a review from a team as a code owner March 31, 2026 20:43

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 EuiMarkdownEditorHelpButton props with optional tooltipPosition?: ToolTipPositions
  • Wires the new prop through to EuiToolTip’s position prop

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@weronikaolejniczak weronikaolejniczak left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@Zacqary

Zacqary commented Apr 1, 2026

Copy link
Copy Markdown
Contributor Author

@weronikaolejniczak

Customarily in EUI we use e.g. 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.

Got it, I saw tooltipPosition used in packages/eui/src/components/badge/beta_badge/beta_badge.tsx but I guess that's violating convention. I'll fix.

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.
Isn't a simpler solution just rendering that tooltip always to the bottom? That requires a design decision though.

By default, EuiMarkdownEditor renders the EuiMarkdownEditorHelpButton in its footer. In this case, we do want the tooltip to have a top position.

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 footerProps change if you still think it's necessary, but I just want to confirm.

@elasticmachine

Copy link
Copy Markdown
Collaborator

💚 Build Succeeded

History

@elasticmachine

Copy link
Copy Markdown
Collaborator

💚 Build Succeeded

History

Zacqary added a commit to elastic/kibana that referenced this pull request Apr 6, 2026
…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 weronikaolejniczak left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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! 💚

@weronikaolejniczak
weronikaolejniczak merged commit 8bedb84 into elastic:main Apr 7, 2026
1 check passed
weronikaolejniczak pushed a commit to weronikaolejniczak/eui that referenced this pull request Apr 7, 2026
weronikaolejniczak pushed a commit to weronikaolejniczak/eui that referenced this pull request Apr 7, 2026
mgadewoll added a commit to elastic/kibana that referenced this pull request Apr 13, 2026
## 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]>
weronikaolejniczak pushed a commit to weronikaolejniczak/eui that referenced this pull request May 5, 2026
patrykkopycinski pushed a commit to patrykkopycinski/kibana that referenced this pull request Aug 5, 2026
## 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]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants