Skip to content

fix(MainNavigationBar): allow right slot to expand#1546

Open
AlexandraGallipoliRodrigues wants to merge 10 commits intomasterfrom
alex/OBVIVO-3456-fix-MainNavigationBar-allow-right-slot-to-expand
Open

fix(MainNavigationBar): allow right slot to expand#1546
AlexandraGallipoliRodrigues wants to merge 10 commits intomasterfrom
alex/OBVIVO-3456-fix-MainNavigationBar-allow-right-slot-to-expand

Conversation

@AlexandraGallipoliRodrigues
Copy link
Copy Markdown
Contributor

@AlexandraGallipoliRodrigues AlexandraGallipoliRodrigues commented May 6, 2026

ticket: https://jira.tid.es/browse/WEB-2439
figma: https://www.figma.com/design/HA6UnnWC187IL1YujMYlYZ/Main-Navigation-Bar?node-id=2412-5583

  • MainNavigationBar: allows the right slot to span the full width. The change is guarded so the extra wrapper is only applied when the right slot is expanded and the provided right element explicitly has fullWidth. Existing right slots like NavigationBarActionGroup are not wrapped.

  • InlineItem grow: allows you to specify which Inline child should occupy the remaining space.

bug:
image

fix, local playroom:
image

@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 6, 2026

Size stats

master this branch diff
Total JS 16.1 MB 16.1 MB +1.28 kB
JS without icons 2.01 MB 2.01 MB +1.24 kB
Lib overhead 92.5 kB 92.5 kB 0 B
Lib overhead (gzip) 19.9 kB 19.9 kB 0 B

@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 6, 2026

Deploy preview for mistica-web ready!

Project:mistica-web
Status: ✅  Deploy successful!
Preview URL:https://mistica-miip2qe6p-flows-projects-65bb050e.vercel.app
Latest Commit:f7a9b3f

Deployed with vercel-action

@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 6, 2026

Accessibility report
✔️ No issues found

ℹ️ You can run this locally by executing yarn audit-accessibility.

@AlexandraGallipoliRodrigues AlexandraGallipoliRodrigues marked this pull request as ready for review May 6, 2026 10:10
Copilot AI review requested due to automatic review settings May 6, 2026 10:10
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR fixes layout limitations in MainNavigationBar/NavigationBar right content so the right slot can properly expand when the provided right element is intended to be full-width, and introduces a new InlineItem API to allow individual inline children to opt into flex-grow behavior.

Changes:

  • Wrap right content in NavigationBarContentContainer when expandRightContent is enabled and the right element has fullWidth, plus add supporting CSS to allow correct shrinking/expansion.
  • Add InlineItem with grow support so specific Inline children can expand, and switch Inline rendering to inspect children for grow items.
  • Re-export InlineItem from the library entrypoint.

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
src/navigation-bar.tsx Conditionally wraps right slot content to allow full-width expansion when requested.
src/navigation-bar.css.ts Tweaks expanded right-slot sizing and adds a wrapper style for full-width content.
src/inline.tsx Adds InlineItem API and updates child rendering to support grow items.
src/inline.css.ts Adds flex container and grow-item styles needed for the new InlineItem behavior.
src/index.tsx Exposes InlineItem from the public package API.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/inline.tsx Outdated
Comment on lines +133 to +136

return (
<div
key={index}
Copilot AI review requested due to automatic review settings May 6, 2026 11:29
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 7 out of 8 changed files in this pull request and generated no new comments.

Comment thread src/inline.tsx
Copy link
Copy Markdown
Contributor

@yceballost yceballost May 6, 2026

Choose a reason for hiding this comment

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

I dont feel really easy in terms of devExp to have another component called InlineItem to manage this kind of things

Is not there any other solution? maybe manage this property in the <Inline> component?

wdyt @atabel ?

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.

Good point, thanks! I’ve removed the public InlineItem component and moved the behavior into Inline via a growItems prop

Copilot AI review requested due to automatic review settings May 7, 2026 14:06
@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 7, 2026

Size stats

master this branch diff
Total JS 16.1 MB 16.1 MB +734 B
JS without icons 2.02 MB 2.02 MB +734 B
Lib overhead 92.5 kB 92.5 kB 0 B
Lib overhead (gzip) 19.9 kB 19.9 kB 0 B

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 6 out of 7 changed files in this pull request and generated 1 comment.

Comment thread src/inline.tsx Outdated
Comment on lines 127 to 128
hasGrowItem && styles.flexLayout,
isStringSpace ? (wrap ? styles.stringSpaceWithWrap : styles.stringSpace) : styles.marginInline
Copilot AI review requested due to automatic review settings May 8, 2026 07:49
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 6 out of 7 changed files in this pull request and generated 2 comments.

Comment thread src/inline.tsx
Comment on lines 70 to +83
type Props = {
space: FlexSpace | ByBreakpoint<NumericSpace>;
verticalSpace?: ByBreakpoint<NumericSpace>;
alignItems?: 'flex-start' | 'flex-end' | 'center' | 'stretch' | 'baseline';
children: React.ReactNode;
className?: string;
role?: string;
'aria-label'?: string;
'aria-labelledby'?: string;
fullWidth?: boolean;
dataAttributes?: DataAttributes;
wrap?: boolean;
growItems?: number | ReadonlyArray<number>;
};
Comment thread src/inline.tsx
<div
key={getChildKey(child, index)}
role={role === 'list' ? 'listitem' : undefined}
className={classnames(shouldGrowItem(growItems, index) && styles.growItem)}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants