From 61314f05fc7c24436357e4c85884228592c11d71 Mon Sep 17 00:00:00 2001 From: Otto Richter Date: Tue, 17 Sep 2024 17:11:18 +0200 Subject: [PATCH 1/2] tests(e2e): Test overflow in commit graph --- tests/e2e/repo-code.test.e2e.js | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/tests/e2e/repo-code.test.e2e.js b/tests/e2e/repo-code.test.e2e.js index 01179d28d3..62c4f557c1 100644 --- a/tests/e2e/repo-code.test.e2e.js +++ b/tests/e2e/repo-code.test.e2e.js @@ -77,3 +77,10 @@ test('Readable diff', async ({page}, workerInfo) => { } } }); + +test('Commit graph overflow', async ({page}) => { + await page.goto('/user2/diff-test/graph'); + await expect(page.getByRole('button', {name: 'Mono'})).toBeInViewport({ratio: 1}); + await expect(page.getByRole('button', {name: 'Color'})).toBeInViewport({ratio: 1}); + await expect(page.locator('.selection.search.dropdown')).toBeInViewport({ratio: 1}); +}); From dbe2846e3b869c6b4f3f865f827cfdf56b98b16e Mon Sep 17 00:00:00 2001 From: 0ko <0ko@noreply.codeberg.org> Date: Tue, 3 Sep 2024 21:51:51 +0500 Subject: [PATCH 2/2] ui: improve commit graph layout --- templates/repo/graph.tmpl | 19 ++++++++------ web_src/css/features/gitgraph.css | 42 ++++++++++++++++++++++++------- 2 files changed, 44 insertions(+), 17 deletions(-) diff --git a/templates/repo/graph.tmpl b/templates/repo/graph.tmpl index 6e7b6cb2b5..04b056cc60 100644 --- a/templates/repo/graph.tmpl +++ b/templates/repo/graph.tmpl @@ -3,9 +3,9 @@ {{template "repo/header" .}}
-

- {{ctx.Locale.Tr "repo.commit_graph"}} -
+
+
+

{{ctx.Locale.Tr "repo.commit_graph"}}

+
+
-

-
-
- {{template "repo/graph/svgcontainer" .}} - {{template "repo/graph/commits" .}} +
+
+
+ {{template "repo/graph/svgcontainer" .}} + {{template "repo/graph/commits" .}} +
diff --git a/web_src/css/features/gitgraph.css b/web_src/css/features/gitgraph.css index 45fb2d9555..4da871da61 100644 --- a/web_src/css/features/gitgraph.css +++ b/web_src/css/features/gitgraph.css @@ -1,24 +1,48 @@ -#git-graph-container { +#git-graph-content { overflow-x: auto; width: 100%; - min-height: 350px; + min-height: 250px; } -#git-graph-container h2 { +#git-graph-heading { display: flex; justify-content: space-between; - align-items: center; + padding-bottom: 20px; } -#git-graph-container .ui.header.dividing { - padding-bottom: 10px; +#git-graph-heading-left { + display: flex; + gap: 1rem; +} + +#git-graph-heading h2 { + margin: 0; +} + +@media (min-width: 767.98px) { + #git-graph-heading { + align-items: center; + } +} + +@media (max-width: 767.98px) { + #git-graph-heading, + #git-graph-heading-left { + flex-direction: column; + } + + #git-graph-heading-left { + margin-bottom: 1rem; + } + + h2, + #flow-select-refs-dropdown { + max-width: 100%; + } } #git-graph-container #flow-select-refs-dropdown { - border-top-right-radius: 0; - border-bottom-right-radius: 0; min-width: 250px; - border-right: none; } #git-graph-container #flow-select-refs-dropdown .ui.label {