freeCodeCamp / freeCodeCamp/devdocs

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

未关闭
#1,100 7 条评论 1 个 reaction 已指派 0 人 在 GitHub 查看
bug
主要语言
Ruby
星标
39.5k
派生
2.6k
平均合并
4 天 32 分钟
30 天内合并 PR
13

描述

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.

贡献指南

打开贡献指南

调研方向

该 issue 没有指出文件、测试或入口点。首先定位浏览器 UI 中描述的窄窗口或紧凑布局行为,然后将其与正常布局及其自动隐藏的侧边栏进行比较。移除独立的紧凑布局,并使搜索选择行为与正常布局保持一致,即视为完成。

由索引模型根据 Issue 内容生成。

评估

领域
frontend
Issue 类型
功能
难度
3/5
预计耗时
1-2 天
活跃度
停滞
描述清晰度
基本清楚
新手友好度
35/100

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。