Skip to content

Conversation

@anmolsinghbhatia
Copy link
Collaborator

@anmolsinghbhatia anmolsinghbhatia commented Sep 9, 2025

Description

This PR introduces the toolbar component in propel.

Media

Media
media

Summary by CodeRabbit

  • New Features

    • Introduced a versatile Toolbar component with compound subcomponents (Group, Item, Separator, SubmitButton).
    • Supports tooltips, keyboard shortcuts, active states, and multiple button variants with loading state; ref-forwarded and accessible.
  • Documentation

    • Added Storybook examples: default toolbar, active-state demo, and a “comment” toolbar variant.
  • Chores

    • Made the Toolbar publicly importable and included it in the build pipeline.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Sep 9, 2025

Note

Other AI code review bot(s) detected

CodeRabbit has detected other AI code review bot(s) in this pull request and will avoid duplicating their findings in the review comments. This may lead to a less comprehensive review.

Walkthrough

Adds a new Toolbar component suite (compound API with Group/Item/Separator/SubmitButton), re-exports it and its types, includes it in the build and package exports as "./toolbar", and adds Storybook stories demonstrating usages.

Changes

Cohort / File(s) Summary
Package export & build entry
packages/propel/package.json, packages/propel/tsdown.config.ts
Add ./toolbar subpath export pointing to ./dist/toolbar/index.js and include src/toolbar/index.ts in tsdown build entries.
Toolbar component implementation
packages/propel/src/toolbar/toolbar.tsx
New compound Toolbar component with Group, Item, Separator, SubmitButton; defines and exports related prop interfaces, forward refs, styling variants, tooltip integration, and loading states.
Public API re-exports
packages/propel/src/toolbar/index.ts
Re-export Toolbar and type-only exports: ToolbarProps, ToolbarGroupProps, ToolbarItemProps, ToolbarSeparatorProps, ToolbarSubmitButtonProps.
Storybook stories
packages/propel/src/toolbar/toolbar.stories.tsx
Add Storybook meta and three stories: Default, WithActiveStates, CommentToolbar, using lucide-react icons and Toolbar subcomponents.

Sequence Diagram(s)

sequenceDiagram
  autonumber
  actor User
  participant App as Consumer App
  participant Toolbar as Toolbar (compound)
  participant Tooltip as Tooltip

  User->>App: interacts with UI
  App->>Toolbar: renders <Toolbar> with Groups/Items/SubmitButton
  alt Hover or focus on Item with tooltip
    Toolbar->>Tooltip: request show (text + shortcut)
    Tooltip-->>User: display tooltip
  end
  User->>Toolbar: click Item or SubmitButton
  Toolbar-->>App: invoke onClick / onSubmit (may set loading)
  App-->>Toolbar: update props (e.g., loading=false)
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

Suggested reviewers

  • prateekshourya29
  • vamsikrishnamathala

Pre-merge checks (2 passed, 1 warning)

❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Description Check ⚠️ Warning The description section provides a brief overview and includes a media asset, but it omits several required sections from the repository’s template—specifically the “Type of Change” checkboxes, “Test Scenarios,” and “References” headings—and mislabels “Screenshots and Media” as simply “Media.” This makes the description incomplete relative to the prescribed structure. Update the description to include the “Type of Change” section with appropriate checkboxes, add a “Test Scenarios” section detailing how the toolbar was verified, include a “References” section linking any related issues or tickets, and rename the “Media” heading to “Screenshots and Media” to match the template.
✅ Passed checks (2 passed)
Check name Status Explanation
Title Check ✅ Passed The title “[WEB-4733] dev: propel toolbar component” succinctly identifies that the PR introduces the Propel toolbar component, directly reflecting the primary change in the changeset without extraneous file lists or vague terminology. It is concise and focused on the most important update, making it clear to reviewers what this pull request delivers. Although it includes a ticket prefix and a “dev:” label, these follow the repository’s convention and do not obscure the main purpose.
Docstring Coverage ✅ Passed No functions found in the changes. Docstring coverage check skipped.

Poem

I stitched a row of buttons bright,
Hops of icons, tips for sight.
Groups aligned and gaps that play,
Submit glows to save the day.
A tiny rabbit cheers—hip hooray! 🐇✨

Tip

👮 Agentic pre-merge checks are now available in preview!

Pro plan users can now enable pre-merge checks in their settings to enforce checklists before merging PRs.

  • Built-in checks – Quickly apply ready-made checks to enforce title conventions, require pull request descriptions that follow templates, validate linked issues for compliance, and more.
  • Custom agentic checks – Define your own rules using CodeRabbit’s advanced agentic capabilities to enforce organization-specific policies and workflows. For example, you can instruct CodeRabbit’s agent to verify that API documentation is updated whenever API schema files are modified in a PR. Note: Upto 5 custom checks are currently allowed during the preview period. Pricing for this feature will be announced in a few weeks.

Example:

reviews:
  pre_merge_checks:
    custom_checks:
      - name: "Undocumented Breaking Changes"
        mode: "warning"
        instructions: |
          Pass/fail criteria: All breaking changes to public APIs, CLI flags, environment variables, configuration keys, database schemas, or HTTP/GraphQL endpoints must be documented in the "Breaking Change" section of the PR description and in CHANGELOG.md. Exclude purely internal or private changes (e.g., code not exported from package entry points or explicitly marked as internal).

Please share your feedback with us on this Discord post.


📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 469b949 and 6088e67.

