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

Fix horizontal scrollbar appearing whereas it should not #2382

Merged
merged 2 commits into from
Jan 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
139 changes: 77 additions & 62 deletions gui-tests/topbar-resize.goml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,11 @@ define-function: (
block {
set-window-size: (|width|, |window_height|)
wait-for-css: (".nav-container > .container a > .title", {"display": |text_display|})

// We check that there is no horizontal scrollbar (which would be because of docs.rs
// topbar).
assert-window-property: {"innerWidth": |width|}

assert-css: ("#search-input-nav", {"display": |search_display|, "max-width": |search_max_width|})
assert-size: ("body > .nav-container", {"height": |top_navbar_height|})

Expand All @@ -17,67 +22,77 @@ define-function: (
}
)

go-to: |DOC_PATH| + "/sysinfo"
define-function: (
"check-topbar-sizes",
(),
block {
set-window-size: (1100, |window_height|)
store-size: ("body > .nav-container", {"height": top_navbar_height})

set-window-size: (1100, |window_height|)
store-size: ("body > .nav-container", {"height": top_navbar_height})
call-function: ("check-topbar", {
"width": 1000,
"text_display": "inline",
"search_display": "block",
"search_max_width": "200px",
})
call-function: ("check-topbar", {
"width": 900,
"text_display": "inline",
"search_display": "block",
"search_max_width": "200px",
})
call-function: ("check-topbar", {
"width": 872,
"text_display": "inline",
"search_display": "block",
"search_max_width": "200px",
})
// From this point, text should not be displayed anymore.
call-function: ("check-topbar", {
"width": 871,
"text_display": "none",
"search_display": "block",
"search_max_width": "200px",
})
call-function: ("check-topbar", {
"width": 768,
"text_display": "none",
"search_display": "block",
"search_max_width": "200px",
})
// From this point, search input should be smaller.
call-function: ("check-topbar", {
"width": 767,
"text_display": "none",
"search_display": "block",
"search_max_width": "150px",
})
call-function: ("check-topbar", {
"width": 568,
"text_display": "none",
"search_display": "block",
"search_max_width": "150px",
})
// From this point, search input should not be displayed anymore.
call-function: ("check-topbar", {
"width": 567,
"text_display": "none",
"search_display": "none",
"search_max_width": "150px",
})
// Even at very small width, we maintain the height of the topbar, but such cases will very likely
// never happen "in real life".
call-function: ("check-topbar", {
"width": 272,
"text_display": "none",
"search_display": "none",
"search_max_width": "150px",
})
}
)

go-to: |DOC_PATH| + "/sysinfo"
call-function: ("check-topbar-sizes", ())

call-function: ("check-topbar", {
"width": 1000,
"text_display": "inline",
"search_display": "block",
"search_max_width": "200px",
})
call-function: ("check-topbar", {
"width": 900,
"text_display": "inline",
"search_display": "block",
"search_max_width": "200px",
})
call-function: ("check-topbar", {
"width": 872,
"text_display": "inline",
"search_display": "block",
"search_max_width": "200px",
})
// From this point, text should not be displayed anymore.
call-function: ("check-topbar", {
"width": 871,
"text_display": "none",
"search_display": "block",
"search_max_width": "200px",
})
call-function: ("check-topbar", {
"width": 768,
"text_display": "none",
"search_display": "block",
"search_max_width": "200px",
})
// From this point, search input should be smaller.
call-function: ("check-topbar", {
"width": 767,
"text_display": "none",
"search_display": "block",
"search_max_width": "150px",
})
call-function: ("check-topbar", {
"width": 568,
"text_display": "none",
"search_display": "block",
"search_max_width": "150px",
})
// From this point, search input should not be displayed anymore.
call-function: ("check-topbar", {
"width": 567,
"text_display": "none",
"search_display": "none",
"search_max_width": "150px",
})
// Even at very small width, we maintain the height of the topbar, but such cases will very likely
// never happen "in real life".
call-function: ("check-topbar", {
"width": 272,
"text_display": "none",
"search_display": "none",
"search_max_width": "150px",
})
go-to: |DOC_PATH| + "/releases/search?query=sysinfo"
call-function: ("check-topbar-sizes", ())
1 change: 1 addition & 0 deletions templates/style/_navbar.scss
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,7 @@ div.nav-container {
box-shadow: none;
background-color: var(--color-background);
height: 100%;
width: 50%;
syphar marked this conversation as resolved.
Show resolved Hide resolved
}
}

Expand Down
Loading