Skip to content

Navbar submenu items grid - #1474

Open
fauzannaufan-gws wants to merge 22 commits into
masterfrom
navbar-submenu-items-grid
Open

fauzannaufan-gws wants to merge 22 commits into
masterfrom
navbar-submenu-items-grid

Conversation

@fauzannaufan-gws

Copy link
Copy Markdown
Contributor

Type of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing apis or functionality to change)
  • Documentation (change to documentation, comments or API descriptions)
  • Tests (improvements to unit tests or E2E tests)
  • Other (technical improvements, refactoring, or changes that don't fall into the above categories)

Description of changes

  • Link to ticket
  • Link to Figma
  • Adding a Grid display option to Navbar Submenu, by providing 2 new optional params: subMenuRows & subMenuColumns

Checklist

  • Changes follow the project guidelines in CONTRIBUTING.md and CONVENTIONS.md
  • Looks good on mobile and tablet (Out of scope: change is for desktop only)
  • Updated documentation
  • Added/updated unit tests
  • Added/updated E2E tests

Screenshots

Screenshot is available in E2E folder

qroll

This comment was marked as resolved.

@qroll qroll added the type: enhancement New feature or request label Sep 18, 2026
ghazwan-gt

This comment was marked as off-topic.

@fauzannaufan-gws
fauzannaufan-gws force-pushed the navbar-submenu-items-grid branch from feef61f to 70f496e Compare September 18, 2026 09:24
@ghazwan-gt

Copy link
Copy Markdown
Contributor

Tried adding a label to a Menu.Section with grid layout, it doesn't wrap nicely
image

Comment thread src/menu/types.ts Outdated
Comment thread src/menu/types.ts Outdated
Comment thread src/menu/types.ts Outdated
Comment thread src/menu/menu-section.tsx Outdated
Comment thread e2e/nextjs-app/src/app/components/navbar/submenu-grid.e2e.tsx
Comment thread stories/navbar/navbar.stories.tsx
Comment thread stories/navbar/navbar.stories.tsx
Comment thread src/menu/types.ts Outdated
Comment thread src/menu/menu-section.styles.ts Outdated
Comment thread src/menu/menu-section.styles.ts Outdated
Comment thread src/menu/menu-section.tsx Outdated
Comment thread src/navbar/navbar-items.tsx Outdated
Comment thread tests/menu/menu.spec.tsx Outdated
Comment thread tests/navbar/navbar.spec.tsx
@qroll

qroll commented Sep 21, 2026

Copy link
Copy Markdown
Contributor

What is the expected grid placement behaviour and navigation order?

Currently, items will be arranged by row

The linked Figma shows items being arranged in alphabetical order by column, though

Screen.Recording.2026-09-21.at.2.24.39.PM.mov

@fauzannaufan-gws

fauzannaufan-gws commented Sep 22, 2026

Copy link
Copy Markdown
Contributor Author

You're right, the items should be arranged by column first according to Figma. Thanks for noticing this!

Edit: changed the grid placement behavior
https://github.com/user-attachments/assets/025938fc-acb1-4dba-b14a-5ab6f98fa92f

Comment thread src/menu/menu-section.styles.ts
Comment thread e2e/tests/components/navbar/navbar.e2e.spec.ts Outdated
Comment thread e2e/tests/components/menu/menu.e2e.spec.ts Outdated
Comment thread e2e/tests/components/menu/menu.e2e.spec.ts Outdated
Comment thread e2e/tests/components/menu/menu.e2e.spec.ts Outdated
Comment thread e2e/tests/components/menu/menu.e2e.spec.ts Outdated
Comment thread e2e/tests/components/navbar/navbar.e2e.spec.ts Outdated
Comment thread src/menu/types.ts Outdated
Comment thread src/menu/menu-section.tsx Outdated
Comment thread src/navbar/navbar-items.tsx Outdated
@fauzannaufan-gws
fauzannaufan-gws force-pushed the navbar-submenu-items-grid branch from 34897f7 to f4282fb Compare September 24, 2026 04:21
Comment thread src/menu/menu-section.tsx
className
)}
>
{labelElement}

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.

hmm I think we can just merge this? so always render this parent section div with a ul even without columns and label; labelElement will be conditionally rendered

Comment thread tests/menu/menu.spec.tsx
).toBe("3");
});

it("should render label outside the <ul> when both columns and label are provided", () => {

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.

this is a visual outcome, so it's better to cover in the e2e tests. you can set a long label string for grid-layout-with-label.e2e.tsx, which lets us capture the wrapping behaviour in the default mount screenshot

Comment thread tests/menu/menu.spec.tsx
expect(a).toHaveFocus();
});

it("should set panel maxWidth CSS var based on max columns across child sections", () => {

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.

isn't this already covered by should set panel maxWidth CSS var for 3 columns?

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

Labels

type: enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants