Skip to content

Commit 4dba16b

Browse files
Merge branch 'main' into maximus-sidebar-scroll-anchor-578
2 parents ea03101 + a3fccd6 commit 4dba16b

27 files changed

+330
-183
lines changed

.github/workflows/playwright.yml

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Testing for visual regression on old theme
1+
name: Running Playwright test on UI
22

33
# Run the workflow when code is pushed or when a pull request is created
44
on:
@@ -25,19 +25,16 @@ jobs:
2525
- name: Install dependencies and playwright browsers
2626
run: cd tests && npm ci && npx playwright install --with-deps
2727
- name: Run Playwright tests
28-
id: test-visual
28+
id: test-ui
2929
run: |
3030
make tests | tee output.log
31-
if grep -q -e "Error: A snapshot doesn't exist at" -e "Screenshot comparison failed" output.log; then
32-
echo "Playwright tests failed due to a snapshot issue."
33-
exit 1
34-
elif grep -q "failed" output.log; then
35-
echo "Playwright tests failed due to a non-snapshot issue."
31+
if grep -q "failed" output.log; then
32+
echo "Playwright tests failed. Please view the Playwright report to see full error."
3633
exit 1
3734
fi
3835
- uses: actions/upload-artifact@v4
3936
id: artifact-upload
40-
if: ${{ !cancelled() && failure() && steps.test-visual.conclusion == 'failure' }}
37+
if: ${{ !cancelled() && failure() && steps.test-ui.conclusion == 'failure' }}
4138
with:
4239
name: playwright-report
4340
path: tests/playwright-report/
@@ -47,10 +44,9 @@ jobs:
4744
if: ${{ failure() }}
4845
with:
4946
script: |
50-
const body = `### <span aria-hidden="true">❌</span> Playwright visual snapshot differences were detected.
47+
const body = `### <span aria-hidden="true">❌</span> Playwright differences were detected.
5148
52-
View the [Playwright report](${{ steps.artifact-upload.outputs.artifact-url }})
53-
**To approve the snapshot changes and update the snapshots, please comment:** /approve-snapshots`;
49+
View the [Playwright report](${{ steps.artifact-upload.outputs.artifact-url }})`;
5450
5551
await github.rest.issues.createComment({
5652
issue_number: context.issue.number,

.github/workflows/update-screenshot.yml

Lines changed: 0 additions & 58 deletions
This file was deleted.

Makefile

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,18 +5,18 @@ WRITE_FLAG := --write
55
list help::
66
$(info Available Make targets:)
77
@echo "<COMMON>"
8-
@echo " list | help: Print these available make targets"
8+
@echo " list | help: Print these available make targets"
99
@echo "<LINTING AND FORMATTING>"
1010
@echo " biome-format: Runs the biome formatter."
1111
@echo " biome-lint: Runs the biome linter."
1212
@echo " biome-all: Runs both the lint and formatting commands."
1313
@echo " build-example-site: Builds hugo exampleSite."
14-
@echo " (Set BIOME_ARGS to add additional arguments to biome command (ex: make biome-all BIOME_ARGS=write))"
14+
@echo "(Set BIOME_ARGS to add additional arguments to biome command (ex: make biome-all BIOME_ARGS=write))"
1515
@echo "<PRE-COMMIT>"
1616
@echo " setup-pre-commit: Sets up pre-commit (assuming it is installed)"
1717
@echo "<PLAYWRIGHT TESTS>"
18-
@echo " tests: Runs playwright against the old theme."
19-
@echo " tests-update-screenshots: Runs playwright against the old theme."
18+
@echo " tests: Runs playwright against the new theme."
19+
@echo " tests-update-screenshots: Runs playwright against the new theme."
2020

2121
.PHONY: biome-format biome-lint biome-all setup-pre-commit tests build-example-site
2222
FLAG :=

assets/css/v2/style.css

Lines changed: 38 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -426,12 +426,9 @@ ol li:last-child {
426426
"content"
427427
"footer";
428428

429-
.text-content {
430-
margin-block-start: 1rem;
431-
}
432-
433429
.breadcrumb-layout {
434430
align-items: center;
431+
display: flex;
435432
padding: var(--space-xs) 0;
436433

437434
&::after {
@@ -1264,11 +1261,6 @@ main {
12641261
}
12651262
}
12661263

1267-
/* Handles different flow-gap of list page */
1268-
.list-page.text-content {
1269-
grid-template-rows: calc(70px + var(--flow-gap)) max-content;
1270-
}
1271-
12721264
/* MARK: Qualtrics
12731265
*/
12741266

@@ -1390,42 +1382,42 @@ atomic-search-box {
13901382
width: 18.5rem;
13911383
display: flex;
13921384
align-items: center;
1393-
}
13941385

1395-
atomic-search-box::part(input) {
1396-
height: 2.25rem;
1397-
font-size: var(--font-step--1);
1398-
padding: 0.5rem 1rem;
1399-
box-sizing: border-box;
1400-
}
1386+
&::part(input) {
1387+
height: 2.25rem;
1388+
font-size: var(--font-step--1);
1389+
padding: 0.5rem 1rem;
1390+
box-sizing: border-box;
1391+
}
14011392

1402-
atomic-search-box::part(textarea-expander) {
1403-
white-space: nowrap;
1404-
overflow-x: auto;
1405-
overflow-y: hidden;
1406-
resize: none;
1407-
}
1393+
&::part(textarea-expander) {
1394+
white-space: nowrap;
1395+
overflow-x: auto;
1396+
overflow-y: hidden;
1397+
resize: none;
1398+
}
14081399

1409-
atomic-search-box::part(textarea) {
1410-
padding-left: 0;
1411-
padding-right: 0;
1412-
font-weight: 400;
1413-
}
1400+
&::part(textarea) {
1401+
padding-left: 0;
1402+
padding-right: 0;
1403+
font-weight: 400;
1404+
}
14141405

1415-
atomic-search-box::part(wrapper) {
1416-
height: 100%;
1417-
display: flex;
1418-
flex-direction: row-reverse;
1419-
align-items: center;
1420-
}
1406+
&::part(wrapper) {
1407+
height: 100%;
1408+
display: flex;
1409+
flex-direction: row-reverse;
1410+
align-items: center;
1411+
}
14211412

1422-
atomic-search-box::part(submit-button) {
1423-
order: -1;
1424-
padding-right: 0;
1425-
}
1413+
&::part(submit-button) {
1414+
order: -1;
1415+
padding-right: 0;
1416+
}
14261417

1427-
atomic-search-box::part(submit-button-wrapper) {
1428-
margin: 0;
1418+
&::part(submit-button-wrapper) {
1419+
margin: 0;
1420+
}
14291421
}
14301422

14311423
atomic-search-interface#search-standalone-header {
@@ -1456,6 +1448,12 @@ body:not(:has(.main-layout)) header atomic-search-interface {
14561448
display: block;
14571449
}
14581450

1451+
body:has(atomic-refine-modal[is-open=""]) {
1452+
/* Lock scrolling when modal is up */
1453+
position: fixed;
1454+
width: 100%;
1455+
}
1456+
14591457
@media (max-width: 88rem) {
14601458
/* Show on pages with sidebar if it is hidden */
14611459
body:has(.sidebar-layout) header atomic-search-interface {
@@ -1911,6 +1909,7 @@ a:hover {
19111909

19121910
.list-header-container {
19131911
display: flex;
1912+
margin-top: var(--space-s);
19141913
gap: 1.5rem;
19151914
align-items: center;
19161915
justify-content: start;

exampleSite/content/test-product/tab-group/tab-group.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ weight: 200
66

77
## tab-group
88

9+
<div data-testid="tabs-test__basic">
910
{{<tabs name="common_steps_for_nginx_oss_and_plus">}}
1011

1112
{{%tab name="Call Outs"%}}
@@ -65,6 +66,7 @@ nginx -s reload
6566

6667

6768
{{</tabs>}}
69+
</div>
6870

6971

7072
## Much nested tab group

exampleSite/go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,6 @@ module github.com/nginxinc/docs
22

33
go 1.23
44

5-
require github.com/nginxinc/nginx-hugo-theme v0.41.27 // indirect
5+
require github.com/nginxinc/nginx-hugo-theme v1.0.4 // indirect
66

77
replace github.com/nginxinc/nginx-hugo-theme => ../

layouts/404.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{{ define "main"}}
22

3-
<div class="content no-sidebar">
4-
<div class="not-found-container">
3+
<div class="content no-sidebar" data-testid="content">
4+
<div class="not-found-container" data-testid="not-found-container">
55
<h1 class="info-header">
66
HTTP 404 - Page not found
77
</h1>

layouts/_default/baseof.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,17 +44,17 @@
4444
<input type="checkbox" id="search-standalone-header-panel" class="search-standalone-header-panel" hidden/>
4545
<input type="checkbox" id="sidebar-panel" class="sidebar-panel" hidden/>
4646
<div class="grid-container">
47-
<aside class="sidebar">
47+
<aside class="sidebar" data-testid="sidebar">
4848
{{ partial "sidebar-v2.html" . }}
4949
</aside>
5050

51-
<header class="header">
51+
<header class="header" data-testid="header">
5252
{{ block "header" . }}{{end}}
5353
</header>
5454

5555
{{ block "main" . }}{{ end }}
5656

57-
<footer class="footer">
57+
<footer class="footer" data-testid="footer">
5858
{{ block "footer-v2" . }}
5959
{{ partial "footer-v2.html" . }}
6060
{{ end }}

layouts/_default/list.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
{{ define "main" }}
22

3-
<main class="content" role="main">
3+
<main class="content" role="main" data-testid="content">
44
<div data-cms-edit="content" class="text-content list-page">
5-
<div class="breadcrumb-layout">
5+
<div class="breadcrumb-layout" data-grid="wide">
66
{{ if not .IsHome }}
77
{{ if not (in .Params.display_breadcrumb "false" ) }}
88
{{ partial "breadcrumb" .}}
@@ -30,7 +30,7 @@ <h1>{{ .Title }}</h1>
3030

3131
<h2> In this section </h2>
3232
<div class="card-section">
33-
<div class="card-section-content card-grid">
33+
<div class="card-section-content card-grid" data-testid="header-search-dropdown">
3434
{{ range .Pages.ByWeight }}
3535
<a href="{{ .Permalink }}" alt="{{ .Title }}" class="card" data-grid="first-two-thirds">
3636
<div class="card-container">

layouts/_default/single.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{{ define "main" }}
2-
<main class="content">
2+
<main class="content" data-testid="content">
33
<!-- Replace icons -->
44
{{ $content := partial "icon-replacement.html" (dict "content" .Content) }}
55

0 commit comments

Comments
 (0)