Skip to content

builders: fix for radio width #1694

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 25, 2025
Merged

builders: fix for radio width #1694

merged 1 commit into from
Jul 25, 2025

Conversation

jjagielka
Copy link
Contributor

@jjagielka jjagielka commented Jul 25, 2025

Closes #

πŸ“‘ Description

Radios in builders have width mess up.

Status

  • Not Completed
  • Completed

βœ… Checks

  • My pull request adheres to the code style of this project
  • My code requires changes to the documentation
  • I have updated the documentation as required
  • I have checked the page with https://validator.unl.edu/
  • All the tests have passed
  • My pull request is based on the latest commit (not the npm version).

β„Ή Additional Information

Summary by CodeRabbit

  • Style
    • Updated the styling approach for all builder UI Radio components by moving width-related classes from the root element to the label element. This change ensures more consistent and targeted width styling across color, size, and option selectors throughout the builder interface.
    • Minor label text adjustment in the badge builder ("Color" to "Color 1").

Copy link

vercel bot commented Jul 25, 2025

@jjagielka is attempting to deploy a commit to the Themesberg Team on Vercel.

A member of the Team first needs to authorize it.

Copy link
Contributor

coderabbitai bot commented Jul 25, 2025

Walkthrough

This update standardizes the way width-related CSS classes are applied to Radio components across various builder UIs. Instead of assigning width classes directly via the class attribute on the Radio component, the width is now set on the label element inside each Radio using the classes prop. No logic or control flow is changed.

Changes

Files Change Summary
src/routes/builder/alert/+page.svelte,
.../checkbox/+page.svelte,
.../device-mockup/+page.svelte,
.../dropdown/+page.svelte,
.../file-input/+page.svelte,
.../floating-label/+page.svelte,
.../hr/+page.svelte,
.../label/+page.svelte,
.../link/+page.svelte,
.../list/+page.svelte,
.../popover/+page.svelte,
.../progress/+page.svelte,
.../range/+page.svelte,
.../select/+page.svelte,
.../span/+page.svelte,
.../spinner/+page.svelte,
.../tab/+page.svelte,
.../toast/+page.svelte,
.../toggle/+page.svelte,
.../video/+page.svelte
Changed width styling from direct class on Radio to classes prop targeting label element.
src/routes/builder/avatar/+page.svelte,
.../heading/+page.svelte,
.../table/+page.svelte
Changed width styling from direct class to classes prop on label for size/color radios.
src/routes/builder/badge/+page.svelte Changed color group label text and moved width class to classes prop on label.
src/routes/builder/blockquote/+page.svelte,
.../card/+page.svelte,
.../button-group/+page.svelte,
.../button/+page.svelte,
.../image/+page.svelte,
.../indicators/+page.svelte,
.../input-field/+page.svelte,
.../modal/+page.svelte,
.../paragraph/+page.svelte,
.../radio/+page.svelte,
.../skeleton/+page.svelte,
.../tooltip/+page.svelte
Changed width styling from direct class to classes prop on label for all relevant radios.

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant BuilderUI
    participant RadioComponent
    participant LabelElement

    User->>BuilderUI: Interacts with builder page
    BuilderUI->>RadioComponent: Renders Radio with `class="my-1"` and `classes={{ label: "w-XX" }}`
    RadioComponent->>LabelElement: Applies width class to label via `classes` prop
    User->>RadioComponent: Selects radio option
    RadioComponent->>BuilderUI: Updates selection state
Loading

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

Poem

πŸ‡βœ¨

A hop, a skip, a style anewβ€”
The radios wear their widths askew!
No longer root, but label proud,
The widths now stand out in the crowd.
With margin kept and labels wide,
The builder’s look is dignified.
Hooray for tidy, stylish code!

πŸ₯•

Note

⚑️ Unit Test Generation is now available in beta!

Learn more here, or try it out under "Finishing Touches" below.

✨ Finishing Touches
πŸ§ͺ Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment

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
πŸͺ§ Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai generate unit tests to generate unit tests for this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

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

♻️ Duplicate comments (5)
src/routes/builder/skeleton/+page.svelte (5)

112-119: Duplicate of the β€œadd key / lift object” advice given above; apply the same fix here.


135-137: Duplicate of the β€œadd key / lift object” advice given above; apply the same fix here.


150-151: Duplicate of the β€œadd key / lift object” advice given above; apply the same fix here.


165-166: Duplicate of the β€œadd key / lift object” advice given above; apply the same fix here.


203-204: Duplicate of the β€œadd key / lift object” advice given above; apply the same fix here (w-10 helper constant).

🧹 Nitpick comments (4)
src/routes/builder/spinner/+page.svelte (1)

84-86: Add keys to the each block for better performance.

The each block should include a key for proper Svelte reactivity and performance optimization.

Apply this diff to add keys:

