Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Flyout: overlapping content #395

Open
thephez opened this issue Oct 3, 2024 · 13 comments
Open

Flyout: overlapping content #395

thephez opened this issue Oct 3, 2024 · 13 comments
Assignees
Labels
Needed: design decision A core team decision is required

Comments

@thephez
Copy link

thephez commented Oct 3, 2024

Is there a way to customize the location of the flyout? The switch from a static location on the bottom left to this floating thing on the right is pretty invasive for themes that take advantage of the right side of the screen. I didn't see anything on https://docs.readthedocs.io/en/stable/addons.html#enabling-read-the-docs-addons about how to adjust this and don't see an option on the dashboard other than enabling/disabling.

image

Front logo Front conversations

@humitos humitos added the Needed: design decision A core team decision is required label Oct 7, 2024
@humitos
Copy link
Member

humitos commented Oct 7, 2024

Hi @thephez! Thanks for the feedback. Currently, we only support enabling/disabling the floating flyout as you figured it out already. We are working together with theme authors to integrate this data into their own themes so it doesn't cover the useful content.

@humitos humitos changed the title Flyout overlapping content Flyout: overlapping content Oct 10, 2024
@humitos
Copy link
Member

humitos commented Oct 10, 2024

Related to

@sciencewhiz
Copy link

It also takes up content space on mobile

@ferdnyc
Copy link

ferdnyc commented Jan 2, 2025

As @thephez said,

The switch from a static location on the bottom left to this floating thing on the right is pretty invasive for themes that take advantage of the right side of the screen.

I notice that the flyout.css file even supports positioning at the bottom-left, top-left, and top-right... it's just that bottom-right is hardcoded in flyout.js currently. (And because the flyout exists in a ShadowRoot, AFAICT it can't be styled by CSS in the main page.)

Just being able to configure the position class from bottom-right to bottom-left would be a big help, particularly if it could be done from within a theme (since they know best where in their layout the flyout won't interfere with other content).

@humitos
Copy link
Member

humitos commented Jan 9, 2025

Just being able to configure the position class from bottom-right to bottom-left would be a big help, particularly if it could be done from within a theme (since they know best where in their layout the flyout won't interfere with other content).

We are working on this approach. The goal is to leave theme authors the chance to define the web component on their theme like <readthedocs-flyout position="bottom-left"></readthedocs-flyout> to display the flyout at the bottom left. However, we also want to give the project owners the ability to change this value defined by the theme from the WebUI/dashboard. Take a look at this PR that explains how it works: #482

@ferdnyc @thephez would that be useful for your use case? We will really appreciate your feedback at this development stage.

@thephez
Copy link
Author

thephez commented Jan 9, 2025

Yes, having the option in the dashboard would be helpful for me. Hopefully themes will eventually be able to integrate it well too. But the dashboard option shown in #482, plus the ability to customize the appearance, would definitely be helpful in the near term. 👍

@ericholscher
Copy link
Member

We shipped the location in the Addons settings, so you should at least be able to update it now. Let us know if that works for you.

@thephez
Copy link
Author

thephez commented Jan 15, 2025

Thanks! This gives us some flexibility. Looks like it worked as expected 👍

@ferdnyc
Copy link

ferdnyc commented Jan 17, 2025

@ericholscher Being able to manually set the location in the project setting seems to work fine; I notice it doesn't require a rebuild of the docs (nice!), but does seem to require a force-reload of the page to get it to switch location, at least in Windows Chrome 131.0.6778.266 (Official Build) (64-bit). Still, that's minor.

I'll need to experiment with the theme-driven location feature... I'm using the Furo theme which hasn't been updated to use <readthedocs-flyout position="bottom-left"></readthedocs-flyout> yet... but I'll try with a forked copy, and assuming that works as expected I can open a PR to update Furo accordingly.

Thanks!

@ferdnyc
Copy link

ferdnyc commented Jan 17, 2025

Hmm. Sorry, I guess I'm not clear from the discussion here or in #482 exactly where the <readthedocs-flyout position="bottom-left"></readthedocs-flyout> tag is expected to be.

I created a fork of Furo and added it to the footer code for the page, and while I see the tag in the source for my test project, the flyout hasn't moved.

Is <readthedocs-flyout> a body tag, or a head tag? If body, does it need to be set at any specific level of the DOM?

@humitos
Copy link
Member

humitos commented Jan 20, 2025

Is <readthedocs-flyout> a body tag, or a head tag? If body, does it need to be set at any specific level of the DOM?

It's a body tag, yes. It doesn't have to be at any specific location when using position="bottom-left" since it's a floating position. We are currently working on a position="inline" that will behave as an inline HTML element in #500. That positioning will depend on its DOM's context.

@ferdnyc
Copy link

ferdnyc commented Jan 20, 2025

@humitos Thanks, that's good to hear.

Augh! And the problem in my test project is that I used <rtd-flyout> instead, dunno how I made that mistake.

@ferdnyc
Copy link

ferdnyc commented Jan 20, 2025

I can confirm that when you actually use the correct tag name, it works as expected. 🫢

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Needed: design decision A core team decision is required
Projects
Status: Planned
Development

No branches or pull requests

5 participants