Skip to content

Improve AppBreadcrumbs and Header components - #570

Merged
jeradrutnam merged 4 commits into
wso2:mainfrom
jeradrutnam:main
Aug 6, 2026
Merged

Improve AppBreadcrumbs and Header components#570
jeradrutnam merged 4 commits into
wso2:mainfrom
jeradrutnam:main

Conversation

@jeradrutnam

@jeradrutnam jeradrutnam commented Aug 6, 2026

Copy link
Copy Markdown
Member

This pull request improves the AppBreadcrumbs and Header components, adds a new breadcrumb usage example, and updates Storybook and related dependencies to the latest patch version. The changes also include minor adjustments to package references and lock files to ensure consistency.

Component improvements:

  • Enhanced AppBreadcrumbs to support non-clickable breadcrumb items, which are now styled differently (disabled color, italic, no hover effect) and only render as buttons if an onClick handler is present. Truncation logic for breadcrumbs was also improved for better UX. [1] [2] [3]
  • Updated the HeaderToggle component to use the ChevronLeft icon instead of PanelLeftClose for the collapse action. [1] [2]
image image

Documentation and examples:

  • Added a new Storybook example (MiddleItemNoLink) demonstrating a breadcrumb with a non-clickable middle item, clarifying the new visual behavior.

Dependency and package updates:

  • Upgraded Storybook and related packages from version 10.4.6 to 10.5.6 across package.json and pnpm-lock.yaml for improved stability and compatibility. [1] [2] [3] [4] [5] [6] [7]
  • Adjusted lucide-static and other dependencies to use the correct catalog references for consistency. [1] [2] [3]

Release notes:

  • Added a changeset describing these improvements and triggering patch releases for affected packages.

@coderabbitai

coderabbitai Bot commented Aug 6, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Summary

  • Updated AppBreadcrumbs to support non-clickable items with disabled styling.
  • Rendered breadcrumb items as buttons only when they have an onClick handler.
  • Updated breadcrumb truncation to retain the first and last items.
  • Changed the expanded HeaderToggle icon to ChevronLeft.
  • Added a Storybook example for a non-clickable middle breadcrumb.
  • Upgraded Storybook dependencies to 10.5.6.
  • Added a changeset for patch releases.

Walkthrough

The pull request updates AppBreadcrumbs to support non-clickable intermediate items and revised truncation. It adds a Storybook example for this behavior. HeaderToggle now uses ChevronLeft as its default expanded-state icon. The changeset records patch releases, and the documentation package updates Storybook and lucide-static dependencies.

Suggested reviewers: ajirthan

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Description check ⚠️ Warning The description explains the changes but omits the required Related Issues, Related PRs, Checklist, and Security checks sections. Add the missing template sections and complete each applicable checklist item, including testing, documentation, Storybook, and security confirmations.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly summarizes the primary changes to the AppBreadcrumbs and Header components.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 3

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@packages/oxygen-ui-docs/stories/AppElements/AppBreadcrumbs.stories.tsx`:
- Around line 121-137: Update the JSDoc description for the MiddleItemNoLink
story to accurately state that non-clickable breadcrumb items use disabled text
color, italic styling, and reduced opacity, replacing the incorrect
primary-color and no-hover-effects description.

In `@packages/oxygen-ui/src/components/AppBreadcrumbs/AppBreadcrumbs.tsx`:
- Around line 134-137: Enforce a minimum maxItems value before deriving
visibleItems and hiddenItems in the breadcrumb truncation logic. Normalize
values below 2 to 2, or validate and reject them, so the slice ranges always
preserve the first item and final item while producing valid hiddenItems.
- Around line 139-160: Update renderItem so hidden items without item.onClick
are disabled or otherwise non-interactive, and only attach menu click handling
when item.onClick exists. Preserve the existing clickable behavior for non-last
items with handlers, using the hidden-item rendering path and AppBreadcrumbsItem
props as the implementation points.
🪄 Autofix

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: a837c225-40b5-459c-a86f-001664ba03ad

📥 Commits

Reviewing files that changed from the base of the PR and between 7c2bf64 and 47e1c43.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (6)
  • .changeset/beige-ducks-glow.md
  • packages/oxygen-ui-docs/package.json
  • packages/oxygen-ui-docs/stories/AppElements/AppBreadcrumbs.stories.tsx
  • packages/oxygen-ui/src/components/AppBreadcrumbs/AppBreadcrumbs.tsx
  • packages/oxygen-ui/src/components/Header/HeaderToggle.tsx
  • pnpm-workspace.yaml

Comment on lines +121 to +137
/**
* Demonstrates a breadcrumb with a middle item that has no `onClick` handler.
* Non-clickable items are rendered in primary text color without hover effects.
*/
export const MiddleItemNoLink: Story = {
render: () => (
<AppBreadcrumbs
items={[
{key: 'home', label: 'Home', onClick: () => {}},
{key: 'organization', label: 'Organization'},
{key: 'project', label: 'Project', onClick: () => {}},
{key: 'settings', label: 'Settings'},
]}
/>
),
};

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win

Correct the story description.

Line 123 says non-clickable items use primary text color. AppBreadcrumbsItem uses disabled text color, italic styling, and reduced opacity. Update the description to match the rendered behavior.

As per path instructions, provide concise, actionable feedback focused on correctness and best practices.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@packages/oxygen-ui-docs/stories/AppElements/AppBreadcrumbs.stories.tsx`
around lines 121 - 137, Update the JSDoc description for the MiddleItemNoLink
story to accurately state that non-clickable breadcrumb items use disabled text
color, italic styling, and reduced opacity, replacing the incorrect
primary-color and no-hover-effects description.

Source: Path instructions

Comment on lines +134 to +137
const visibleItems: BreadcrumbItem[] = shouldTruncate
? [...items.slice(0, maxItems - 1), items[items.length - 1]]
: items;
const hiddenItems: BreadcrumbItem[] = shouldTruncate ? items.slice(maxItems - 1, items.length - 1) : [];

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

Enforce a minimum maxItems value.

If maxItems is 0 or 1, these slice ranges produce invalid truncation output. Require maxItems >= 2, or normalize lower values before deriving visibleItems and hiddenItems.

As per path instructions, provide concise, actionable feedback focused on correctness and best practices.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@packages/oxygen-ui/src/components/AppBreadcrumbs/AppBreadcrumbs.tsx` around
lines 134 - 137, Enforce a minimum maxItems value before deriving visibleItems
and hiddenItems in the breadcrumb truncation logic. Normalize values below 2 to
2, or validate and reject them, so the slice ranges always preserve the first
item and final item while producing valid hiddenItems.

Source: Path instructions

Comment on lines +139 to +160
const renderItem = (item: BreadcrumbItem, isLast: boolean) => {
const isClickable = !isLast && !!item.onClick;
return (
<AppBreadcrumbsItem
key={item.key}
variant="h5"
ownerState={{isLast, isClickable}}
{...(isClickable && {
role: 'button',
tabIndex: 0,
onClick: item.onClick,
onKeyDown: (e: React.KeyboardEvent) => {
if (e.key === 'Enter' || e.key === ' ') {
e.preventDefault();
item.onClick?.();
}
}
>
{item.label}
</AppBreadcrumbsItem>
);
},
})}
>
{item.label}
</AppBreadcrumbsItem>
);

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

Apply non-clickable behavior to hidden items.

Line 140 limits the new behavior to visible items. A hidden item without onClick still renders as an enabled MenuItem and can receive activation. Render these entries as disabled or non-interactive, and attach menu click handling only when item.onClick exists.

As per path instructions, provide concise, actionable feedback focused on correctness and best practices.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@packages/oxygen-ui/src/components/AppBreadcrumbs/AppBreadcrumbs.tsx` around
lines 139 - 160, Update renderItem so hidden items without item.onClick are
disabled or otherwise non-interactive, and only attach menu click handling when
item.onClick exists. Preserve the existing clickable behavior for non-last items
with handlers, using the hidden-item rendering path and AppBreadcrumbsItem props
as the implementation points.

Source: Path instructions

@jeradrutnam
jeradrutnam merged commit d4fe9c7 into wso2:main Aug 6, 2026
7 checks passed
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.

2 participants