node icon indicating copy to clipboard operation
node copied to clipboard

Suggestion: split node.js docs into sections like react.dev

Open KostiantynO opened this issue 1 year ago • 1 comments

Affected URL(s)

https://nodejs.org/docs/latest/api/stream.html

Description of the problem

Hello! I have experienced a bug with docs: When I try to select a code snippet, the scrolling goes up very fast.

Highlight any text with mouse:

  • Hold down left mouse button
  • Start selecting text on the page
  • Move cursor above the 50% of the window height

Current result: it selects unwanted information above the highlighted part of text, because of excessive scrolling up. Expected result: It only selects the highlighted text.

Selecting text in Node.js docs send scroll up to the moon

This decreases the usability of the docs significantly, because I can only read them, and cannot reliably copy any text I want to select.

Such problem does not exist in react docs. But in node.js it does exist, and such inconsistency is unacceptable UX.

Suggesting: Node.js do have a very large pages. Maybe it will be better to split them into smaller sections for better usability.

System: OS: Windows 10 Home 22H2 (OS build 19045.4529) Browser: Chrome Version 126.0.6478.116 (Official Build) (64-bit)

KostiantynO avatar Jun 26 '24 15:06 KostiantynO

@nodejs/documentation (The documentation team) @ovflowd (Preparing a redesign FWIW IIRC, React has a different page for each item, while Node.js has a different page for each subsystem. The two projects are documenting much different things.

avivkeller avatar Jun 27 '24 13:06 avivkeller

I just want to select text on the page. I have a very specific need for this. Can it be done in node docs? In react docs any page does not scroll up, while in node docs every page is bugged. I cannot select small portion of a text, because mouse goes to the sky like on provided gif. I would try to help with this in spare time, if it can be done.

KostiantynO avatar Jul 01 '24 22:07 KostiantynO

I see the issue you are describing, but your issue is asking to split the docs like React. if you have an issue with the scrolling, please dedicate an issue directly to that.

avivkeller avatar Jul 01 '24 22:07 avivkeller

A fix for the behavior you described is underway

avivkeller avatar Jul 01 '24 22:07 avivkeller

Oh, thank you! So, people already submitted a PR for node 22 and 17, and are waiting for review. So, this scroll-padding-top on body is to show header in correct position?

P.S. It is fun that backend docs site suffer from pesky CSS bugs :D

KostiantynO avatar Jul 03 '24 21:07 KostiantynO

So, this scroll-padding-top on body is to show header in correct position?

Yes. If the browser were to just scroll the target to the top, like it usually would, it would end up behind the header. This padding basically tells the browser that the visible region starts a bit further down, so scrolling things into view works as expected.

jwueller avatar Jul 13 '24 15:07 jwueller

I've closed this issue, as I think it's been resolved by a PR, if that's not the case, let me know and I'll reopen the issue.

avivkeller avatar Jul 13 '24 15:07 avivkeller