Skip to content

[BOOKINGSG-9244][RYN] migrate navbar component#1171

Open
ryan-nguyen-t wants to merge 22 commits into
pre-release/v4from
BOOKINGSG-9244/navbar
Open

[BOOKINGSG-9244][RYN] migrate navbar component#1171
ryan-nguyen-t wants to merge 22 commits into
pre-release/v4from
BOOKINGSG-9244/navbar

Conversation

@ryan-nguyen-t
Copy link
Copy Markdown

@ryan-nguyen-t ryan-nguyen-t commented May 12, 2026

Checklist

  • Migrated the component styles
    • className is chained correctly with clsx
    • User style prop is set as CSS variable
  • Changes follow the project guidelines in CONVENTIONS_V4.md
  • Updated Storybook documentation
  • Added/updated unit tests
  • Added visual tests

@ryan-nguyen-t ryan-nguyen-t marked this pull request as draft May 12, 2026 09:57
@ryan-nguyen-t ryan-nguyen-t marked this pull request as ready for review May 13, 2026 05:00
@ryan-nguyen-t ryan-nguyen-t force-pushed the BOOKINGSG-9244/navbar branch from 4ca7093 to 989818a Compare May 13, 2026 05:02
@ryan-nguyen-t ryan-nguyen-t requested a review from qroll May 13, 2026 05:06
@ryan-nguyen-t ryan-nguyen-t self-assigned this May 13, 2026
Comment thread src/navbar/drawer.styles.ts
@ghazwan-gt
Copy link
Copy Markdown

image

The secondary brand is overflowing

@ryan-nguyen-t
Copy link
Copy Markdown
Author

ryan-nguyen-t commented May 13, 2026

@ghazwan-gt What screen size are you referring to for the overflowing brand
image

#1171 (comment)

@ryan-nguyen-t ryan-nguyen-t force-pushed the BOOKINGSG-9244/navbar branch from ad2f991 to 9910eb5 Compare May 13, 2026 07:54
Comment thread e2e/nextjs-app/src/proxy.ts Outdated
Comment thread src/navbar/drawer.styles.ts
Comment thread e2e/nextjs-app/src/app/components/navbar/common.ts Outdated
Comment thread e2e/nextjs-app/src/app/components/navbar/common.ts Outdated
Comment thread e2e/tests/components/navbar/navbar.e2e.spec.ts
@ryan-nguyen-t ryan-nguyen-t force-pushed the BOOKINGSG-9244/navbar branch from 9e01ab6 to fec29a6 Compare May 14, 2026 02:57
Comment thread src/navbar/brand.tsx Outdated
Comment thread src/navbar/brand.tsx Outdated
Comment thread src/navbar/drawer.styles.ts
Comment thread src/navbar/navbar-items.styles.ts
Comment thread src/navbar/navbar-items.styles.tsx
Comment thread src/navbar/navbar-items.styles.ts
Comment thread src/navbar/navbar.styles.ts Outdated
Comment on lines 74 to 76
${MediaQuery.MaxWidth.lg} {
margin-left: 0rem;
}
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.

treat as 0 by default, this media query can be removed from this class

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.

was this updated?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

paiseh, updated now!

Comment thread src/navbar/navbar.styles.ts Outdated
Comment thread src/navbar/navbar.styles.ts Outdated
Comment thread src/navbar/navbar.styles.ts Outdated
Comment on lines +47 to +61
export const navCompressed = css`
height: ${ComponentToken.Navbar["compressed-height"]};
`;

export const navFull = css`
height: ${ComponentToken.Navbar["full-height"]};
`;

export const navDarkCompressed = css`
height: calc(${ComponentToken.Navbar["compressed-height"]} - 1px);
`;

export const navDarkFull = css`
height: calc(${ComponentToken.Navbar["full-height"]} - 1px);
`;
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.

as discussed in CR, we can apply the height as a variable to reduce the number of combinations

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.

there's no need to use useApplyStyle for this, you should be able to apply the variable via css as well

export const navCompressed = css`
    ${token.nav.height}: ${ComponentToken.Navbar["compressed-height"]};
`;

export const navDark = css`
   // ...
`

Comment thread src/navbar/navbar.tsx Outdated
@qroll qroll added the type: chore For technical improvements or refactoring. label May 14, 2026
@qroll qroll added this to the v4.0.0-alpha.3 milestone May 14, 2026
@ryan-nguyen-t ryan-nguyen-t force-pushed the BOOKINGSG-9244/navbar branch from fc8bfb5 to 4847434 Compare May 14, 2026 08:14
@ryan-nguyen-t ryan-nguyen-t requested a review from qroll May 15, 2026 08:29
Comment thread src/navbar/navbar.tsx Outdated
Comment on lines +349 to +351
!hideNavBranding
? styles.navElementsContainerWithBranding
: null
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.

!hideNavBranding && styles.navElementsContainerWithBranding

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.

hmmm why is the masthead missing in some cases?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

I think it was the issue with running parallel tests. Rerunning the test can gen the masthead. Sometimes the snapshots are not consistent...

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

updated: rerunning can only capture masthead for some but not all missing test cases, so I added a function to wait for the masthead to render first

@ryan-nguyen-t ryan-nguyen-t requested a review from qroll May 15, 2026 09:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

type: chore For technical improvements or refactoring.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants