Skip to content
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
8 changes: 8 additions & 0 deletions crates/bin/docs_rs_web/templates/style/_navbar.scss
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,14 @@ div.nav-container {
@media #{$media-md} {
.docsrs-logo, .pure-menu-item .pure-menu-text, .pure-menu-item .pure-menu-link {
padding: 6.4px 16px 6.4px 16px;
display: flex;
align-items: center;
gap: 4px;

.title {
text-overflow: ellipsis;
overflow: hidden;
}
}
}

Expand Down
2 changes: 1 addition & 1 deletion gui-tests/crate-topbar-dropdown-menu.goml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ define-function: (
assert-css: (
|crate_main_info_items| + "> *",
{"padding": |padding|},
ALL,
ALL,
Comment thread
syphar marked this conversation as resolved.
)
},
)
Expand Down
47 changes: 47 additions & 0 deletions gui-tests/long-crate-name-topbar.goml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
go-to: |DOC_PATH| + "/sysinfo"

set-window-size: (1000, 800)

define-function: (
"check-crate-name-elems",
[],
block {
// First we store the size and position of the crate name menu item in the topbar.
store-size: (
"#nav-search-form .pure-menu-link.crate-name",
{"width": width, "height": height}
)
store-position: (
"#nav-search-form .pure-menu-link.crate-name",
{"x": x, "y": y}
)

// Then we store the same info for the title itself and the menu arrow (ie "▼").
store-position: (
"#nav-search-form .pure-menu-link.crate-name .title",
{"x": title_x, "y": title_y}
)
store-size: (
"#nav-search-form .pure-menu-link.crate-name .title",
{"width": title_width}
)
store-position: (
"#nav-search-form .pure-menu-link.crate-name::after",
{"x": after_x, "y": after_y}
)
store-size: (
"#nav-search-form .pure-menu-link.crate-name::after",
{"width": after_width}
)
// And finally we ensure that none of it overflows and that it's all visible.
assert: |title_x| + |title_width| < |x| + |width|
assert: |after_x| + |after_width| < |x| + |width|
}
)

call-function: ("check-crate-name-elems", {})
set-text: (
"#nav-search-form .pure-menu-link.crate-name .title",
"antesdfsdfdsfsdfsdcedent-stats-sdfksndflksdn",
)
call-function: ("check-crate-name-elems", {})
Loading