Skip to content

Conversation

@derekrushforth
Copy link

@derekrushforth derekrushforth commented Jan 7, 2026

This PR imports the nav component into the theme. This is currently a static theme component managed on the instance. Keeping it in the theme should make it easier to maintain.

This also converts the nav into a Glimmer component and syncs the nav items so it matches the marketing site.

Desktop

Screenshot 2026-01-08 at 8 30 25 AM

Mobile

Screenshot 2026-01-08 at 8 31 16 AM

Hiding the nav on mobile is how it's currently being done in production.

@derekrushforth derekrushforth marked this pull request as ready for review January 7, 2026 23:21
$screen-lg-min: 62em; // 992px

// Large tablets and desktops
$screen-xl-min: $nav-minimum-display-width; // 1440px
Copy link
Member

Choose a reason for hiding this comment

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

This doesn't appear to be defined anywhere

Comment on lines 86 to 172
<a
href="#"
class="navigation-list__link navigation-list__link--has-child"
>
About
{{dIcon "chevron-down" class="navigation-list__chevron"}}
</a>
<ul
class="navigation-list__sub-item-list js-dropdown-list
{{if (eq this.currentSubmenuIndex 0) 'is-active'}}"
aria-hidden="true"
aria-label="Resources submenu"
>
<li class="navigation-list__sub-item">
<a href="https://discourse.org/about">
What is Discourse?
</a>
</li>
<li class="navigation-list__sub-item">
<a href="https://discourse.org/team">
Who we are
</a>
</li>
<li class="navigation-list__sub-item">
<a href="https://discourse.org/customers">
Customers
</a>
</li>
<li class="navigation-list__sub-item">
<a href="https://discourse.org/wall-of-love">
Wall of love
</a>
</li>
<li class="navigation-list__sub-item">
<a href="https://discourse.org/partners">
Partners
</a>
</li>
<li class="navigation-list__sub-item">
<a href="https://discourse.org/jobs">
Careers
</a>
</li>
</ul>
</li>
<li class="navigation-list__item">
<a
href="https://discourse.org/features"
class="navigation-list__link"
>
Features
</a>
</li>
<li class="navigation-list__item">
<a
href="https://discover.discourse.com"
class="navigation-list__link is-active"
>
Discover
</a>
</li>
<li class="navigation-list__item">
<a
href="https://discourse.org/enterprise"
class="navigation-list__link"
>
Enterprise
</a>
</li>
<li class="navigation-list__item">
<a
class="navigation-list__link"
href="https://discourse.org/pricing"
ga-on="click"
ga-event-category="main-nav"
ga-event-label="pricing"
ga-event-action="click"
>
Pricing
</a>
</li>
<li class="navigation-list__item">
<a href="#" class="navigation-list__link">
Resources
</a>
</li>
</ul>
Copy link
Member

Choose a reason for hiding this comment

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

Should we make this configurable in the UI settings for easy updating in the future if links need to be added or changed?

<ul
class="navigation-list__sub-item-list js-dropdown-list
{{if (eq this.currentSubmenuIndex 0) 'is-active'}}"
aria-hidden="true"
Copy link
Member

Choose a reason for hiding this comment

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

I believe this should be dynamic based on whether the submenu is visible or not

Comment on lines 60 to 74
@action
submenuMouseEnter() {
this.isSubmenuHovered = true;
if (this.hideSubmenuTimer) {
cancel(this.hideSubmenuTimer);
}
}

@action
submenuMouseLeave() {
this.isSubmenuHovered = false;
if (!this.isTopLevelMenuItemHovered) {
this.scheduleSubmenuHide();
}
}
Copy link
Member

Choose a reason for hiding this comment

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

Where are these used?

Comment on lines 16 to 19
@action
hideSubmenu() {
this.scheduleSubmenuHide();
}
Copy link
Member

Choose a reason for hiding this comment

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

This doesn't appear to be used anywhere


export default class HeaderNav extends Component {
@tracked currentSubmenuIndex = null;
@tracked hideSubmenuTimer = null;
Copy link
Member

Choose a reason for hiding this comment

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

We should add a willDestroy hook and return this back to null to ensure the timer is destroyed on component destroy

Copy link
Contributor

@pmusaraj pmusaraj left a comment

Choose a reason for hiding this comment

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

Given the current nav is in a non-version-controlled component, I'm OK with making this change now.

Can you post mobile screenshots as well in the PR description @derekrushforth?

Thanks!

@derekrushforth
Copy link
Author

@pmusaraj I've posted some screenshots of desktop and mobile in the description. It looks like we currently hide the nav on mobile. I plan on doing a follow up PR that should fix this as well as apply new styles for the upcoming design changes.

@keegangeorge Thanks a bunch for your help. I'll go through and clean out the unused code before we release this.

* Remove unused methods
* Reset timer when component is destroyed
* Set aria on submenu dynamically
@derekrushforth
Copy link
Author

@keegangeorge Let me know if these changes look good to you:

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

Labels

None yet

Development

Successfully merging this pull request may close these issues.

4 participants