From 8fac988cb1cad54fc3702eb582d79b835a773a30 Mon Sep 17 00:00:00 2001 From: Guillaume Gomez Date: Mon, 3 Feb 2025 13:29:27 +0100 Subject: [PATCH 1/5] Fix display of long crates name in release list --- templates/style/style.scss | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/templates/style/style.scss b/templates/style/style.scss index 297b87940..99b50fb8c 100644 --- a/templates/style/style.scss +++ b/templates/style/style.scss @@ -319,6 +319,9 @@ div.recent-releases-container { &:hover { background-color: transparent; + overflow: visible; + white-space: normal; + word-break: break-word; } &::before { @@ -335,11 +338,6 @@ div.recent-releases-container { color: var(--color-standard); } - .name:hover { - overflow: visible; - white-space: normal; - } - .build { font-weight: 500; From de6b20ff73b9ba48d1faf02e4e09c9c8553b97d9 Mon Sep 17 00:00:00 2001 From: Guillaume Gomez Date: Mon, 3 Feb 2025 14:00:27 +0100 Subject: [PATCH 2/5] Reduce size of generated HTML --- templates/core/home.html | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/templates/core/home.html b/templates/core/home.html index 1e3cb0247..1e2d60cc3 100644 --- a/templates/core/home.html +++ b/templates/core/home.html @@ -36,7 +36,7 @@

{{ crate::icons::IconCubes.render_solid(false, false, "") }} D Recent Releases - {{ crate::icons::IconSquareRss.render_solid(false, false, "") }} + {{- crate::icons::IconSquareRss.render_solid(false, false, "") -}} @@ -54,16 +54,16 @@

{{ crate::icons::IconCubes.render_solid(false, false, "") }} D class="release">
- {{ release.name }}-{{ release.version }} + {{- release.name }}-{{ release.version -}}
- {{ release.description.as_deref().unwrap_or_default() }} + {{- release.description.as_deref().unwrap_or_default() -}}
{%- if let Some(build_time) = release.build_time -%} -
- {{ build_time|timeformat }} + {{- build_time|timeformat -}}
{%- endif -%}
From 1eaf3c0eb31b6c73cc2502fe6340b6d68b2a71a8 Mon Sep 17 00:00:00 2001 From: Guillaume Gomez Date: Tue, 4 Feb 2025 17:09:02 +0100 Subject: [PATCH 3/5] Update browser-ui-test to `0.20.1` --- dockerfiles/Dockerfile-gui-tests | 2 +- gui-tests/tester.js | 4 +--- gui-tests/topbar-resize.goml | 8 ++++---- 3 files changed, 6 insertions(+), 8 deletions(-) diff --git a/dockerfiles/Dockerfile-gui-tests b/dockerfiles/Dockerfile-gui-tests index 4e4108d2d..18c1684ee 100644 --- a/dockerfiles/Dockerfile-gui-tests +++ b/dockerfiles/Dockerfile-gui-tests @@ -74,7 +74,7 @@ RUN mkdir out # https://github.com/puppeteer/puppeteer/issues/375 # # We also specify the version in case we need to update it to go around cache limitations. -RUN npm install -g browser-ui-test@0.16.10 --unsafe-perm=true +RUN npm install -g browser-ui-test@0.20.1 --unsafe-perm=true EXPOSE 3000 diff --git a/gui-tests/tester.js b/gui-tests/tester.js index 4ab8d0187..147498de4 100644 --- a/gui-tests/tester.js +++ b/gui-tests/tester.js @@ -122,9 +122,7 @@ async function main(argv) { const options = new Options(); try { // This is more convenient that setting fields one by one. - const args = [ - "--no-sandbox", - ]; + const args = []; if (typeof process.env.SERVER_URL !== "undefined") { args.push("--variable", "DOC_PATH", process.env.SERVER_URL); } else { diff --git a/gui-tests/topbar-resize.goml b/gui-tests/topbar-resize.goml index 252baa813..62282a071 100644 --- a/gui-tests/topbar-resize.goml +++ b/gui-tests/topbar-resize.goml @@ -4,7 +4,7 @@ store-value: (window_height, 1000) define-function: ( "check-topbar", - (width, text_display, search_display, search_max_width), + [width, text_display, search_display, search_max_width], block { set-window-size: (|width|, |window_height|) wait-for-css: (".nav-container > .container a > .title", {"display": |text_display|}) @@ -24,7 +24,7 @@ define-function: ( define-function: ( "check-topbar-sizes", - (), + [], block { set-window-size: (1100, |window_height|) store-size: ("body > .nav-container", {"height": top_navbar_height}) @@ -92,7 +92,7 @@ define-function: ( ) go-to: |DOC_PATH| + "/sysinfo" -call-function: ("check-topbar-sizes", ()) +call-function: ("check-topbar-sizes", {}) go-to: |DOC_PATH| + "/releases/search?query=sysinfo" -call-function: ("check-topbar-sizes", ()) +call-function: ("check-topbar-sizes", {}) From fbad628027092364741ce5c330d7ab34905f0c0c Mon Sep 17 00:00:00 2001 From: Guillaume Gomez Date: Tue, 4 Feb 2025 17:59:19 +0100 Subject: [PATCH 4/5] Add regression test for #2733 --- gui-tests/long-crate-name.goml | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 gui-tests/long-crate-name.goml diff --git a/gui-tests/long-crate-name.goml b/gui-tests/long-crate-name.goml new file mode 100644 index 000000000..43ffb9b2e --- /dev/null +++ b/gui-tests/long-crate-name.goml @@ -0,0 +1,16 @@ +// Checks that the crate name in release list doesn't overflow when hovered. + +go-to: |DOC_PATH| +// We reduce the width to 800px because the text will be on 3 different lines. Meaning +// that if it overflows, the height will be smaller than expected since it will only take +// 2 lines. +set-window-size: (1200, 600) +set-text: ("ul a.release .name", "blabla_under_something_longname_right-0.7.0") +move-cursor-to: "ul a.release .name" +assert-css: ("ul a.release .name:hover", { "line-height": "22.4px" }) +// 45 / 2 = 22.5, so it's on 2 lines +assert-size: ("ul a.release .name:hover", { "height": 45 }) +// We reduce the width to it should now take 3 lines. +set-window-size: (800, 600) +// 67 / 2 = 33.5, so it's more than 2 lines +assert-size: ("ul a.release .name:hover", { "height": 67 }) From 553e4ba2d4c6d0d8af21b3dc85dde424637949da Mon Sep 17 00:00:00 2001 From: Guillaume Gomez Date: Wed, 5 Feb 2025 10:38:37 +0100 Subject: [PATCH 5/5] Update nodejs version to `22.13.1` --- dockerfiles/Dockerfile-gui-tests | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/dockerfiles/Dockerfile-gui-tests b/dockerfiles/Dockerfile-gui-tests index 18c1684ee..9f0440331 100644 --- a/dockerfiles/Dockerfile-gui-tests +++ b/dockerfiles/Dockerfile-gui-tests @@ -61,9 +61,9 @@ RUN apt-get install -y \ RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | bash -s -- -y --default-toolchain nightly --no-modify-path --profile minimal ENV PATH="/root/.cargo/bin:${PATH}" -RUN curl -sL https://nodejs.org/dist/v14.4.0/node-v14.4.0-linux-x64.tar.xz | tar -xJ -ENV PATH="/node-v14.4.0-linux-x64/bin:${PATH}" -ENV NODE_PATH="/node-v14.4.0-linux-x64/lib/node_modules/" +RUN curl -sL https://nodejs.org/dist/v22.13.1/node-v22.13.1-linux-x64.tar.xz | tar -xJ +ENV PATH="/node-v22.13.1-linux-x64/bin:${PATH}" +ENV NODE_PATH="/node-v22.13.1-linux-x64/lib/node_modules/" WORKDIR /build