Skip to content

Commit

Permalink
Merge pull request #192 from opf/bug/58106-user-tab-headers-overlap-w…
Browse files Browse the repository at this point in the history
…hen-header-text-is-long

[58106] User tab headers overlap when header text is long
  • Loading branch information
HDinger authored Oct 8, 2024
2 parents 4537b50 + b57b85c commit 20a43bc
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changeset/gentle-grapes-help.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@openproject/primer-view-components': patch
---

Avoid overlapping tabs in PageHeader tabNav
6 changes: 5 additions & 1 deletion app/components/primer/open_project/page_header.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -30,5 +30,9 @@
</div>

<%= description %>
<%= tab_nav %>
<% if tab_nav %>
<div class="PageHeader-tabNavBar">
<%= tab_nav %>
</div>
<% end %>
<% end %>
8 changes: 8 additions & 0 deletions app/components/primer/open_project/page_header.pcss
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,14 @@
flex: 1 100%;
}

.PageHeader-tabNavBar {
overflow: auto;
}

.PageHeader-tabNavBar .PageHeader-tabNav {
min-width: max-content;
}

.PageHeader--withTabNav .PageHeader-description {
margin-bottom: var(--base-size-16);
}
Expand Down
3 changes: 3 additions & 0 deletions static/classes.json
Original file line number Diff line number Diff line change
Expand Up @@ -483,6 +483,9 @@
"PageHeader-parentLink": [
"Primer::OpenProject::PageHeader"
],
"PageHeader-tabNavBar": [
"Primer::OpenProject::PageHeader"
],
"PageHeader-title": [
"Primer::OpenProject::PageHeader"
],
Expand Down
1 change: 1 addition & 0 deletions test/components/primer/open_project/page_header_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -229,6 +229,7 @@ def test_renders_tab_nav
end

assert_selector(".PageHeader.PageHeader--withTabNav")
assert_selector(".PageHeader-tabNavBar")
assert_selector(".PageHeader-tabNav")
assert_selector(".PageHeader-tabNav .tabnav-tab")
end
Expand Down

0 comments on commit 20a43bc

Please sign in to comment.