📒 Files selected for processing (2)
  • packages/propel/package.json (1 hunks)
  • packages/propel/tsdown.config.ts (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (2)
  • packages/propel/tsdown.config.ts
  • packages/propel/package.json
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (2)
  • GitHub Check: Build and lint web apps
  • GitHub Check: Analyze (javascript)
✨ Finishing Touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch dev-propel-toolbar

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 and usage tips.

@makeplane
Copy link

makeplane bot commented Sep 9, 2025

Pull Request Linked with Plane Work Items

Comment Automatically Generated by Plane

Copy link
Contributor

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 introduces a new toolbar component to the propel UI library. The toolbar component provides a flexible interface for grouping action buttons with support for tooltips, keyboard shortcuts, and active states.

  • Adds a comprehensive toolbar component with subcomponents for groups, items, separators, and submit buttons
  • Includes Storybook stories demonstrating various toolbar configurations including text formatting and comment scenarios
  • Updates package configuration to export the new toolbar module

Reviewed Changes

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

Show a summary per file
File Description
packages/propel/tsdown.config.ts Adds toolbar entry point to build configuration
packages/propel/src/toolbar/toolbar.tsx Main toolbar component implementation with all subcomponents
packages/propel/src/toolbar/toolbar.stories.tsx Storybook stories showcasing toolbar usage patterns
packages/propel/src/toolbar/index.ts Module exports for toolbar component and types
packages/propel/package.json Adds toolbar export to package entry points

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 2

🧹 Nitpick comments (4)
packages/propel/package.json (1)

35-35: Optional: expose types in subpath export for better TS resolution.

TypeScript does not always infer .d.ts from string exports. Consider adding a types condition (you may roll this out to other entries later).

-    "./toolbar": "./dist/toolbar/index.js",
+    "./toolbar": {
+      "types": "./dist/toolbar/index.d.ts",
+      "default": "./dist/toolbar/index.js"
+    },
packages/propel/src/toolbar/toolbar.tsx (3)

37-45: Prefer auto overflow to avoid always-visible horizontal scrollbar.

Switching to overflow-x-auto shows the scrollbar only when needed.

-    className={cn("flex h-9 w-full items-stretch gap-1.5 bg-custom-background-90 overflow-x-scroll", className)}
+    className={cn("flex h-9 w-full items-stretch gap-1.5 bg-custom-background-90 overflow-x-auto", className)}

17-24: Decouple icon type from lucide-react for flexibility.

Accept any SVG React component to avoid locking consumers to lucide-react.

-import { LucideIcon } from "lucide-react";
+import type { SVGProps, ComponentType } from "react";
...
-export interface ToolbarItemProps extends React.ButtonHTMLAttributes<HTMLButtonElement> {
-  icon: LucideIcon;
+export interface ToolbarItemProps extends React.ButtonHTMLAttributes<HTMLButtonElement> {
+  icon: ComponentType<SVGProps<SVGSVGElement>>;

123-143: SubmitButton: default to submit, expose busy state, and align right robustly.

Make it a proper submit control by default, announce loading to AT, and push it to the far right within the flex container.

-  ({ loading = false, variant = "primary", className, children, disabled, ...props }, ref) => (
-    <div className="sticky right-1">
+  ({ loading = false, variant = "primary", className, children, disabled, ...props }, ref) => (
+    <div className="sticky right-1 ml-auto">
       <button
         ref={ref}
         className={cn(
           "inline-flex items-center justify-center gap-2 rounded-md px-2.5 py-1.5 text-xs font-medium transition-colors duration-200",
           "focus:outline-none focus:ring-2 focus:ring-custom-primary-100/20 focus:ring-offset-2",
           "disabled:opacity-50 disabled:pointer-events-none",
           buttonVariants[variant],
           className
         )}
-        disabled={disabled || loading}
+        type={props.type ?? "submit"}
+        aria-busy={loading}
+        disabled={disabled || loading}
         {...props}
       >
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 291101a and 469b949.

📒 Files selected for processing (5)
  • packages/propel/package.json (1 hunks)
  • packages/propel/src/toolbar/index.ts (1 hunks)
  • packages/propel/src/toolbar/toolbar.stories.tsx (1 hunks)
  • packages/propel/src/toolbar/toolbar.tsx (1 hunks)
  • packages/propel/tsdown.config.ts (1 hunks)
🧰 Additional context used
🧬 Code graph analysis (1)
packages/propel/src/toolbar/toolbar.tsx (1)
packages/propel/src/toolbar/index.ts (6)
  • ToolbarProps (3-3)
  • ToolbarGroupProps (4-4)
  • ToolbarItemProps (5-5)
  • ToolbarSeparatorProps (6-6)
  • ToolbarSubmitButtonProps (7-7)
  • Toolbar (1-1)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (2)
  • GitHub Check: Build and lint web apps
  • GitHub Check: Analyze (javascript)
🔇 Additional comments (3)
packages/propel/tsdown.config.ts (1)

20-20: LGTM: added toolbar entry to the build.

This ensures Toolbar is emitted (JS + DTS). No action needed.

packages/propel/src/toolbar/index.ts (1)

1-8: LGTM: clean public surface re-exports.

Type-only exports keep bundles lean. No changes needed.

packages/propel/src/toolbar/toolbar.stories.tsx (1)

34-67: Stories look representative; nice coverage of states.

Good API coverage (default, active, and comment variations). After the import fix, these should serve as solid docs.

Also applies to: 69-91, 93-123

@sriramveeraghanta sriramveeraghanta merged commit 3b8bb1e into preview Sep 9, 2025
6 of 7 checks passed
@sriramveeraghanta sriramveeraghanta deleted the dev-propel-toolbar branch September 9, 2025 18:45
yarikoptic pushed a commit to yarikoptic/plane that referenced this pull request Oct 1, 2025
* dev: toolbar component added to propel

* dev: toolbar story added

* chore: propel config updated

* chore: code refactor

---------

Co-authored-by: sriram veeraghanta <veeraghanta.sriram@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants