Closed sapslaj closed 5 months ago
The issue is visible on the demo site: https://demo.backstage.io/catalog/default/component/backstage/docs
Here is my closed issue from -22: https://github.com/backstage/backstage/issues/13717
@sapslaj thanks for filing this! our team would love for this to be improved for better usability in techdocs. We'd love to see this fixed upstream from us, and are happy to support this if we can be at all helpful!
A work-around for the double scrollbars:
packages/app/src/App.css:
/* TechDoc overflow fix */
#root > div > main > article > div > main {
overflow-y: visible;
height: 100%;
}
/* TechDoc padding fix */
#root > div > main > article > div > main > article,
#root > div > main > article > div > main > div {
padding: 0;
}
Would be great if this could be fixed, even in the Demo Instance there are not only redundant scrollbars but also scrolling works not reliable in the left navigation pane.
I might have a hint on where this issue is coming from for the doc navigation and ToC. There's a negative bottom margin on the nav for those. When I disable it in the dev console the problem goes away (Firefox on Mac)
I have no idea why that negative margin is there tho.
Let's see, whether the change done in the following PR fix the issue:
I'm experiencing this with Chrome and Edge, so it would be nice to have this fixed. Here's an example with Edge:
This is caused by this line in the page component: https://github.com/backstage/backstage/blob/4935ebd06fca77679629b289b9ac511c5191a25e/packages/core-components/src/layout/Page/Page.tsx#L31
Which is called by the TechdocsReaderPage: https://github.com/backstage/backstage/blob/4935ebd06fca77679629b289b9ac511c5191a25e/plugins/techdocs/src/reader/components/TechDocsReaderPage/TechDocsReaderPage.tsx#L196
Perhaps this should be changed to minheight? That fixes it if I change it in devtools.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
Just bumping this as it's still being reported repeatedly by our users as frustrating!
I concur. We're just beginning our TechDocs rollout and we're already seeing this behavior. Consumer feedback has not been positive with the duplicative scrollbars.
While a real fix is needed, to make your users happy, you can work around it by adding the following to your App.css:
/* TechDoc overflow fix */
#root > div > main > article > div > main {
overflow-y: visible;
height: 100%;
}
/* TechDoc padding fix */
#root > div > main > article > div > main > article,
#root > div > main > article > div > main > div {
padding: 0;
}
While a real fix is needed, to make your users happy, you can work around it by adding the following to your App.css:
/* TechDoc overflow fix */ #root > div > main > article > div > main { overflow-y: visible; height: 100%; } /* TechDoc padding fix */ #root > div > main > article > div > main > article, #root > div > main > article > div > main > div { padding: 0; }
@GLundh, We created an App.css and used this code. It didn't seem to fix the problem. Are we missing something?
While a real fix is needed, to make your users happy, you can work around it by adding the following to your App.css:
/* TechDoc overflow fix */ #root > div > main > article > div > main { overflow-y: visible; height: 100%; } /* TechDoc padding fix */ #root > div > main > article > div > main > article, #root > div > main > article > div > main > div { padding: 0; }
@GLundh, We created an App.css and used this code. It didn't seem to fix the problem. Are we missing something?
packages/app/src/index.tsx:
import React from 'react';
import ReactDOM from 'react-dom/client';
import App from './App';
import './App.css';
ReactDOM.createRoot(document.getElementById('root')!).render(<App />);
Re-opening this as this hasn't be resolved based on recent comments. I'm reaching out to the TechDocs team as well.
@GLundh, just curious, you've got a fix you are suggesting for others, is there any reason you haven't contributed that back as a PR? Or is there some edge cases that this doesn't cover?
Fixing the issue with global app css rules is just a hacky workaround. I don't understand the techdocs stack enough to write a fix that I'm happy with. This is just about good enough to make our users happy (and I kinda understand others' pain of trying to roll out techdocs with this bug). I have no idea if it works well enough with other themes.
I still hope that someone that really gets the techdocs-stuff takes a look at the issue.
Thanks @GLundh, appreciate the follow up. My CSS skills are not enough to take this on sadly.
While a real fix is needed, to make your users happy, you can work around it by adding the following to your App.css:
/* TechDoc overflow fix */ #root > div > main > article > div > main { overflow-y: visible; height: 100%; } /* TechDoc padding fix */ #root > div > main > article > div > main > article, #root > div > main > article > div > main > div { padding: 0; }
@GLundh, We created an App.css and used this code. It didn't seem to fix the problem. Are we missing something?
packages/app/src/index.tsx:
import React from 'react'; import ReactDOM from 'react-dom/client'; import App from './App'; import './App.css'; ReactDOM.createRoot(document.getElementById('root')!).render(<App />);
@GLundh Thank you. Unfortunately it didn't work for us. No idea why. This seems like a fundamental problem in TechDocs. Would be nice to see a permanent fix.
Alright, see PR above, making things a whole lot better.
On the demo site I noticed that while scrolling TOC sidebar doesn't highlight the active heading. I also have this problem in my project. Does anyone know what might be the cause?
📜 Description
I'm not sure if this affects other operating systems, but in Chrome and Firefox on macOS there are redundant scrollbars for each sidebar on a TechDocs page.
👍 Expected behavior
Safari seems to render correctly:
Note the lack of a scrollbar on the left sidebar and only a single scrollbar on the right side for the Table of contents.
👎 Actual Behavior with Screenshots
In Firefox:
In Chrome (with light mode):
To clarify, the issue happens in both dark and light mode on both browsers.
Note the unnecessary scrollbar on the left sidebar, as well as the right sidebar having two scrollbars (only one of which does anything useful).
Also the real scrollbar appears to be styled incorrectly in the dark theme; see the right sidebar's scrollbar.
👟 Reproduction steps
📃 Provide the context for the Bug.
I played around a bit but couldn't figure out a proper fix without a lot of extra work since there's no good way to "monkeypatch" the CSS the techdocs plugin injects. But I think the fix is to just set
overflow-y: visible;
on.md-sidebar__scrollwrap
. If you make that change via the browser's devtools it fixes the issue.As for the scrollbar styling with the dark theme, technically that's a different issue, but unsetting
scrollbar-color
in.md-sidebar
makes it look less bad.🖥️ Your Environment
Firefox 122.0 and Chrome 121.0.6167.139
👀 Have you spent some time to check if this bug has been raised before?
🏢 Have you read the Code of Conduct?
Are you willing to submit PR?
Yes I am willing to submit a PR!