Fix wiki search overflowing on wide screens (#6047)

Confine the search menu to be at most the width of the page, or 80% of
the viewport width, whichever is smaller. To do this, introduce a new
`--container-width` variable for the descendant elements of
`.ui.container` to be able to access.

Also update the relevant e2e test: add a long 'lorem ipsum' page, add a
search for it, parameterize the width.
This commit is contained in:
Oto Šťáva 2024-11-24 16:41:09 +01:00
parent ad70e7dfb3
commit c0777279fe
No known key found for this signature in database
GPG key ID: 32B22D20C9B4E680
10 changed files with 65 additions and 25 deletions

View file

@ -133,8 +133,31 @@ func TestAPIListWikiPages(t *testing.T) {
},
},
{
Title: "Page With Image",
Title: "Long Page",
HTMLURL: meta[1].HTMLURL,
SubURL: "Long-Page",
LastCommit: &api.WikiCommit{
ID: "d49ac742d44063dcf69d4e0afe725813b777dd89",
Author: &api.CommitUser{
Identity: api.Identity{
Name: "Oto Šťáva",
Email: "oto.stava@gmail.com",
},
Date: "2024-11-23T11:16:51Z",
},
Committer: &api.CommitUser{
Identity: api.Identity{
Name: "Oto Šťáva",
Email: "oto.stava@gmail.com",
},
Date: "2024-11-23T11:16:51Z",
},
Message: "add long page\n",
},
},
{
Title: "Page With Image",
HTMLURL: meta[2].HTMLURL,
SubURL: "Page-With-Image",
LastCommit: &api.WikiCommit{
ID: "0cf15c3f66ec8384480ed9c3cf87c9e97fbb0ec3",
@ -157,7 +180,7 @@ func TestAPIListWikiPages(t *testing.T) {
},
{
Title: "Page With Spaced Name",
HTMLURL: meta[2].HTMLURL,
HTMLURL: meta[3].HTMLURL,
SubURL: "Page-With-Spaced-Name",
LastCommit: &api.WikiCommit{
ID: "c10d10b7e655b3dab1f53176db57c8219a5488d6",
@ -180,7 +203,7 @@ func TestAPIListWikiPages(t *testing.T) {
},
{
Title: "Unescaped File",
HTMLURL: meta[3].HTMLURL,
HTMLURL: meta[4].HTMLURL,
SubURL: "Unescaped-File",
LastCommit: &api.WikiCommit{
ID: "0dca5bd9b5d7ef937710e056f575e86c0184ba85",