Skip to content

Conversation

@ryu-man
Copy link
Contributor

@ryu-man ryu-man commented Oct 22, 2025

No description provided.

@ryu-man ryu-man requested a review from Copilot October 22, 2025 13:41
@netlify
Copy link

netlify bot commented Oct 22, 2025

Deploy Preview for statuesque-boba-0fb888 ready!

Name Link
🔨 Latest commit 90d47f8
🔍 Latest deploy log https://app.netlify.com/projects/statuesque-boba-0fb888/deploys/68f8e03831e57600083efb25
😎 Deploy Preview https://deploy-preview-5--statuesque-boba-0fb888.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

Copy link

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 improves atom components by refactoring component implementations, adjusting styling to use design system tokens consistently, and improving the Storybook developer experience with better npm scripts.

Key Changes:

  • Refactored textarea to reuse Input component implementation
  • Updated component styles to use design system tokens (e.g., bg-input, bg-primary)
  • Enhanced snippet detection logic and added base prop to snippet rendering

Reviewed Changes

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

Show a summary per file
File Description
src/lib/components/textarea/textarea-root.svelte Refactored to use Input.Root component instead of custom implementation
src/lib/components/root/root.svelte Simplified Portals component ID by removing "fixed" suffix
src/lib/components/portal/portal-root.svelte Removed unused cn import
src/lib/components/portal/portal-inner.svelte Removed unused cn import
src/lib/components/input/input-root.svelte Updated background color from bg-background to bg-input token
src/lib/components/button/button.svelte Updated to use primary color tokens and added disabled state styling
src/lib/components/atom/html-atom.svelte Improved snippet detection logic and added base prop to snippet rendering
package.json Renamed and added Storybook scripts for better clarity and functionality

}: HtmlAtomProps<E, B> & HTMLAttributes<Element> = $props();
const isSnippet = typeof base === 'function' && base.name !== 'wrapper';
const isSnippet = $derived(typeof base === 'function' && base.length === 1 && !base.prototype);
Copy link

Copilot AI Oct 22, 2025

Choose a reason for hiding this comment

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

The snippet detection logic using base.length === 1 is fragile and may incorrectly identify functions. Svelte 5 snippets have a specific signature - consider using a more reliable detection method such as checking for the snippet symbol or using a documented Svelte API if available.

Suggested change
const isSnippet = $derived(typeof base === 'function' && base.length === 1 && !base.prototype);
const isSnippet = $derived(
typeof base === 'function' && !!base && !!base[Symbol.for('svelte.snippet')]
);

Copilot uses AI. Check for mistakes.

{#if isSnippet}
{@render snippet({ class: cn(klass), as, children, ...restProps })}
{@render snippet({ class: cn(klass), as, base, children, ...restProps })}
Copy link

Copilot AI Oct 22, 2025

Choose a reason for hiding this comment

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

Adding base to the snippet props is potentially breaking if existing snippets don't expect this parameter. Consider documenting this change or providing backward compatibility if this is part of a public API.

Suggested change
{@render snippet({ class: cn(klass), as, base, children, ...restProps })}
{@render snippet({ class: cn(klass), as, children, ...restProps })}

Copilot uses AI. Check for mistakes.
@ryu-man ryu-man merged commit 9734416 into main Oct 22, 2025
4 checks passed
@ryu-man ryu-man deleted the fix/improvements-010 branch October 22, 2025 13:47
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