-    {#each sizes as size}
+    {#each sizes as size (size)}
       <Radio class="my-1" classes={{ label: "w-12" }} name="spinnersize" bind:group={spinnerSize} value={size}>{size}</Radio>
     {/each}
src/routes/builder/toast/+page.svelte (1)

107-109: Add keys to each blocks for better performance.

The static analysis tool correctly identifies that each blocks should have keys for optimal reactivity and performance.

Apply this diff to add keys to the each blocks:

    {#each colors as colorOption}
-      <Radio class="my-1" classes={{ label: "w-24" }} name="interactive_toast_color" bind:group={toastColor} color={colorOption as RadioColorType} value={colorOption}>{colorOption}</Radio>
+      <Radio class="my-1" classes={{ label: "w-24" }} name="interactive_toast_color" bind:group={toastColor} color={colorOption as RadioColorType} value={colorOption}>{colorOption}</Radio>
    {/each}
    {#each transitions as transition}
-      <Radio class="my-1" classes={{ label: "w-16" }} name="interactive_toast_transition" bind:group={selectedTransition} value={transition.name}>{transition.name}</Radio>
+      <Radio class="my-1" classes={{ label: "w-16" }} name="interactive_toast_transition" bind:group={selectedTransition} value={transition.name}>{transition.name}</Radio>
    {/each}
    {#each positions as option}
-      <Radio class="my-1" classes={{ label: "w-32" }} name="interactive_toast_position" bind:group={toastPosition} value={option}>{option}</Radio>
+      <Radio class="my-1" classes={{ label: "w-32" }} name="interactive_toast_position" bind:group={toastPosition} value={option}>{option}</Radio>
    {/each}

Actually, let me correct that - the keys should be added to the each block syntax:

-    {#each colors as colorOption}
+    {#each colors as colorOption (colorOption)}
-    {#each transitions as transition}
+    {#each transitions as transition (transition.name)}
-    {#each positions as option}
+    {#each positions as option (option)}

Also applies to: 113-115, 119-121

src/routes/builder/modal/+page.svelte (1)

124-126: Add keys to each block for better performance.

The static analysis tool correctly identifies that each blocks should have keys for optimal rendering performance, especially when the list order might change.

Apply this diff to add keys:

-    {#each placements as position}
+    {#each placements as position (position)}
       <Radio class="my-1" classes={{ label: "w-32" }} name="modal-position" bind:group={placement} value={position}>{position}</Radio>
     {/each}

The same pattern should be applied to the other each blocks in this file (lines 118-120 and 130-132).

src/routes/builder/skeleton/+page.svelte (1)

95-95: Lift the classes object out of the loop to avoid needless allocations

Inline object literals like {{ label: "w-12" }} create a new reference on every render, triggering unnecessary updates in Radio. Define it once:

<script lang="ts">
  …
  const radioLabelW12 = { label: "w-12" };
</script>

<Radio class="my-1" classes={radioLabelW12} … />
πŸ“œ Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

πŸ“₯ Commits

Reviewing files that changed from the base of the PR and between 359dd90 and 582bb50.

πŸ“’ Files selected for processing (36)
  • src/routes/builder/alert/+page.svelte (1 hunks)
  • src/routes/builder/avatar/+page.svelte (1 hunks)
  • src/routes/builder/badge/+page.svelte (1 hunks)
  • src/routes/builder/blockquote/+page.svelte (1 hunks)
  • src/routes/builder/button-group/+page.svelte (1 hunks)
  • src/routes/builder/button/+page.svelte (2 hunks)
  • src/routes/builder/card/+page.svelte (1 hunks)
  • src/routes/builder/checkbox/+page.svelte (1 hunks)
  • src/routes/builder/device-mockup/+page.svelte (1 hunks)
  • src/routes/builder/dropdown/+page.svelte (1 hunks)
  • src/routes/builder/file-input/+page.svelte (1 hunks)
  • src/routes/builder/floating-label/+page.svelte (1 hunks)
  • src/routes/builder/heading/+page.svelte (1 hunks)
  • src/routes/builder/hr/+page.svelte (1 hunks)
  • src/routes/builder/image/+page.svelte (1 hunks)
  • src/routes/builder/indicators/+page.svelte (1 hunks)
  • src/routes/builder/input-field/+page.svelte (1 hunks)
  • src/routes/builder/label/+page.svelte (1 hunks)
  • src/routes/builder/link/+page.svelte (1 hunks)
  • src/routes/builder/list/+page.svelte (1 hunks)
  • src/routes/builder/modal/+page.svelte (1 hunks)
  • src/routes/builder/paragraph/+page.svelte (1 hunks)
  • src/routes/builder/popover/+page.svelte (1 hunks)
  • src/routes/builder/progress/+page.svelte (1 hunks)
  • src/routes/builder/radio/+page.svelte (1 hunks)
  • src/routes/builder/range/+page.svelte (1 hunks)
  • src/routes/builder/select/+page.svelte (1 hunks)
  • src/routes/builder/skeleton/+page.svelte (6 hunks)
  • src/routes/builder/span/+page.svelte (4 hunks)
  • src/routes/builder/spinner/+page.svelte (1 hunks)
  • src/routes/builder/tab/+page.svelte (1 hunks)
  • src/routes/builder/table/+page.svelte (1 hunks)
  • src/routes/builder/toast/+page.svelte (1 hunks)
  • src/routes/builder/toggle/+page.svelte (1 hunks)
  • src/routes/builder/tooltip/+page.svelte (1 hunks)
  • src/routes/builder/video/+page.svelte (1 hunks)
🧰 Additional context used
πŸͺ› ESLint
src/routes/builder/input-field/+page.svelte

[error] 100-102: Each block should have a key

(svelte/require-each-key)

src/routes/builder/modal/+page.svelte

[error] 124-126: Each block should have a key

(svelte/require-each-key)

src/routes/builder/card/+page.svelte

[error] 106-108: Each block should have a key

(svelte/require-each-key)

src/routes/builder/toast/+page.svelte

[error] 113-115: Each block should have a key

(svelte/require-each-key)

src/routes/builder/floating-label/+page.svelte

[error] 86-88: Each block should have a key

(svelte/require-each-key)

src/routes/builder/paragraph/+page.svelte

[error] 92-94: Each block should have a key

(svelte/require-each-key)


[error] 98-100: Each block should have a key

(svelte/require-each-key)


[error] 104-106: Each block should have a key

(svelte/require-each-key)


[error] 110-112: Each block should have a key

(svelte/require-each-key)

src/routes/builder/popover/+page.svelte

[error] 127-129: Each block should have a key

(svelte/require-each-key)

src/routes/builder/skeleton/+page.svelte

[error] 196-198: Each block should have a key

(svelte/require-each-key)

src/routes/builder/spinner/+page.svelte

[error] 84-86: Each block should have a key

(svelte/require-each-key)

πŸ”‡ Additional comments (34)
src/routes/builder/hr/+page.svelte (1)

83-83: LGTM! Correct implementation of Radio width styling fix.

The change properly moves the width class from the Radio component to its label element, which should resolve the width display issues mentioned in the PR objectives while maintaining proper margin spacing.

src/routes/builder/heading/+page.svelte (1)

72-72: LGTM! Consistent Radio width styling implementation.

The change correctly applies the width class to the label element while preserving margin styling on the Radio component, following the established pattern for fixing Radio width display issues.

src/routes/builder/tab/+page.svelte (1)

121-121: LGTM! Proper Radio width styling refactor.

The implementation correctly moves the width class to the label element using the classes prop, maintaining consistency with the overall refactoring pattern to fix Radio width display issues.

src/routes/builder/select/+page.svelte (1)

106-106: LGTM! Correct Radio width styling implementation.

The change properly applies the width class to the label element via the classes prop while maintaining margin styling on the Radio component, following the consistent pattern for resolving Radio width display issues.

src/routes/builder/label/+page.svelte (1)

51-51: βœ” Radio width styling refactor verified

Verification confirmed that all Radio components in src/routes/builder now consistently use classes={{ label: "w-XX" }} for width styling, with no remaining inline width classes. Approving the change.

src/routes/builder/video/+page.svelte (1)

80-80: LGTM! Clean styling refactoring.

The change correctly moves the width styling from the Radio component's root element to its label element using the classes prop, while keeping the margin class on the root. This is a good separation of concerns.

src/routes/builder/button-group/+page.svelte (1)

97-97: LGTM! Consistent styling improvements.

Both Radio components correctly implement the new styling approach by moving width classes to the label element via the classes prop while preserving margin classes on the root element.

Also applies to: 103-103

src/routes/builder/table/+page.svelte (1)

80-80: LGTM! Follows the consistent styling pattern.

The Radio component correctly implements the new styling approach, moving the width class to the label element while maintaining the margin class on the root.

src/routes/builder/device-mockup/+page.svelte (1)

150-150: LGTM! Consistent with the styling refactoring pattern.

The change properly moves the width styling to the label element while keeping the margin class on the root Radio component.

src/routes/builder/spinner/+page.svelte (2)

79-79: LGTM! Consistent styling refactoring across all Radio components.

All three Radio component groups (color, size, alignment) correctly implement the new styling approach with appropriate width classes moved to the label elements.

Also applies to: 85-85, 91-91


79-91: Radio component correctly applies classes.label for label styling

The Radio.svelte implementation exports the classes prop, derives styling.label from it, and passes it into the <Label> via class={label({ class: clsx(..., styling.label) })}. No further changes are needed.

src/routes/builder/blockquote/+page.svelte (1)

93-93: LGTM! Consistent Radio styling standardization.

The width classes have been correctly moved from the Radio component's class attribute to the classes prop targeting the label element. This change should resolve the width display issues mentioned in the PR objectives while maintaining proper spacing with the my-1 class on the root component.

Also applies to: 99-99

src/routes/builder/dropdown/+page.svelte (1)

177-177: LGTM! Consistent Radio styling fix applied.

The transition selection Radio components now follow the standardized pattern with width styling properly applied to the label element via the classes prop.

src/routes/builder/button/+page.svelte (1)

150-150: LGTM! Comprehensive Radio styling standardization.

All Radio components in both the standard button and gradient button builders have been consistently updated to use the classes prop for width styling. The appropriate width classes (w-24 for most options, w-32 for gradient colors with longer names) are now properly targeted to the label elements.

Also applies to: 156-156, 181-181, 187-187

src/routes/builder/avatar/+page.svelte (1)

115-115: LGTM! Avatar size Radio styling properly standardized.

The avatar size selection Radio components now use the classes prop with appropriate w-12 width for the label element, which is well-suited for the short size option names (xs, sm, md, lg, xl).

src/routes/builder/toast/+page.svelte (1)

108-108: LGTM! Toast Radio components properly standardized.

All three Radio groups (color, transition, position) now use the classes prop with appropriate width classes for their label elements. The varied widths (w-24, w-16, w-32) are well-suited to the different content lengths.

Also applies to: 114-114, 120-120

src/routes/builder/indicators/+page.svelte (1)

81-81: LGTM! Radio width styling fix applied correctly.

The migration from direct width classes on the Radio component to using the classes prop for label styling is implemented correctly. This approach provides better control over the Radio component's internal styling while maintaining the margin classes on the root element.

Also applies to: 87-87

src/routes/builder/radio/+page.svelte (1)

107-107: Excellent handling of conditional styling with the new classes prop.

The migration correctly separates concerns: width styling is moved to the label element via the classes prop, while conditional disabled state styling (cursor-not-allowed opacity-30) remains appropriately on the root Radio element for proper visual feedback.

Also applies to: 114-114

src/routes/builder/floating-label/+page.svelte (2)

81-81: Consistent application of the Radio styling pattern.

The changes correctly apply the new styling approach across all three Radio groups (style, color, helper color), maintaining proper separation between root element classes and label styling.

Also applies to: 87-87, 94-94


86-88: Static analysis hint can be safely ignored.

The ESLint warning about missing keys in each blocks is a false positive here. These Radio components are iterating over static configuration arrays (colors, inputStyles) rather than dynamic data that would require unique keys for proper reactivity.

src/routes/builder/input-field/+page.svelte (2)

95-95: Consistent Radio styling implementation with proper conditional handling.

The changes correctly implement the new styling pattern across all Radio groups, with appropriate handling of conditional disabled styling on the helper color radios.

Also applies to: 101-101, 108-108


100-102: Static analysis hint is not applicable here.

The ESLint warning about missing keys can be ignored. The each block iterates over a static sizes array (["sm", "md", "lg"]) which doesn't require unique keys for proper reactivity.

src/routes/builder/image/+page.svelte (1)

90-90: Thoughtful width sizing based on content length.

The changes correctly implement the Radio styling pattern with appropriate width values: w-16 for shorter size options and w-24 for longer effect options. This demonstrates good attention to content-appropriate sizing.

Also applies to: 97-97

src/routes/builder/badge/+page.svelte (2)

161-161: Verify the label text change from "Color" to "Color 1".

The label was changed from "Color" to "Color 1". Please confirm this change is intentional and aligns with the UI design requirements.


163-163: LGTM! Width styling correctly moved to label element.

The width class w-24 has been properly moved from the Radio component's root element to its label element via the classes prop, while maintaining the margin class my-1 on the Radio component itself. This change provides better control over the Radio component's internal styling.

src/routes/builder/alert/+page.svelte (1)

156-156: LGTM! Consistent application of the Radio width fix.

The width styling has been correctly moved to the label element, maintaining consistency with the PR's objective to standardize Radio component styling across builder components.

src/routes/builder/link/+page.svelte (1)

90-90: LGTM! Radio width styling correctly standardized.

The change follows the established pattern of moving width classes to the label element via the classes prop, ensuring consistent Radio component behavior across the builder interface.

src/routes/builder/modal/+page.svelte (1)

119-119: LGTM! Radio width styling consistently applied across all sections.

The width classes have been properly moved to the label elements for Size (w-12), Position (w-32), and Transition (w-16) sections, maintaining the established pattern throughout the file.

Also applies to: 125-125, 131-131

src/routes/builder/progress/+page.svelte (1)

114-114: LGTM! Radio width styling properly standardized.

Both the Size and Color sections have been updated with the consistent pattern of moving the w-24 width class to the label element via the classes prop, completing the Radio width fix for this builder component.

Also applies to: 120-120

src/routes/builder/popover/+page.svelte (1)

122-122: Excellent refactoring to improve CSS scoping!

The changes correctly move width classes from the Radio component's root element to its internal label element via the classes prop. This provides better control over styling and aligns with the PR objective of fixing radio width display issues.

Also applies to: 128-128, 134-134

src/routes/builder/card/+page.svelte (1)

101-101: Consistent styling improvement applied correctly.

The Radio component styling changes follow the same excellent pattern as other files, moving width classes to the label element for better CSS scoping.

Also applies to: 107-107, 113-113

src/routes/builder/toggle/+page.svelte (1)

93-93: Well-executed styling standardization.

The Radio component changes correctly implement the new styling pattern, moving width classes to the label element while maintaining appropriate margin classes for the toggle builder layout.

Also applies to: 99-99

src/routes/builder/tooltip/+page.svelte (1)

84-84: Clean implementation of the styling improvements.

The Radio component updates properly apply the new pattern with appropriate width values for different content types (w-24 for colors, w-32 for position labels).

Also applies to: 90-90

src/routes/builder/span/+page.svelte (1)

116-117: Comprehensive and well-formatted styling updates.

The Radio component changes are implemented consistently across all instances in the file, with clear multi-line formatting that enhances readability. The appropriate width values are used for different content types.

Also applies to: 134-134, 141-142, 159-160, 178-179

Comment on lines 100 to 102
{#each sizes as size}
<Radio class="my-1 w-16" name="interactive_card_size" bind:group={cardSize} value={size}>{size}</Radio>
<Radio class="my-1" classes={{ label: "w-16" }} name="interactive_card_size" bind:group={cardSize} value={size}>{size}</Radio>
{/each}
Copy link
Contributor

Choose a reason for hiding this comment

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

πŸ› οΈ Refactor suggestion

Add keys to each blocks.

ESLint correctly identifies missing keys in the each blocks.

 {#each sizes as size}
-  <Radio class="my-1" classes={{ label: "w-16" }} name="interactive_card_size" bind:group={cardSize} value={size}>{size}</Radio>
+  <Radio class="my-1" classes={{ label: "w-16" }} name="interactive_card_size" bind:group={cardSize} value={size} key={size}>{size}</Radio>
 {/each}

Apply similar fixes to the colors and shadows each blocks.

Also applies to: 106-108, 112-114

🧰 Tools
πŸͺ› ESLint

[error] 100-102: Each block should have a key

(svelte/require-each-key)

πŸ€– Prompt for AI Agents
In src/routes/builder/card/+page.svelte around lines 100-102, 106-108, and
112-114, the each blocks rendering sizes, colors, and shadows are missing unique
keys, which ESLint flags as an issue. Add a unique key to each each block by
specifying a key expression after the 'each' keyword, typically using the item
itself or a unique property, to help Svelte efficiently track list changes and
avoid rendering issues.

Comment on lines 80 to 83
<Label class="mb-4 w-full font-bold">Color</Label>
{#each colors as colorOption}
<Radio class="my-1 w-24" name="checkbox_color" bind:group={checkboxColor} color={colorOption as RadioColorType} onchange={() => (checkedState = true)} value={colorOption}>{colorOption}</Radio>
<Radio class="my-1" classes={{ label: "w-24" }} name="checkbox_color" bind:group={checkboxColor} color={colorOption as RadioColorType} onchange={() => (checkedState = true)} value={colorOption}>{colorOption}</Radio>
{/each}
Copy link
Contributor

Choose a reason for hiding this comment

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

πŸ› οΈ Refactor suggestion

Key the β€œColor” loop

-{#each colors as colorOption}
+{#each colors as colorOption (colorOption)}
   <Radio class="my-1" classes={{ label: "w-24" }} name="checkbox_color" bind:group={checkboxColor} color={colorOption as RadioColorType} onchange={() => (checkedState = true)} value={colorOption}>{colorOption}</Radio>
 {/each}
πŸ“ Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
<Label class="mb-4 w-full font-bold">Color</Label>
{#each colors as colorOption}
<Radio class="my-1 w-24" name="checkbox_color" bind:group={checkboxColor} color={colorOption as RadioColorType} onchange={() => (checkedState = true)} value={colorOption}>{colorOption}</Radio>
<Radio class="my-1" classes={{ label: "w-24" }} name="checkbox_color" bind:group={checkboxColor} color={colorOption as RadioColorType} onchange={() => (checkedState = true)} value={colorOption}>{colorOption}</Radio>
{/each}
<Label class="mb-4 w-full font-bold">Color</Label>
{#each colors as colorOption (colorOption)}
<Radio
class="my-1"
classes={{ label: "w-24" }}
name="checkbox_color"
bind:group={checkboxColor}
color={colorOption as RadioColorType}
onchange={() => (checkedState = true)}
value={colorOption}
>
{colorOption}
</Radio>
{/each}
🧰 Tools
πŸͺ› ESLint

[error] 81-83: Each block should have a key

(svelte/require-each-key)

πŸ€– Prompt for AI Agents
In src/routes/builder/checkbox/+page.svelte around lines 80 to 83, the each
block iterating over colors lacks a unique key, which is necessary for efficient
DOM updates. Add a unique key to the each block by specifying a key expression,
such as the colorOption itself, to the each directive to ensure Svelte can track
list items correctly.

Comment on lines 75 to 79
<div class="mt-4 mb-4 flex flex-wrap space-x-2">
<Label class="mb-4 w-full font-bold">Size</Label>
{#each sizes as sizeOption}
<Radio class="my-1 w-16" name="file_input_size" bind:group={size} value={sizeOption}>{sizeOption}</Radio>
<Radio class="my-1" classes={{ label: "w-16" }} name="file_input_size" bind:group={size} value={sizeOption}>{sizeOption}</Radio>
{/each}
Copy link
Contributor

Choose a reason for hiding this comment

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

πŸ› οΈ Refactor suggestion

Key the β€œSize” loop

-{#each sizes as sizeOption}
+{#each sizes as sizeOption (sizeOption)}
   <Radio class="my-1" classes={{ label: "w-16" }} name="file_input_size" bind:group={size} value={sizeOption}>{sizeOption}</Radio>
 {/each}
πŸ“ Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
<div class="mt-4 mb-4 flex flex-wrap space-x-2">
<Label class="mb-4 w-full font-bold">Size</Label>
{#each sizes as sizeOption}
<Radio class="my-1 w-16" name="file_input_size" bind:group={size} value={sizeOption}>{sizeOption}</Radio>
<Radio class="my-1" classes={{ label: "w-16" }} name="file_input_size" bind:group={size} value={sizeOption}>{sizeOption}</Radio>
{/each}
<div class="mt-4 mb-4 flex flex-wrap space-x-2">
<Label class="mb-4 w-full font-bold">Size</Label>
{#each sizes as sizeOption (sizeOption)}
<Radio
class="my-1"
classes={{ label: "w-16" }}
name="file_input_size"
bind:group={size}
value={sizeOption}
>
{sizeOption}
</Radio>
{/each}
🧰 Tools
πŸͺ› ESLint

[error] 77-79: Each block should have a key

(svelte/require-each-key)

πŸ€– Prompt for AI Agents
In src/routes/builder/file-input/+page.svelte around lines 75 to 79, the each
block rendering the size options lacks a unique key, which can cause rendering
inefficiencies and issues. Add a unique key to the each block by specifying a
key expression, such as the sizeOption itself, to help Svelte track list items
properly during updates.

Comment on lines 109 to 113
<Label class="mb-4 w-full font-bold">Tag</Label>
{#each tags as tag}
<Radio class="my-1 w-20" name="list_tag" bind:group={listTag} value={tag}>{tag}</Radio>
<Radio class="my-1" classes={{ label: "w-20" }} name="list_tag" bind:group={listTag} value={tag}>{tag}</Radio>
{/each}
</div>
Copy link
Contributor

Choose a reason for hiding this comment

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

πŸ› οΈ Refactor suggestion

Key the β€œTag” loop

Same reasoning as above – add a key to resolve the ESLint error and improve diff-DOM stability.

-{#each tags as tag}
+{#each tags as tag (tag)}
   <Radio class="my-1" classes={{ label: "w-20" }} name="list_tag" bind:group={listTag} value={tag}>{tag}</Radio>
 {/each}
πŸ“ Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
<Label class="mb-4 w-full font-bold">Tag</Label>
{#each tags as tag}
<Radio class="my-1 w-20" name="list_tag" bind:group={listTag} value={tag}>{tag}</Radio>
<Radio class="my-1" classes={{ label: "w-20" }} name="list_tag" bind:group={listTag} value={tag}>{tag}</Radio>
{/each}
</div>
<Label class="mb-4 w-full font-bold">Tag</Label>
{#each tags as tag (tag)}
<Radio class="my-1" classes={{ label: "w-20" }} name="list_tag" bind:group={listTag} value={tag}>
{tag}
</Radio>
{/each}
</div>
🧰 Tools
πŸͺ› ESLint

[error] 110-112: Each block should have a key

(svelte/require-each-key)

πŸ€– Prompt for AI Agents
In src/routes/builder/list/+page.svelte around lines 109 to 113, the each block
rendering the tags lacks a key, causing an ESLint error and potential DOM diff
instability. Add a unique key to the each block, typically using the tag value
itself, by specifying {#each tags as tag (tag)} to ensure stable and efficient
DOM updates.

Comment on lines 115 to 118
<Label class="mb-4 w-full font-bold">Position</Label>
{#each positions as position}
<Radio class="my-1 w-20" name="list_position" bind:group={listPosition} value={position}>{position}</Radio>
<Radio class="my-1" classes={{ label: "w-20" }} name="list_position" bind:group={listPosition} value={position}>{position}</Radio>
{/each}
Copy link
Contributor

Choose a reason for hiding this comment

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

πŸ› οΈ Refactor suggestion

Key the β€œPosition” loop

-{#each positions as position}
+{#each positions as position (position)}
   <Radio class="my-1" classes={{ label: "w-20" }} name="list_position" bind:group={listPosition} value={position}>{position}</Radio>
 {/each}
🧰 Tools
πŸͺ› ESLint

[error] 116-118: Each block should have a key

(svelte/require-each-key)

πŸ€– Prompt for AI Agents
In src/routes/builder/list/+page.svelte around lines 115 to 118, the each block
iterating over positions lacks a unique key, which is important for efficient
DOM updates. Add a key directive to the each block using a unique identifier
from the position items, such as {#each positions as position (position)} to
ensure Svelte can track list items correctly.

Comment on lines 84 to 118
<div class="mb-4 flex flex-wrap space-x-4">
<Label class="mb-4 w-full font-bold">Size</Label>
{#each sizes as size}
<Radio class="my-1 w-12" name="p_size" bind:group={pSize} value={size}>{size}</Radio>
<Radio class="my-1" classes={{ label: "w-12" }} name="p_size" bind:group={pSize} value={size}>{size}</Radio>
{/each}
</div>
<div class="mb-4 flex flex-wrap space-x-4">
<Label class="mb-4 w-full font-bold">Weight</Label>
{#each weights as weight}
<Radio class="my-1 w-20" name="p_weight" bind:group={pWeight} value={weight}>{weight}</Radio>
<Radio class="my-1" classes={{ label: "w-20" }} name="p_weight" bind:group={pWeight} value={weight}>{weight}</Radio>
{/each}
</div>
<div class="mb-4 flex flex-wrap space-x-2">
<Label class="mb-4 w-full font-bold">Space(Tracking)</Label>
{#each spaces as space}
<Radio class="my-1 w-20" name="p_space" bind:group={pSpace} value={space}>{space}</Radio>
<Radio class="my-1" classes={{ label: "w-20" }} name="p_space" bind:group={pSpace} value={space}>{space}</Radio>
{/each}
</div>
<div class="mb-4 flex flex-wrap space-x-4">
<Label class="mb-4 w-full font-bold">Height(Leading)</Label>
{#each heights as height}
<Radio class="my-1 w-16" name="p_height" bind:group={pHeight} value={height}>{height}</Radio>
<Radio class="my-1" classes={{ label: "w-16" }} name="p_height" bind:group={pHeight} value={height}>{height}</Radio>
{/each}
</div>
<div class="mb-4 flex flex-wrap space-x-4">
<Label class="mb-4 w-full font-bold">Alignment</Label>
{#each alignments as align}
<Radio class="my-1 w-20" name="p_align" bind:group={pAlign} onchange={() => (pJustify = false)} value={align}>{align}</Radio>
<Radio class="my-1" classes={{ label: "w-20" }} name="p_align" bind:group={pAlign} onchange={() => (pJustify = false)} value={align}>{align}</Radio>
{/each}
</div>
<div class="mb-4 flex flex-wrap space-x-4">
<Label class="mb-4 w-full font-bold">Whitespace</Label>
{#each whitespaces as whitespace}
<Radio class="my-1 w-16" name="p_whitespace" bind:group={pWhitespace} value={whitespace}>{whitespace}</Radio>
<Radio class="my-1" classes={{ label: "w-16" }} name="p_whitespace" bind:group={pWhitespace} value={whitespace}>{whitespace}</Radio>
{/each}
Copy link
Contributor

Choose a reason for hiding this comment

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

πŸ› οΈ Refactor suggestion

Resolve all svelte/require-each-key errors in one sweep

Every #each here is missing a key. Add an identity key to keep the linter quiet and avoid DOM shuffle:

-{#each sizes as size}
+{#each sizes as size (size)}
 …
-{#each weights as weight}
+{#each weights as weight (weight)}
 …
-{#each spaces as space}
+{#each spaces as space (space)}
 …
-{#each heights as height}
+{#each heights as height (height)}
 …
-{#each alignments as align}
+{#each alignments as align (align)}
 …
-{#each whitespaces as whitespace}
+{#each whitespaces as whitespace (whitespace)}

(This affects six loops in total.)

πŸ“ Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
<div class="mb-4 flex flex-wrap space-x-4">
<Label class="mb-4 w-full font-bold">Size</Label>
{#each sizes as size}
<Radio class="my-1 w-12" name="p_size" bind:group={pSize} value={size}>{size}</Radio>
<Radio class="my-1" classes={{ label: "w-12" }} name="p_size" bind:group={pSize} value={size}>{size}</Radio>
{/each}
</div>
<div class="mb-4 flex flex-wrap space-x-4">
<Label class="mb-4 w-full font-bold">Weight</Label>
{#each weights as weight}
<Radio class="my-1 w-20" name="p_weight" bind:group={pWeight} value={weight}>{weight}</Radio>
<Radio class="my-1" classes={{ label: "w-20" }} name="p_weight" bind:group={pWeight} value={weight}>{weight}</Radio>
{/each}
</div>
<div class="mb-4 flex flex-wrap space-x-2">
<Label class="mb-4 w-full font-bold">Space(Tracking)</Label>
{#each spaces as space}
<Radio class="my-1 w-20" name="p_space" bind:group={pSpace} value={space}>{space}</Radio>
<Radio class="my-1" classes={{ label: "w-20" }} name="p_space" bind:group={pSpace} value={space}>{space}</Radio>
{/each}
</div>
<div class="mb-4 flex flex-wrap space-x-4">
<Label class="mb-4 w-full font-bold">Height(Leading)</Label>
{#each heights as height}
<Radio class="my-1 w-16" name="p_height" bind:group={pHeight} value={height}>{height}</Radio>
<Radio class="my-1" classes={{ label: "w-16" }} name="p_height" bind:group={pHeight} value={height}>{height}</Radio>
{/each}
</div>
<div class="mb-4 flex flex-wrap space-x-4">
<Label class="mb-4 w-full font-bold">Alignment</Label>
{#each alignments as align}
<Radio class="my-1 w-20" name="p_align" bind:group={pAlign} onchange={() => (pJustify = false)} value={align}>{align}</Radio>
<Radio class="my-1" classes={{ label: "w-20" }} name="p_align" bind:group={pAlign} onchange={() => (pJustify = false)} value={align}>{align}</Radio>
{/each}
</div>
<div class="mb-4 flex flex-wrap space-x-4">
<Label class="mb-4 w-full font-bold">Whitespace</Label>
{#each whitespaces as whitespace}
<Radio class="my-1 w-16" name="p_whitespace" bind:group={pWhitespace} value={whitespace}>{whitespace}</Radio>
<Radio class="my-1" classes={{ label: "w-16" }} name="p_whitespace" bind:group={pWhitespace} value={whitespace}>{whitespace}</Radio>
{/each}
<div class="mb-4 flex flex-wrap space-x-4">
<Label class="mb-4 w-full font-bold">Size</Label>
{#each sizes as size (size)}
<Radio class="my-1" classes={{ label: "w-12" }} name="p_size" bind:group={pSize} value={size}>{size}</Radio>
{/each}
</div>
<div class="mb-4 flex flex-wrap space-x-4">
<Label class="mb-4 w-full font-bold">Weight</Label>
{#each weights as weight (weight)}
<Radio class="my-1" classes={{ label: "w-20" }} name="p_weight" bind:group={pWeight} value={weight}>{weight}</Radio>
{/each}
</div>
<div class="mb-4 flex flex-wrap space-x-2">
<Label class="mb-4 w-full font-bold">Space(Tracking)</Label>
{#each spaces as space (space)}
<Radio class="my-1" classes={{ label: "w-20" }} name="p_space" bind:group={pSpace} value={space}>{space}</Radio>
{/each}
</div>
<div class="mb-4 flex flex-wrap space-x-4">
<Label class="mb-4 w-full font-bold">Height(Leading)</Label>
{#each heights as height (height)}
<Radio class="my-1" classes={{ label: "w-16" }} name="p_height" bind:group={pHeight} value={height}>{height}</Radio>
{/each}
</div>
<div class="mb-4 flex flex-wrap space-x-4">
<Label class="mb-4 w-full font-bold">Alignment</Label>
{#each alignments as align (align)}
<Radio class="my-1" classes={{ label: "w-20" }} name="p_align" bind:group={pAlign} onchange={() => (pJustify = false)} value={align}>{align}</Radio>
{/each}
</div>
<div class="mb-4 flex flex-wrap space-x-4">
<Label class="mb-4 w-full font-bold">Whitespace</Label>
{#each whitespaces as whitespace (whitespace)}
<Radio class="my-1" classes={{ label: "w-16" }} name="p_whitespace" bind:group={pWhitespace} value={whitespace}>{whitespace}</Radio>
{/each}
</div>
🧰 Tools
πŸͺ› ESLint

[error] 86-88: Each block should have a key

(svelte/require-each-key)


[error] 92-94: Each block should have a key

(svelte/require-each-key)


[error] 98-100: Each block should have a key

(svelte/require-each-key)


[error] 104-106: Each block should have a key

(svelte/require-each-key)


[error] 110-112: Each block should have a key

(svelte/require-each-key)


[error] 116-118: Each block should have a key

(svelte/require-each-key)

πŸ€– Prompt for AI Agents
In src/routes/builder/paragraph/+page.svelte between lines 84 and 118, all six
#each blocks rendering Radio components lack a unique key, causing
svelte/require-each-key linter errors. Fix this by adding a key attribute to
each #each block using a unique identifier from the iterated item, such as the
size, weight, space, height, align, or whitespace value, to ensure stable DOM
updates and satisfy the linter.

Comment on lines 121 to 123
{#each colors as colorOption}
<Radio class="my-1 w-24" name="alert_reactive" bind:group={color} color={colorOption as RadioColorType} value={colorOption}>{colorOption}</Radio>
<Radio class="my-1" classes={{ label: "w-24" }} name="alert_reactive" bind:group={color} color={colorOption as RadioColorType} value={colorOption}>{colorOption}</Radio>
{/each}
Copy link
Contributor

Choose a reason for hiding this comment

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

πŸ› οΈ Refactor suggestion

Add keys to each blocks for better performance.

The ESLint warning is valid - each blocks should have unique keys for better performance and debugging.

Apply this pattern to fix the missing keys:

 {#each colors as colorOption}
-  <Radio class="my-1" classes={{ label: "w-24" }} name="alert_reactive" bind:group={color} color={colorOption as RadioColorType} value={colorOption}>{colorOption}</Radio>
+  <Radio class="my-1" classes={{ label: "w-24" }} name="alert_reactive" bind:group={color} color={colorOption as RadioColorType} value={colorOption} key={colorOption}>{colorOption}</Radio>
 {/each}

Apply similar changes to the placements and transitions each blocks.

Also applies to: 127-129, 133-135

🧰 Tools
πŸͺ› ESLint

[error] 121-123: Each block should have a key

(svelte/require-each-key)

πŸ€– Prompt for AI Agents
In src/routes/builder/popover/+page.svelte around lines 121 to 123, the each
block rendering Radio components lacks unique keys, which can degrade
performance and debugging. Add a unique key to each Radio component in the each
block, typically using the colorOption value or another unique identifier.
Similarly, apply unique keys to the each blocks at lines 127-129 and 133-135 for
placements and transitions to ensure consistent performance improvements.

Comment on lines 97 to 99
{#each colors as colorOption}
<Radio class="my-1 w-24" name="default_alert_color" bind:group={rangeColor} color={colorOption as RangeColorType} value={colorOption}>{colorOption}</Radio>
<Radio class="my-1" classes={{ label: "w-24" }} name="default_alert_color" bind:group={rangeColor} color={colorOption as RangeColorType} value={colorOption}>{colorOption}</Radio>
{/each}
Copy link
Contributor

Choose a reason for hiding this comment

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

πŸ’‘ Verification agent

🧩 Analysis chain

Add a keyed #each to silence linter & avoid diff-DOM churn

eslint-plugin-svelte is right: without an explicit key, Svelte has to reconcile DOM nodes heuristically, which is slower and can lead to visual glitches.
Keying by the iterated value is enough here.

-{#each colors as colorOption}
+{#each colors as colorOption (colorOption)}
   <Radio class="my-1" classes={{ label: "w-24" }} name="default_alert_color" bind:group={rangeColor} color={colorOption as RangeColorType} value={colorOption}>{colorOption}</Radio>
 {/each}

🏁 Script executed:

#!/bin/bash
# 1. Locate where `colors` is defined or imported in the component
rg -n 'colors' -A5 -B5 src/routes/builder/range/+page.svelte

# 2. Locate the definition of RangeColorType to confirm it’s a primitive (string/number) union
rg -n 'type RangeColorType' -A3 -B3 -t ts

Length of output: 1786


Add a key to the #each block to avoid DOM-reconciliation churn

Adding an explicit key silences the linter and ensures Svelte can efficiently track each item by its unique value.

β€’ File: src/routes/builder/range/+page.svelte (lines 97–99)
β€’ Wrap the #each with (colorOption) since each entry is a unique string:

-{#each colors as colorOption}
+{#each colors as colorOption (colorOption)}
   <Radio
     class="my-1"
     classes={{ label: "w-24" }}
     name="default_alert_color"
     bind:group={rangeColor}
     color={colorOption as RangeColorType}
     value={colorOption}
   >
     {colorOption}
   </Radio>
 {/each}
πŸ“ Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
{#each colors as colorOption}
<Radio class="my-1 w-24" name="default_alert_color" bind:group={rangeColor} color={colorOption as RangeColorType} value={colorOption}>{colorOption}</Radio>
<Radio class="my-1" classes={{ label: "w-24" }} name="default_alert_color" bind:group={rangeColor} color={colorOption as RangeColorType} value={colorOption}>{colorOption}</Radio>
{/each}
{#each colors as colorOption (colorOption)}
<Radio
class="my-1"
classes={{ label: "w-24" }}
name="default_alert_color"
bind:group={rangeColor}
color={colorOption as RangeColorType}
value={colorOption}
>
{colorOption}
</Radio>
{/each}
🧰 Tools
πŸͺ› ESLint

[error] 97-99: Each block should have a key

(svelte/require-each-key)

πŸ€– Prompt for AI Agents
In src/routes/builder/range/+page.svelte around lines 97 to 99, the #each block
iterating over colors lacks a key, which can cause inefficient DOM updates. Add
a key by changing the #each syntax to #each colors as colorOption (colorOption)
to provide a unique identifier for each item, improving rendering performance
and silencing the linter warning.

Comment on lines 93 to 97
<Label class="mb-4 w-full font-bold">Size(width)</Label>
{#each skeletonSizes as size}
<Radio class="my-1 w-12" name="skeletonsize" bind:group={skeletonSize} value={size}>{size}</Radio>
<Radio class="my-1" classes={{ label: "w-12" }} name="skeletonsize" bind:group={skeletonSize} value={size}>{size}</Radio>
{/each}
</div>
Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue

Add keys to each blocks to satisfy ESLint and keep DOM diff stable

{#each skeletonSizes as size} lacks an explicit key. ESLint (svelte/require-each-key) will error and some CI pipelines treat this as blocking. Add a key and replicate across all similar loops.

-{#each skeletonSizes as size}
+{#each skeletonSizes as size (size)}
   <Radio class="my-1" classes={{ label: "w-12" }} name="skeletonsize" bind:group={skeletonSize} value={size}>{size}</Radio>
{/each}
πŸ“ Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
<Label class="mb-4 w-full font-bold">Size(width)</Label>
{#each skeletonSizes as size}
<Radio class="my-1 w-12" name="skeletonsize" bind:group={skeletonSize} value={size}>{size}</Radio>
<Radio class="my-1" classes={{ label: "w-12" }} name="skeletonsize" bind:group={skeletonSize} value={size}>{size}</Radio>
{/each}
</div>
<Label class="mb-4 w-full font-bold">Size(width)</Label>
{#each skeletonSizes as size (size)}
<Radio class="my-1" classes={{ label: "w-12" }} name="skeletonsize" bind:group={skeletonSize} value={size}>{size}</Radio>
{/each}
</div>
🧰 Tools
πŸͺ› ESLint

[error] 94-96: Each block should have a key

(svelte/require-each-key)

πŸ€– Prompt for AI Agents
In src/routes/builder/skeleton/+page.svelte around lines 93 to 97, the each
block iterating over skeletonSizes lacks an explicit key, causing ESLint errors
and unstable DOM diffs. Fix this by adding a unique key to the each block, for
example `{#each skeletonSizes as size (size)}`, ensuring the key uniquely
identifies each item. Apply this pattern to all similar each blocks in the file.

Comment on lines +191 to 198
<Radio class="my-1" classes={{ label: "w-12" }} name="size" bind:group={listPlaceholderSize} value={size}>{size}</Radio>
{/each}
</div>
<div class="mb-4 flex flex-wrap space-x-4">
<Label class="mb-4 w-full font-bold">Rounded</Label>
{#each listRoundedSizes as size}
<Radio class="my-1 w-12" name="roundedSize" bind:group={listPlaceholderRounded} value={size}>{size}</Radio>
<Radio class="my-1" classes={{ label: "w-12" }} name="roundedSize" bind:group={listPlaceholderRounded} value={size}>{size}</Radio>
{/each}
Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue

Fix linter-blocking error on listRoundedSizes loop

Static analysis flagged this exact section. Without a key the build may fail.

-{#each listRoundedSizes as size}
+{#each listRoundedSizes as size (size)}
   <Radio class="my-1" classes={{ label: "w-12" }} name="roundedSize" bind:group={listPlaceholderRounded} value={size}>{size}</Radio>
{/each}

Apply to every each loop for consistency.

🧰 Tools
πŸͺ› ESLint

[error] 196-198: Each block should have a key

(svelte/require-each-key)

πŸ€– Prompt for AI Agents
In src/routes/builder/skeleton/+page.svelte around lines 191 to 198, the each
loop iterating over listRoundedSizes lacks a key, causing a linter error and
potential build failure. Add a unique key to the each block by specifying a key
expression, such as the size value, to ensure stable list rendering. Apply the
same key addition to all each loops in this file for consistency.

@shinokada shinokada merged commit 3fb4e40 into themesberg:main Jul 25, 2025
1 of 2 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