Skip to content

Conversation

@DeaMariaLeon
Copy link
Member

@DeaMariaLeon DeaMariaLeon commented Dec 11, 2025

Reference Issues/PRs

The documentation tooltip that we introduced with #31564 is hidden if the parameter name that it belongs to, is at the bottom of the table. It's visible only after scrolling down the cell.
In this case, when we hover over n_jobs, we get:
Screenshot 2025-12-11 at 14 23 33

Using CSS anchor positioning:, the result is the following (when hovering over n_jobs). No scroll-down needed:

Screenshot 2025-12-11 at 14 21 36

There is no opened issue for this.

What does this implement/fix? Explain your changes.

For the record: The specs for anchor-name and position-anchor can't be placed in the params.css file. When I did that, the tooltip was always visible at the bottom of the table - not next to the parameter name.
(It was @glemaitre's idea that the tooltip was getting fixed to the last parameter when using Chrome.)

AI usage disclosure

I used AI assistance for:

  • Moving the style to params.py instead of keeping it on params.css.
  • Test/benchmark generation
  • Documentation (including examples)
  • Research and understanding

Any other comments?

I tried to set Fallback options but I haven't found the correct rule.

Edit: I think the UX would be annoying if I add the fallback options.

@DeaMariaLeon DeaMariaLeon marked this pull request as ready for review December 12, 2025 09:31
)
html_output = _params_html_repr(params)

print(html_output)
Copy link
Member

Choose a reason for hiding this comment

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

This is some remaining debugging I think.

Copy link
Member Author

Choose a reason for hiding this comment

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

🫣 Thanks

@glemaitre
Copy link
Member

I think that you can add an entry in the changelog for the utils because it was indeed a bug and it is much nicer.

Copy link
Member

@glemaitre glemaitre left a comment

Choose a reason for hiding this comment

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

Otherwise, it is an improvement. LGTM.

Copy link
Member

@thomasjpfan thomasjpfan left a comment

Choose a reason for hiding this comment

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

Looking at the anchor-name support table it is not supported in Firefox yet.

With this change, what does the tooltip look like in Firefox?

@DeaMariaLeon
Copy link
Member Author

With this change, what does the tooltip look like in Firefox?

Thanks for asking, because I forgot to check.

With the latest commit, the tooltip looks in Firefox like in the other browsers before this fix. (I added @supports`)

@thomasjpfan thomasjpfan merged commit 3e4a985 into scikit-learn:main Dec 14, 2025
39 checks passed
@DeaMariaLeon DeaMariaLeon deleted the tooltip branch December 15, 2025 07:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants