Skip to content

Conversation

@SerhiiFesenko
Copy link
Contributor

@SerhiiFesenko SerhiiFesenko commented Sep 22, 2025

Summary

This PR addresses various warnings and deprecated patterns in the storybook demo components to improve code quality and remove console warnings.

Changes Made

  • Remove unused imports: Cleaned up import SaladUI.Menu statements from dashboard demo files
  • Modernize component APIs: Removed deprecated :let={builder} patterns from tabs and select components
  • Fix component formatting: Converted to proper Phoenix self-closing tag syntax
  • Add unique IDs: Added unique identifiers to dropdown menus to prevent conflicts
  • Clean up attributes: Removed unnecessary attributes and fixed formatting issues

Summary by Sourcery

Clean up storybook demo components by removing unused imports, deprecated API patterns and redundant attributes, modernizing tag syntax, and adding unique dropdown IDs to eliminate warnings.

Bug Fixes:

  • Remove console warnings by deleting unused SaladUI.Menu imports in dashboard demos

Enhancements:

  • Modernize API usage by dropping :let={builder} and builder props from tabs and select components
  • Convert empty component tags to self-closing syntax across all sidebar demos
  • Add unique id attributes to dropdown_menu instances in sidebar demos to prevent conflicts
  • Remove obsolete attributes like aschild and show_on_hover and correct attribute naming for side-offset

Remove :let={builder} and builder={builder} attributes to use
simplified tabs API without builder pattern.
…nents

Remove :let={builder} and builder={builder} attributes to use
simplified select API without builder pattern.
- Remove unnecessary aschild attribute from collapsible
- Fix attribute formatting: sideoffset to side-offset with proper syntax
- Remove show_on_hover attribute from dropdown trigger
Add unique ID attributes to prevent conflicts between multiple
dropdown menu instances in sidebar components.
Convert component tags to proper Phoenix self-closing format:
- Remove unnecessary child content from sidebar_trigger components
- Fix self-closing tags for separator, sidebar_rail, and input components
- Remove explicit icon content where components have default icons
@sourcery-ai
Copy link

sourcery-ai bot commented Sep 22, 2025

Reviewer's Guide

This PR cleans up storybook demo components by removing unused imports and deprecated builder patterns, updating HEEx syntax to self-closing tags, adding unique dropdown IDs, and fixing minor attribute formatting to eliminate console warnings.

File-Level Changes

Change Details Files
Remove unused SaladUI.Menu imports
  • Deleted import SaladUI.Menu statements
storybook/lib/salad_storybook_web/live/demo/dashboard_one_live.ex
storybook/lib/salad_storybook_web/live/demo/dashboard_two_live.ex
storybook/lib/salad_storybook_web/live/demo/dashboard_three_live.ex
Modernize component APIs by removing deprecated builder patterns
  • Removed :let={builder} and builder props from tabs
  • Removed builder prop from select_content tags
storybook/lib/salad_storybook_web/live/demo/dashboard_one_live.ex
storybook/lib/salad_storybook_web/live/demo/demo.ex
Convert template tags to Phoenix self-closing syntax
  • Changed paired component tags to self-closing form
  • Updated input and separator tags to self-close
storybook/lib/salad_storybook_web/live/demo/sidebar_six.ex
storybook/lib/salad_storybook_web/live/demo/sidebar_one.ex
storybook/lib/salad_storybook_web/live/demo/sidebar_three.ex
storybook/lib/salad_storybook_web/live/demo/sidebar_five.ex
storybook/lib/salad_storybook_web/live/demo/sidebar_four.ex
storybook/lib/salad_storybook_web/live/demo/sidebar_two.ex
Add unique IDs to dropdown_menu components
  • Assigned distinct id attributes to each dropdown_menu instance
storybook/lib/salad_storybook_web/live/demo/sidebar_three.ex
storybook/lib/salad_storybook_web/live/demo/sidebar_five.ex
storybook/lib/salad_storybook_web/live/demo/sidebar_four.ex
Fix minor attribute redundancies and formatting
  • Removed obsolete aschild attribute from collapsible
  • Corrected sideoffset syntax to side-offset prop
storybook/lib/salad_storybook_web/live/demo/sidebar_six.ex

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

Copy link

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

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

Hey there - I've reviewed your changes and they look great!

Prompt for AI Agents
Please address the comments from this code review:

## Individual Comments

### Comment 1
<location> `storybook/lib/salad_storybook_web/live/demo/sidebar_six.ex:396-393` </location>
<code_context>
             class="w-[--radix-dropdown-menu-trigger-width] min-w-56 rounded-lg"
             side="right"
             align="end"
-            sideoffset="{4}"
+            side-offset={4}
           >
             <.dropdown_menu_label class="p-0 font-normal">
</code_context>

<issue_to_address>
**issue (bug_risk):** Changed sideoffset to side-offset for dropdown menu; check for prop compatibility.

Verify that dropdown_menu uses side-offset as the prop name; otherwise, the offset will not work as intended.
</issue_to_address>

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

@@ -393,7 +390,7 @@ defmodule SaladStorybookWeb.Demo.SidebarSix do
class="w-[--radix-dropdown-menu-trigger-width] min-w-56 rounded-lg"
Copy link

Choose a reason for hiding this comment

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

issue (bug_risk): Changed sideoffset to side-offset for dropdown menu; check for prop compatibility.

Verify that dropdown_menu uses side-offset as the prop name; otherwise, the offset will not work as intended.

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.

1 participant