Skip to content

feat(components): add TopBar component (DS-5242) - #444

Merged
KamilEmeleev merged 4 commits into
mainfrom
feat/ds-5242
Aug 5, 2026
Merged

feat(components): add TopBar component (DS-5242)#444
KamilEmeleev merged 4 commits into
mainfrom
feat/ds-5242

Conversation

@KamilEmeleev

@KamilEmeleev KamilEmeleev commented Aug 3, 2026

Copy link
Copy Markdown
Collaborator

Summary by CodeRabbit

  • New Features

    • Added a configurable TopBar component with static or sticky positioning.
    • Supports titles, breadcrumbs, logos, counters, flexible content placement, and collapsing actions.
    • Added configurable shadows, responsive layouts, accessibility support, and customizable styling.
    • Added TopBar container and title components with flexible rendering options.
  • Documentation

    • Added comprehensive usage guidance and interactive examples for TopBar variants.
  • Tests

    • Added coverage for rendering, accessibility, positioning, styling, keyboard navigation, and responsive behavior.

@KamilEmeleev KamilEmeleev added the enhancement New feature or request label Aug 3, 2026
@coderabbitai

coderabbitai Bot commented Aug 3, 2026

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

@KamilEmeleev, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 12 minutes

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 5e0c9041-0478-4994-bd7a-f75a82723293

📥 Commits

Reviewing files that changed from the base of the PR and between de900cc and 315016e.

📒 Files selected for processing (5)
  • packages/components/src/components/TopBar/TopBar.mdx
  • packages/components/src/components/TopBar/TopBar.test.tsx
  • packages/components/src/components/TopBar/TopBar.tsx
  • packages/components/src/components/TopBar/components/TopBarContainer/TopBarContainer.tsx
  • tools/public_api_guard/components/TopBar.api.md
📝 Walkthrough

Walkthrough

Added the polymorphic TopBar component with container and title subcomponents, configurable positioning and shadows, public API exports, tests, Storybook stories, documentation, and roadmap metadata.

Changes

TopBar component

Layer / File(s) Summary
TopBar contracts and public API
packages/components/src/components/TopBar/..., packages/components/src/components/index.ts, tools/api-extractor/config.json, tools/public_api_guard/components/TopBar.api.md
Defined public props, position and placement constants, component exports, API Extractor configuration, and the generated API report.
TopBar rendering and styling
packages/components/src/components/TopBar/..., packages/components/src/global.css, packages/components/src/components/TopBar/TopBar.test.tsx
Implemented polymorphic rendering, forwarded refs and props, toolbar semantics, layout styles, sticky positioning, shadows, title truncation, and component tests.
TopBar examples and documentation
packages/components/src/components/TopBar/TopBar.stories.tsx, packages/components/src/components/TopBar/TopBar.mdx, .storybook/components/Roadmap/data.ts
Added Storybook examples for positioning, shadows, breadcrumbs, and collapsing actions. Added usage, accessibility, styling, and roadmap documentation.

Estimated code review effort: 3 (Moderate) | ~25 minutes

Possibly related PRs

  • koobiq/react-components#436: Adds another component with parallel Storybook, styling, tests, exports, API extraction, and roadmap updates.
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely describes the primary change: adding the TopBar component.
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 docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/ds-5242

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.

# Conflicts:
#	.storybook/components/Roadmap/data.ts
@github-actions

github-actions Bot commented Aug 3, 2026

Copy link
Copy Markdown

Visit the preview URL for this PR (updated for commit 315016e):

https://react-koobiq-next--prs-444-d1h7fywj.web.app

(expires Sat, 08 Aug 2026 18:07:00 GMT)

🔥 via Firebase Hosting GitHub Action 🌎

Sign: fc29847d4a9e5cb1adf458c76a9b681c76e2eeff

@KamilEmeleev

Copy link
Copy Markdown
Collaborator Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Aug 3, 2026

Copy link
Copy Markdown
✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@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

🧹 Nitpick comments (1)
packages/components/src/components/TopBar/TopBar.stories.tsx (1)

49-117: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Move AppIcon and Content into each render that uses them.

AppIcon (Line 49) and Content (Line 71) are declared at module scope. Consumers who open the Storybook Source panel for WithLogoAndCounter, WithBreadcrumbs, CollapsingActions, Position, or Shadow will not see these definitions in the copyable snippet.

Define these helpers inside each render function that uses them.

As per coding guidelines, "Define story data and helpers inside render so they appear in the Storybook Source panel."

🤖 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/components/src/components/TopBar/TopBar.stories.tsx` around lines 49
- 117, Move the module-scoped AppIcon and Content helper definitions into every
render function for WithLogoAndCounter, WithBreadcrumbs, CollapsingActions,
Position, and Shadow that uses them. Keep each helper’s implementation and usage
behavior unchanged so Storybook includes the definitions in each story’s
copyable Source output.

Source: Coding guidelines

🤖 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/components/src/components/TopBar/TopBar.mdx`:
- Around line 71-76: Update the Shadow section text associated with
Stories.Shadow so the sentence identifies hasShadow as a prop, preserving the
existing explanation that it only paints the bottom shadow.

In `@packages/components/src/components/TopBar/TopBar.tsx`:
- Around line 38-53: Update the public type declarations around TopBar so
exported TopBarProps does not expose private CompoundedComponent or
TopBarComponent symbols. Export the helper types used by the public API, or
derive TopBarProps through the exported TopBar value while preserving its
existing generic ref-aware props behavior.
- Around line 23-29: The component-controlled data attributes are currently
spread in an order that lets DataAttributeProps override computed values. In
packages/components/src/components/TopBar/TopBar.tsx lines 23-29, keep
{...other} before the controlled data-position and data-shadow attributes so
those values remain final; in
packages/components/src/components/TopBar/components/TopBarContainer/TopBarContainer.tsx
lines 43-55, merge {...other} before data-placement so the computed placement
remains final.

---

Nitpick comments:
In `@packages/components/src/components/TopBar/TopBar.stories.tsx`:
- Around line 49-117: Move the module-scoped AppIcon and Content helper
definitions into every render function for WithLogoAndCounter, WithBreadcrumbs,
CollapsingActions, Position, and Shadow that uses them. Keep each helper’s
implementation and usage behavior unchanged so Storybook includes the
definitions in each story’s copyable Source output.
🪄 Autofix (Beta)

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: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 49333369-1a4f-446f-8978-5a58a9c12cfb

📥 Commits

Reviewing files that changed from the base of the PR and between ca07268 and de900cc.

📒 Files selected for processing (21)
  • .storybook/components/Roadmap/data.ts
  • packages/components/src/components/TopBar/TopBar.mdx
  • packages/components/src/components/TopBar/TopBar.module.css
  • packages/components/src/components/TopBar/TopBar.stories.tsx
  • packages/components/src/components/TopBar/TopBar.test.tsx
  • packages/components/src/components/TopBar/TopBar.tsx
  • packages/components/src/components/TopBar/components/TopBarContainer/TopBarContainer.module.css
  • packages/components/src/components/TopBar/components/TopBarContainer/TopBarContainer.tsx
  • packages/components/src/components/TopBar/components/TopBarContainer/index.ts
  • packages/components/src/components/TopBar/components/TopBarContainer/types.ts
  • packages/components/src/components/TopBar/components/TopBarTitle/TopBarTitle.module.css
  • packages/components/src/components/TopBar/components/TopBarTitle/TopBarTitle.tsx
  • packages/components/src/components/TopBar/components/TopBarTitle/index.ts
  • packages/components/src/components/TopBar/components/TopBarTitle/types.ts
  • packages/components/src/components/TopBar/components/index.ts
  • packages/components/src/components/TopBar/index.ts
  • packages/components/src/components/TopBar/types.ts
  • packages/components/src/components/index.ts
  • packages/components/src/global.css
  • tools/api-extractor/config.json
  • tools/public_api_guard/components/TopBar.api.md

Comment thread packages/components/src/components/TopBar/TopBar.mdx
Comment thread packages/components/src/components/TopBar/TopBar.tsx
Comment thread packages/components/src/components/TopBar/TopBar.tsx Outdated

Copilot AI 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.

Pull request overview

This PR introduces a new TopBar compound component to @koobiq/react-components, including its styling, documentation (MDX + Storybook stories), tests, and the necessary public API extractor/guard updates to expose it as part of the library.

Changes:

  • Added TopBar with TopBar.Container and TopBar.Title, including polymorphic as support and state via data-* attributes.
  • Added Storybook docs/stories and Vitest + Testing Library coverage for rendering, accessibility semantics, and keyboard behavior.
  • Updated API Extractor config + API guard report, and introduced a global z-index layer token for the sticky TopBar.

Reviewed changes

Copilot reviewed 21 out of 21 changed files in this pull request and generated no comments.

Show a summary per file
File Description
tools/public_api_guard/components/TopBar.api.md Adds the API Extractor public API report for the new TopBar surface.
tools/api-extractor/config.json Registers TopBar for API Extractor so its API report is generated/validated in CI.
packages/components/src/global.css Introduces --kbq-layer-topbar to support predictable stacking for the sticky TopBar.
packages/components/src/components/TopBar/types.ts Defines TopBar public prop types and topBarPropPosition.
packages/components/src/components/TopBar/TopBar.tsx Implements the TopBar root component and compounds Container/Title.
packages/components/src/components/TopBar/TopBar.test.tsx Adds unit tests for root/subcomponents, data attributes, and toolbar keyboard navigation.
packages/components/src/components/TopBar/TopBar.stories.tsx Adds Storybook stories demonstrating variants (position, shadow, breadcrumbs, collapsing actions).
packages/components/src/components/TopBar/TopBar.module.css Adds base layout, sticky positioning, shadow styles, and CSS variable hooks for customization.
packages/components/src/components/TopBar/TopBar.mdx Adds component documentation page with usage guidance, props, CSS variables, and accessibility notes.
packages/components/src/components/TopBar/index.ts Exports TopBar, types, and related subcomponent exports from the component folder.
packages/components/src/components/TopBar/components/TopBarTitle/types.ts Defines TopBarTitle prop types.
packages/components/src/components/TopBar/components/TopBarTitle/TopBarTitle.tsx Implements TopBar.Title with typography utility classes and polymorphic as.
packages/components/src/components/TopBar/components/TopBarTitle/TopBarTitle.module.css Styles the title (ellipsis, min width, foreground color, reset margin).
packages/components/src/components/TopBar/components/TopBarTitle/index.ts Exports TopBarTitle and its types.
packages/components/src/components/TopBar/components/TopBarContainer/types.ts Defines TopBarContainer prop types and topBarContainerPropPlacement.
packages/components/src/components/TopBar/components/TopBarContainer/TopBarContainer.tsx Implements TopBar.Container, including optional useToolbar semantics when isToolbar is set.
packages/components/src/components/TopBar/components/TopBarContainer/TopBarContainer.module.css Styles start/end container placement, gaps, sizing, and clipping behavior.
packages/components/src/components/TopBar/components/TopBarContainer/index.ts Exports TopBarContainer and its types.
packages/components/src/components/TopBar/components/index.ts Barrel export for TopBar subcomponents.
packages/components/src/components/index.ts Re-exports TopBar from the package’s components index.
.storybook/components/Roadmap/data.ts Marks TopBar as done (experimental) in the Storybook roadmap data.

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

@KamilEmeleev
KamilEmeleev merged commit 001ed06 into main Aug 5, 2026
8 checks passed
@KamilEmeleev
KamilEmeleev deleted the feat/ds-5242 branch August 5, 2026 18:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants