freeCodeCamp / freeCodeCamp/devdocs

Don't switch to a different layout when window is too narrow

Ouverte
#1,100 7 commentaires 1 réaction 0 personnes assignées Voir sur GitHub
bug
Langage dominant
Ruby
Étoiles
39.5k
Forks
2.6k
Merge moyen
4 j 32 min
PR mergées (30 j)
13

Description

When the browser window is too narrow (or the browser zoom too high), devdocs switches to a different layout, where the search bar stretches horizontally across the entire screen, the sidebar is hidden by default and it shows up to fill the whole screen when you start typing in the search box.

This, by itself, doesn't sound too bad. However, there are two weird changes in the UI behavior that make this layout less convenient to use than the normal one. Also, the standard layout already includes the option to automatically hide the sidebar, so this seems completely superfluous.

I suggest removing this feature.

The two annoyances mentioned above are:

1. In normal layout, when I type in the search box, the first entry in the sidebar is automatically focused, so I can press enter at any time to display it in the documentation area. In the compact layout, the top entry isn't focused, so to display the doc entry at the top of the list, I have to press the down arrow key to select it and only after that press enter.

2. It's impossible to select the doc entry that's already displayed. This might sound like a weird thing to complain about, but consider the following scenario: I typed stdvec (and did the down-arrow + enter dance) to display documentation for C++ std::vector. I then accidentally pressed g so the search box now contains stdvecg and the search menu pops up to fill the screen and obscure my view. I backspace to remove the g and try to reselect the entry for std::vector but it doesn't work, either through pressing enter or mouse-clicking on it. So the search menu is stuck and I have to either click the hamburger button in the top left corner to hide it or select another documentation entry and then go back to std::vector.
In normal layout with sidebar auto-hiding turned on this works much better. I can just press enter and the sidebar disappears.

Guide de contribution

Ouvrir le guide de contribution

Piste de recherche

The issue does not name a file, test, or entry point. Start by locating the narrow-window or compact-layout behavior described in the browser UI, then compare it with the normal layout and its auto-hiding sidebar. Done means the separate compact layout is removed and search selection behaves consistently with the normal layout.

Rédigé par le modèle d'indexation à partir du texte de l'issue.

Évaluation

Domaine
frontend
Type d'issue
Fonctionnalité
Difficulté
3/5
Temps estimé
1-2 jours
Activité
À l'abandon
Clarté
Plutôt claire
Accessibilité débutants
35/100

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.