Skip to content

feat: add docked nav - #8020

Merged
mcoker merged 17 commits into
patternfly:mainfrom
mcoker:issue-7183
Dec 12, 2025
Merged

mcoker merged 17 commits into
patternfly:mainfrom
mcoker:issue-7183

Conversation

@mcoker

@mcoker mcoker commented Dec 4, 2025 •

Copy link
Copy Markdown
Contributor

fixes #7183

Links:

Adds these things:

  • .pf-m-docked to the compass component for the docked + big content layout
  • .pf-v6-c-compass__dock, .pf-v6-c-compass__dock-logo, .pf-v6-c-compass__dock-main, and .pf-v6-c-compass__dock-tools for the dock contents.
  • .pf-m-docked to the masthead component that basically just turns it into a vertical layout, and changes it to a flex layout so we can easily add dividers between the sections. For use with regular pf layouts.
  • .pf-m-docked to the nav component that hides the nav link text and turns it into a vertical layout
    • Text is shown below a nav item if text is passed to it. Otherwise it's just an icon.
  • The accent styling to current nav items.
  • .pf-m-docked-nav to the page component that modifies the grid for the docked layout
  • .pf-m-vertical to the toolbar component for a vertical layout

TODO:

  • add the nav slide out panel

@patternfly-build

patternfly-build commented Dec 4, 2025 •

Copy link
Copy Markdown
Collaborator

@kmcfaul

kmcfaul commented Dec 5, 2025

Copy link
Copy Markdown
Contributor

Do we want to call the new pf-m-docked modifiers for masthead & nav something more generic like pf-m-vertical?

@srambach

srambach commented Dec 8, 2025

Copy link
Copy Markdown
Member

I'm assuming this isn't hardened yet - there are some potential problems at narrow widths
image
image

@srambach

srambach commented Dec 8, 2025

Copy link
Copy Markdown
Member

I don't love having two things that are "header."
image
I still think layout slots are getting muddled with content items that can go in them. E.g. maybe what's shown here is something like a dock with a modifier of .pf-m-inline-start and in there can be a masthead(<header>), nav, toolbar, whatever inside it.
Or, the existing compass layout areas - sidebars, header, and footer - have a docked variant.
But I'd lean more toward separating concerns - layout just handles the box to put things in and if it slides off screen or whatever, and the things inside manage spacing themselves.

background-image: var(--#{$compass}--BackgroundImage);
background-size: cover;

&.pf-m-max-canvas {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is "max" a new concept in our modifiers? Can we reuse something like "fill" or "full" (though those usually refer to itself, not its children)? Also, "canvas" isn't used anywhere else - the "main" grid area is what it's maximizing?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That was just something temporary - updated to .pf-m-docked


// - Masthead
.#{$masthead} {
&.pf-m-docked {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this supposed to be a real part of masthead? If so, there should be an example and docs in the .md file.

Second thing here, I really don't like .pf-m-docked as the name changing the orientation

@mcoker mcoker Dec 10, 2025 •

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added docs and an example.

On the name, pf-m-vertical would be fine, but my thinking is this for the docked nav specifically and this lets us be opinionated for use as a dock that wouldn't necessarily apply to a vertical masthead with regular stuff int (the children being center aligned, for example). But it doesn't matter to me, let me know if you want to change it.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤷🏻‍♀️ Could also be 2 modifiers - vertical and docked. But I'm not going to fight you on this 😄

grid-template-columns: var(--#{$page}__sidebar--Width) 1fr;
}

&.pf-m-docked {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since it's not the page that is docked, it seems like this should be named something like .pf-m-has-dock (it has something docked, not is docked) or pf-m-side-masthead/.pf-m-vertical-masthead/.pf-whatever-layout (because it's a different page layout option).

I think I'd rather see something about the layout rather than has-dock because I don't think dock necessarily implies a left side vertical dock.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated to .pf-m-dock to indicate it has a dock, not that the page is docked.

@mcoker
mcoker requested a review from srambach December 10, 2025 01:24
{{/nav}}
```

### Docked nav

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FWIW, this doesn't show the selection decorator in the full page view since it's a negative margin.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yah... I wasn't sure about that. We could add a margin the example CSS. Probably good idea since our visual regression tests only test the full-page examples. WDYT?

``` No newline at end of file
```

### Docked

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

On narrow screens, the "make your screen wider" box isn't centered anymore if you care.
Also, if the screen is too short to fit all the nav items, there's no scroll.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, I'll fix the responsive box if it isn't too complicated. And on the scroll, this is just being used for POC/vibe stuff so we can handle that part later.


// - Masthead
.#{$masthead} {
&.pf-m-docked {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤷🏻‍♀️ Could also be 2 modifiers - vertical and docked. But I'm not going to fight you on this 😄

@mcoker

mcoker commented Dec 10, 2025

Copy link
Copy Markdown
Contributor Author

Could also be 2 modifiers - vertical and docked. But I'm not going to fight you on this

🥊🤖

We could, but IMO it isn't necessary. If we end up switching orientation to horizontal but want to keep all the other alignment and stuff that comes with docked, that could be called horizontal or top/bottom or whatever, and the default is vertical. Like most of our components - if we have a variant that just changes orientation (or some other style), the variant for the change is what gets the class (action-list & action-list.pf-m-vertical, nav & nav.pf-m-horizontal, tabs & tabs.pf-m-vertical, etc).

@mcoker
mcoker requested a review from srambach December 10, 2025 22:49
@srambach

srambach commented Dec 11, 2025 •

Copy link
Copy Markdown
Member

@srambach

Copy link
Copy Markdown
Member

If there are too many items in the dock to fit, nothing scrolls to get to them. You can tab to them but not get there with the mouse.
https://github.com/user-attachments/assets/ffc07207-edd2-4ab3-a961-82607209783f

```hbs isBeta
{{#> compass compass--HasDock=true}}
{{#> compass-dock}}
{{#> compass-dock-content}}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this div exist? I don't see it in the surge or css.

@andrew-ronaldson andrew-ronaldson left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Go for it!

@srambach

Copy link
Copy Markdown
Member

Just one more check - on https://pf-pr-8020.surge.sh/components/page/html/with-dock/ is this correct or not to be worried about - logo shifts over, and the main section touches the right/bottom side of the viewport but not top/left.

Otherwise 👍🏻

2025-12-12_11-05-44.mp4

@mcoker

mcoker commented Dec 12, 2025

Copy link
Copy Markdown
Contributor Author

@srambach created a follow-up issue for that #8026. Right now the POCs built from this will be on wide screens with custom content so it's OK for the time being.

@srambach srambach left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

L 🛳️ TM

@mcoker
mcoker merged commit 7662220 into patternfly:main Dec 12, 2025
4 checks passed
@mcoker
mcoker deleted the issue-7183 branch December 12, 2025 16:38
@patternfly-build

Copy link
Copy Markdown
Collaborator

🎉 This PR is included in version 6.5.0-prerelease.32 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Navigation: Core support to enable docked nav variant

5 participants