Skip to content

Conversation

@GoldGroove06
Copy link
Contributor

@GoldGroove06 GoldGroove06 commented Jul 21, 2025

closes #1185

errors brought down from 54 to 25

Summary by CodeRabbit

  • Refactor
    • Removed unused imports and variables across multiple UI components for improved code cleanliness.
    • Simplified context destructuring in several components, reducing unnecessary property extraction.
    • Set explicit default values for certain component properties to ensure consistent behavior.

No changes to user-facing features or functionality.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Jul 21, 2025

Caution

Review failed

The pull request is closed.

Walkthrough

This change removes unused imports and variables, and adjusts some default prop values across multiple React component and primitive files. The updates are focused on code cleanup, primarily eliminating unused hooks, context properties, and utility imports, as well as standardizing default prop values in a radio group component.

Changes

Files/Group Change Summary
src/components/ui/Accordion/fragments/AccordionRoot.tsx
src/components/ui/Select/fragments/SelectContent.tsx
src/components/ui/Select/fragments/SelectPortal.tsx
src/components/ui/Select/fragments/SelectRoot.tsx
src/components/ui/Slider/fragments/SliderThumb.tsx
src/components/ui/Tree/fragments/TreeItem.tsx
src/core/primitives/CheckboxGroup/fragments/CheckboxGroupPrimitiveTrigger.tsx
src/core/primitives/Collapsible/contexts/CollapsiblePrimitiveContext.tsx
src/core/primitives/Dialog/fragments/DialogPrimitiveContent.tsx
src/core/primitives/RadioGroup/fragments/RadioGroupPrimitiveRoot.tsx
src/core/primitives/Select/fragments/SelectPrimitiveRoot.tsx
src/core/primitives/Select/fragments/SelectPrimitiveTrigger.tsx
src/core/utils/RovingFocusGroup/fragments/RovingFocusItem.tsx
Removed unused imports (hooks, utilities, modules) and simplified import statements.
src/components/ui/AlertDialog/fragments/AlertDialogTrigger.tsx Removed unused ButtonPrimitive import.
src/components/ui/Link/Link.tsx Removed unused useComposeAttributes import.
src/components/ui/RadioGroup/fragments/RadioGroupRoot.tsx Set default values for variant and size props to empty strings.
src/components/ui/Slider/fragments/SliderTrack.tsx Removed unused setValue variable from context destructuring.
src/components/ui/Switch/fragments/SwitchThumb.tsx Removed unused setChecked variable from context destructuring.
src/components/ui/Tooltip/fragments/TooltipTrigger.tsx Removed unused setIsOpen and data from context destructuring.
src/core/primitives/Avatar/fragments/AvatarPrimitiveFallback.tsx Removed unused hasError from context destructuring.
src/core/primitives/Select/fragments/SelectPrimitiveContent.tsx Removed unused imports and destructuring of setIsOpen and selectedValue from context.
src/core/primitives/Select/fragments/SelectPrimitiveOverlay.tsx Removed unused clsx import.
src/core/primitives/Select/fragments/SelectPrimitiveSearch.tsx Removed unused selectedItemRef from context destructuring.

Sequence Diagram(s)

No sequence diagram generated, as the changes are limited to code cleanup and default value adjustments without affecting control flow or introducing new features.

Estimated code review effort

1 (~5 minutes)

Possibly related PRs

Poem

Hopping through code with a broom in my paw,
I sweep up the imports, unused and in awe.
Default props are tidy, the warnings are few,
The garden of code now sparkles anew.
With every clean file, I thump with delight—
A rabbit’s work brings the codebase to light!
🐇✨

Warning

There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure.

🔧 ESLint

If the error stems from missing dependencies, add them to the package.json file. For unrecoverable errors (e.g., due to private dependencies), disable the tool in the CodeRabbit configuration.

npm error Exit handler never called!
npm error This is an error with npm itself. Please report this error at:
npm error https://github.com/npm/cli/issues
npm error A complete log of this run can be found in: /.npm/_logs/2025-07-23T12_19_44_365Z-debug-0.log


📜 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 624d56d and ad848c7.

📒 Files selected for processing (1)
  • src/components/ui/RadioGroup/fragments/RadioGroupRoot.tsx (1 hunks)
✨ Finishing Touches
  • 📝 Generate Docstrings

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

@GoldGroove06 GoldGroove06 changed the title eslint fixes and build fix eslint fixes Jul 21, 2025
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: 0

🔭 Outside diff range comments (4)
src/components/ui/Tree/fragments/TreeItem.tsx (1)

8-13: Add explicit typings for item and level props

item is referenced later (item.items, item.label) but isn’t part of the declared prop type, forcing callers to fall back to any and undermining type safety.

 type TreeItemProps = {
     children: React.ReactNode;
-    [key: string]: any;
+    item: {
+        label: string;
+        items?: TreeItemProps['item'][];
+    };
+    level?: number;
+    className?: string;
+    [key: string]: any; // keep index signature if truly needed
 };
src/components/ui/Link/Link.tsx (2)

10-17: props type is incorrect – should not be an array.
props?: Record<string, any>[]; implies you expect an array of props, but you later spread ...props (an object). Change the type to a single object to satisfy TS and avoid the @ts-ignore further down.

-    props?: Record<string, any>[];
+    props?: Record<string, any>;

22-27: Remove the @ts-ignore by aligning types & drop misleading TODO.

  1. Once the props type is fixed, the ignore directive can be deleted.
  2. The TODO about an alt attribute on <a> is obsolete—please delete it to avoid confusion.
-    // @ts-ignore
-    return <Primitive.a href={href} className={clsx(rootClass, className)} {...dataAttributes()} {...props}>{children}</Primitive.a>;
+    return (
+        <Primitive.a
+            href={href}
+            className={clsx(rootClass, className)}
+            {...dataAttributes()}
+            {...props}
+        >
+            {children}
+        </Primitive.a>
+    );
src/core/primitives/Select/fragments/SelectPrimitiveContent.tsx (1)

37-44: Guard against refs.floating.current being null before dereferencing

querySelector will throw if refs.floating.current is still null (which can happen while focus manager is mounting / unmounting).
Add a null check so the handler is resilient.

-                            onKeyDownCapture={(e) => {
-                                if (e.key === 'Enter') {
-                                    e.preventDefault();
-                                    const itemValue = refs.floating.current.querySelector('[data-active="true"]');
- 
-                                    if (itemValue) {
-                                        handleSelect((itemValue.getAttribute('data-value')));
-                                    }
-                                }
-                            }}
+                            onKeyDownCapture={(e) => {
+                                if (e.key === 'Enter' && refs.floating.current) {
+                                    e.preventDefault();
+                                    const itemValue =
+                                        refs.floating.current.querySelector('[data-active="true"]');
+
+                                    if (itemValue) {
+                                        handleSelect(itemValue.getAttribute('data-value'));
+                                    }
+                                }
+                            }}
🧹 Nitpick comments (9)
src/core/primitives/Collapsible/contexts/CollapsiblePrimitiveContext.tsx (1)

38-38: Optional: add a displayName for easier React DevTools debugging
Assigning a displayName to the context greatly improves traceability when inspecting component trees.

-export const CollapsiblePrimitiveContext = createContext<CollapsiblePrimitiveContextValue | undefined>(undefined);
+export const CollapsiblePrimitiveContext =
+  createContext<CollapsiblePrimitiveContextValue | undefined>(undefined);
+CollapsiblePrimitiveContext.displayName = 'CollapsiblePrimitiveContext';
src/core/utils/RovingFocusGroup/fragments/RovingFocusItem.tsx (1)

58-63: Drop focusedItemId from the useEffect deps to avoid redundant executions

focusedItemId isn’t referenced inside this effect body, yet its presence in the dependency array causes the effect to re-run every time focus changes, wasting cycles.

-  }, [focusItems, focusedItemId, id, addFocusItem]);
+  }, [focusItems, id, addFocusItem]);
src/components/ui/Slider/fragments/SliderThumb.tsx (1)

16-17: Remove stray console.log before shipping

Leaving debug statements in production components clutters the console and can leak internal state.

-        console.log(e.target.value);
+        // handle value change here
src/core/primitives/Select/fragments/SelectPrimitiveRoot.tsx (1)

64-73: useLayoutEffect deps reference .current fields – causes perpetual re-runs

Objects like refs.floating.current and selectedItemRef.current are mutated outside React’s state system, so their identity changes every render, re-triggering the effect unnecessarily.

-}, [refs.floating.current, selectedItemRef.current, shift, isOpen]);
+// depend only on stable refs / state
+}, [shift, isOpen, refs.floating, selectedItemRef]);

Alternatively, compute the measurements inside the effect without listing the volatile .current values as dependencies.

src/core/primitives/RadioGroup/fragments/RadioGroupPrimitiveRoot.tsx (1)

28-33: Nit: consider narrowing context value type.
sendItems is implicitly any unless RadioGroupContext is typed. Add an explicit interface so downstream consumers get autocomplete & type-safety.

src/components/ui/AvatarGroup/AvatarGroup.tsx (1)

11-16: Whitespace fix is fine, but logging in production is not.
console.warn at line 7 will fire every render – noisy for consumers. Replace with dev-only invariant or remove entirely.

src/components/ui/Select/fragments/SelectPortal.tsx (1)

9-13: rootElement is dead code and can be removed.
It’s computed but never used, still flagged by eslint. Drop it or pass it to SelectPrimitive.Portal if that was the intent.

-    const rootElement = document.querySelector('#rad-ui-theme-container') || document.body as HTMLElement | null;
src/components/ui/Select/fragments/SelectRoot.tsx (1)

1-1: Import is fine – optional further cleanup

Since the file no longer references React, you could also drop the default import altogether if the project uses the automatic JSX runtime ("jsx": "react-jsx" in tsconfig.json).

src/core/primitives/Select/fragments/SelectPrimitiveSearch.tsx (1)

57-58: Drop leftover console logs

console.log calls will slip into production bundles and defeat the eslint goal of this PR.

-            console.log('arrow input taken');
...
-    console.log('activeItemValue', activeItemValue);

Also applies to: 81-82

📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between 4353e74 and 624d56d.

📒 Files selected for processing (27)
  • src/components/ui/Accordion/fragments/AccordionRoot.tsx (1 hunks)
  • src/components/ui/AlertDialog/fragments/AlertDialogTrigger.tsx (0 hunks)
  • src/components/ui/AvatarGroup/AvatarGroup.tsx (1 hunks)
  • src/components/ui/AvatarGroup/fragments/AvatarGroupItem.tsx (1 hunks)
  • src/components/ui/Link/Link.tsx (1 hunks)
  • src/components/ui/RadioGroup/fragments/RadioGroupRoot.tsx (0 hunks)
  • src/components/ui/Select/fragments/SelectContent.tsx (1 hunks)
  • src/components/ui/Select/fragments/SelectPortal.tsx (1 hunks)
  • src/components/ui/Select/fragments/SelectRoot.tsx (1 hunks)
  • src/components/ui/Slider/fragments/SliderThumb.tsx (1 hunks)
  • src/components/ui/Slider/fragments/SliderTrack.tsx (1 hunks)
  • src/components/ui/Switch/fragments/SwitchRoot.tsx (1 hunks)
  • src/components/ui/Switch/fragments/SwitchThumb.tsx (1 hunks)
  • src/components/ui/Tooltip/fragments/TooltipTrigger.tsx (1 hunks)
  • src/components/ui/Tree/fragments/TreeItem.tsx (1 hunks)
  • src/core/primitives/Avatar/fragments/AvatarPrimitiveFallback.tsx (1 hunks)
  • src/core/primitives/CheckboxGroup/fragments/CheckboxGroupPrimitiveRoot.tsx (1 hunks)
  • src/core/primitives/CheckboxGroup/fragments/CheckboxGroupPrimitiveTrigger.tsx (0 hunks)
  • src/core/primitives/Collapsible/contexts/CollapsiblePrimitiveContext.tsx (1 hunks)
  • src/core/primitives/Dialog/fragments/DialogPrimitiveContent.tsx (0 hunks)
  • src/core/primitives/RadioGroup/fragments/RadioGroupPrimitiveRoot.tsx (2 hunks)
  • src/core/primitives/Select/fragments/SelectPrimitiveContent.tsx (2 hunks)
  • src/core/primitives/Select/fragments/SelectPrimitiveOverlay.tsx (0 hunks)
  • src/core/primitives/Select/fragments/SelectPrimitiveRoot.tsx (1 hunks)
  • src/core/primitives/Select/fragments/SelectPrimitiveSearch.tsx (1 hunks)
  • src/core/primitives/Select/fragments/SelectPrimitiveTrigger.tsx (0 hunks)
  • src/core/utils/RovingFocusGroup/fragments/RovingFocusItem.tsx (1 hunks)
💤 Files with no reviewable changes (6)
  • src/core/primitives/Select/fragments/SelectPrimitiveTrigger.tsx
  • src/components/ui/RadioGroup/fragments/RadioGroupRoot.tsx
  • src/core/primitives/CheckboxGroup/fragments/CheckboxGroupPrimitiveTrigger.tsx
  • src/components/ui/AlertDialog/fragments/AlertDialogTrigger.tsx
  • src/core/primitives/Select/fragments/SelectPrimitiveOverlay.tsx
  • src/core/primitives/Dialog/fragments/DialogPrimitiveContent.tsx
🧰 Additional context used
🧠 Learnings (21)
📓 Common learnings
Learnt from: kotAPI
PR: rad-ui/ui#640
File: .github/workflows/build-rad-ui.yml:5-5
Timestamp: 2024-12-14T02:25:41.034Z
Learning: In the `rad-ui/ui` repository, the `security-fixes` branch only updates dependencies, so linting and Chromatic workflows are not required for this branch.
Learnt from: decipher-cs
PR: rad-ui/ui#417
File: src/components/ui/Dropdown/Dropdown.stories.tsx:43-50
Timestamp: 2024-12-12T08:34:33.079Z
Learning: Ensure to verify existing ARIA attributes in components before suggesting additions during code reviews, especially in the `Dropdown.Trigger` component in `src/components/ui/Dropdown/Dropdown.stories.tsx`.
src/components/ui/Slider/fragments/SliderThumb.tsx (3)

Learnt from: decipher-cs
PR: #417
File: src/components/ui/Dropdown/Dropdown.stories.tsx:43-50
Timestamp: 2024-12-12T08:34:33.079Z
Learning: Ensure to verify existing ARIA attributes in components before suggesting additions during code reviews, especially in the Dropdown.Trigger component in src/components/ui/Dropdown/Dropdown.stories.tsx.

Learnt from: GoldGroove06
PR: #1215
File: src/core/primitives/CheckboxGroup/fragments/CheckboxGroupPrimitiveTrigger.tsx:25-27
Timestamp: 2025-07-18T16:43:26.143Z
Learning: In the CheckboxGroupPrimitiveTrigger component (src/core/primitives/CheckboxGroup/fragments/CheckboxGroupPrimitiveTrigger.tsx), the component uses two separate useEffect hooks with different purposes: the first useEffect (lines 25-27) with empty dependency array [] is meant to set the initial state only once on mount by syncing with the group's checked values, while the second useEffect (lines 28-34) handles ongoing state updates by propagating local isChecked changes back to the group's checkedValues. This pattern prevents infinite loops while maintaining proper synchronization.

Learnt from: kotAPI
PR: #576
File: src/core/primitives/Toggle/index.tsx:15-22
Timestamp: 2024-11-24T06:43:42.194Z
Learning: In the TogglePrimitive component (src/core/primitives/Toggle/index.tsx), when the component becomes controlled, it's acceptable to not sync the internal isPressed state with the external pressed prop.

src/core/utils/RovingFocusGroup/fragments/RovingFocusItem.tsx (3)

Learnt from: GoldGroove06
PR: #1215
File: src/core/primitives/CheckboxGroup/fragments/CheckboxGroupPrimitiveTrigger.tsx:25-27
Timestamp: 2025-07-18T16:43:26.143Z
Learning: In the CheckboxGroupPrimitiveTrigger component (src/core/primitives/CheckboxGroup/fragments/CheckboxGroupPrimitiveTrigger.tsx), the component uses two separate useEffect hooks with different purposes: the first useEffect (lines 25-27) with empty dependency array [] is meant to set the initial state only once on mount by syncing with the group's checked values, while the second useEffect (lines 28-34) handles ongoing state updates by propagating local isChecked changes back to the group's checkedValues. This pattern prevents infinite loops while maintaining proper synchronization.

Learnt from: decipher-cs
PR: #417
File: src/components/ui/Dropdown/Dropdown.stories.tsx:43-50
Timestamp: 2024-12-12T08:34:33.079Z
Learning: Ensure to verify existing ARIA attributes in components before suggesting additions during code reviews, especially in the Dropdown.Trigger component in src/components/ui/Dropdown/Dropdown.stories.tsx.

Learnt from: kotAPI
PR: #576
File: src/core/primitives/Toggle/index.tsx:15-22
Timestamp: 2024-11-24T06:43:42.194Z
Learning: In the TogglePrimitive component (src/core/primitives/Toggle/index.tsx), when the component becomes controlled, it's acceptable to not sync the internal isPressed state with the external pressed prop.

src/components/ui/AvatarGroup/fragments/AvatarGroupItem.tsx (1)

Learnt from: decipher-cs
PR: #417
File: src/components/ui/Dropdown/Dropdown.stories.tsx:43-50
Timestamp: 2024-12-12T08:34:33.079Z
Learning: Ensure to verify existing ARIA attributes in components before suggesting additions during code reviews, especially in the Dropdown.Trigger component in src/components/ui/Dropdown/Dropdown.stories.tsx.

src/components/ui/AvatarGroup/AvatarGroup.tsx (1)

Learnt from: decipher-cs
PR: #417
File: src/components/ui/Dropdown/Dropdown.stories.tsx:43-50
Timestamp: 2024-12-12T08:34:33.079Z
Learning: Ensure to verify existing ARIA attributes in components before suggesting additions during code reviews, especially in the Dropdown.Trigger component in src/components/ui/Dropdown/Dropdown.stories.tsx.

src/core/primitives/Select/fragments/SelectPrimitiveRoot.tsx (2)

Learnt from: GoldGroove06
PR: #1215
File: src/core/primitives/CheckboxGroup/fragments/CheckboxGroupPrimitiveTrigger.tsx:25-27
Timestamp: 2025-07-18T16:43:26.143Z
Learning: In the CheckboxGroupPrimitiveTrigger component (src/core/primitives/CheckboxGroup/fragments/CheckboxGroupPrimitiveTrigger.tsx), the component uses two separate useEffect hooks with different purposes: the first useEffect (lines 25-27) with empty dependency array [] is meant to set the initial state only once on mount by syncing with the group's checked values, while the second useEffect (lines 28-34) handles ongoing state updates by propagating local isChecked changes back to the group's checkedValues. This pattern prevents infinite loops while maintaining proper synchronization.

Learnt from: kotAPI
PR: #576
File: src/core/primitives/Toggle/index.tsx:15-22
Timestamp: 2024-11-24T06:43:42.194Z
Learning: In the TogglePrimitive component (src/core/primitives/Toggle/index.tsx), when the component becomes controlled, it's acceptable to not sync the internal isPressed state with the external pressed prop.

src/components/ui/Link/Link.tsx (2)

Learnt from: decipher-cs
PR: #417
File: src/components/ui/Dropdown/Dropdown.stories.tsx:43-50
Timestamp: 2024-12-12T08:34:33.079Z
Learning: Ensure to verify existing ARIA attributes in components before suggesting additions during code reviews, especially in the Dropdown.Trigger component in src/components/ui/Dropdown/Dropdown.stories.tsx.

Learnt from: GoldGroove06
PR: #1215
File: src/core/primitives/CheckboxGroup/fragments/CheckboxGroupPrimitiveTrigger.tsx:25-27
Timestamp: 2025-07-18T16:43:26.143Z
Learning: In the CheckboxGroupPrimitiveTrigger component (src/core/primitives/CheckboxGroup/fragments/CheckboxGroupPrimitiveTrigger.tsx), the component uses two separate useEffect hooks with different purposes: the first useEffect (lines 25-27) with empty dependency array [] is meant to set the initial state only once on mount by syncing with the group's checked values, while the second useEffect (lines 28-34) handles ongoing state updates by propagating local isChecked changes back to the group's checkedValues. This pattern prevents infinite loops while maintaining proper synchronization.

src/components/ui/Select/fragments/SelectPortal.tsx (2)

Learnt from: decipher-cs
PR: #417
File: src/components/ui/Dropdown/Dropdown.stories.tsx:43-50
Timestamp: 2024-12-12T08:34:33.079Z
Learning: Ensure to verify existing ARIA attributes in components before suggesting additions during code reviews, especially in the Dropdown.Trigger component in src/components/ui/Dropdown/Dropdown.stories.tsx.

Learnt from: kotAPI
PR: #576
File: src/core/primitives/Toggle/index.tsx:15-22
Timestamp: 2024-11-24T06:43:42.194Z
Learning: In the TogglePrimitive component (src/core/primitives/Toggle/index.tsx), when the component becomes controlled, it's acceptable to not sync the internal isPressed state with the external pressed prop.

src/components/ui/Accordion/fragments/AccordionRoot.tsx (3)

Learnt from: GoldGroove06
PR: #1215
File: src/core/primitives/CheckboxGroup/fragments/CheckboxGroupPrimitiveTrigger.tsx:25-27
Timestamp: 2025-07-18T16:43:26.143Z
Learning: In the CheckboxGroupPrimitiveTrigger component (src/core/primitives/CheckboxGroup/fragments/CheckboxGroupPrimitiveTrigger.tsx), the component uses two separate useEffect hooks with different purposes: the first useEffect (lines 25-27) with empty dependency array [] is meant to set the initial state only once on mount by syncing with the group's checked values, while the second useEffect (lines 28-34) handles ongoing state updates by propagating local isChecked changes back to the group's checkedValues. This pattern prevents infinite loops while maintaining proper synchronization.

Learnt from: decipher-cs
PR: #417
File: src/components/ui/Dropdown/Dropdown.stories.tsx:43-50
Timestamp: 2024-12-12T08:34:33.079Z
Learning: Ensure to verify existing ARIA attributes in components before suggesting additions during code reviews, especially in the Dropdown.Trigger component in src/components/ui/Dropdown/Dropdown.stories.tsx.

Learnt from: kotAPI
PR: #1031
File: src/components/ui/Accordion/fragments/AccordionRoot.tsx:41-44
Timestamp: 2025-04-07T04:38:34.864Z
Learning: The Accordion component in rad-ui/ui supports both controlled and uncontrolled modes through props like value, defaultValue, and onValueChange. When implementing controlled components, remember to: 1) Initialize state from defaultValue, 2) Update internal state when value changes (controlled mode), 3) Call onValueChange callback, and 4) Prevent internal state updates when in controlled mode.

src/core/primitives/CheckboxGroup/fragments/CheckboxGroupPrimitiveRoot.tsx (4)

Learnt from: GoldGroove06
PR: #1215
File: src/core/primitives/CheckboxGroup/fragments/CheckboxGroupPrimitiveTrigger.tsx:25-27
Timestamp: 2025-07-18T16:43:26.143Z
Learning: In the CheckboxGroupPrimitiveTrigger component (src/core/primitives/CheckboxGroup/fragments/CheckboxGroupPrimitiveTrigger.tsx), the component uses two separate useEffect hooks with different purposes: the first useEffect (lines 25-27) with empty dependency array [] is meant to set the initial state only once on mount by syncing with the group's checked values, while the second useEffect (lines 28-34) handles ongoing state updates by propagating local isChecked changes back to the group's checkedValues. This pattern prevents infinite loops while maintaining proper synchronization.

Learnt from: kotAPI
PR: #576
File: src/core/primitives/Toggle/index.tsx:15-22
Timestamp: 2024-11-24T06:43:42.194Z
Learning: In the TogglePrimitive component (src/core/primitives/Toggle/index.tsx), when the component becomes controlled, it's acceptable to not sync the internal isPressed state with the external pressed prop.

Learnt from: decipher-cs
PR: #417
File: src/components/ui/Dropdown/Dropdown.stories.tsx:43-50
Timestamp: 2024-12-12T08:34:33.079Z
Learning: Ensure to verify existing ARIA attributes in components before suggesting additions during code reviews, especially in the Dropdown.Trigger component in src/components/ui/Dropdown/Dropdown.stories.tsx.

Learnt from: kotAPI
PR: #1031
File: src/components/ui/Accordion/fragments/AccordionRoot.tsx:41-44
Timestamp: 2025-04-07T04:38:34.864Z
Learning: The Accordion component in rad-ui/ui supports both controlled and uncontrolled modes through props like value, defaultValue, and onValueChange. When implementing controlled components, remember to: 1) Initialize state from defaultValue, 2) Update internal state when value changes (controlled mode), 3) Call onValueChange callback, and 4) Prevent internal state updates when in controlled mode.

src/core/primitives/Collapsible/contexts/CollapsiblePrimitiveContext.tsx (3)

Learnt from: kotAPI
PR: #576
File: src/core/primitives/Toggle/index.tsx:15-22
Timestamp: 2024-11-24T06:43:42.194Z
Learning: In the TogglePrimitive component (src/core/primitives/Toggle/index.tsx), when the component becomes controlled, it's acceptable to not sync the internal isPressed state with the external pressed prop.

Learnt from: GoldGroove06
PR: #1215
File: src/core/primitives/CheckboxGroup/fragments/CheckboxGroupPrimitiveTrigger.tsx:25-27
Timestamp: 2025-07-18T16:43:26.143Z
Learning: In the CheckboxGroupPrimitiveTrigger component (src/core/primitives/CheckboxGroup/fragments/CheckboxGroupPrimitiveTrigger.tsx), the component uses two separate useEffect hooks with different purposes: the first useEffect (lines 25-27) with empty dependency array [] is meant to set the initial state only once on mount by syncing with the group's checked values, while the second useEffect (lines 28-34) handles ongoing state updates by propagating local isChecked changes back to the group's checkedValues. This pattern prevents infinite loops while maintaining proper synchronization.

Learnt from: kotAPI
PR: #1031
File: src/components/ui/Accordion/fragments/AccordionRoot.tsx:41-44
Timestamp: 2025-04-07T04:38:34.864Z
Learning: The Accordion component in rad-ui/ui supports both controlled and uncontrolled modes through props like value, defaultValue, and onValueChange. When implementing controlled components, remember to: 1) Initialize state from defaultValue, 2) Update internal state when value changes (controlled mode), 3) Call onValueChange callback, and 4) Prevent internal state updates when in controlled mode.

src/core/primitives/Avatar/fragments/AvatarPrimitiveFallback.tsx (1)

Learnt from: kotAPI
PR: #576
File: src/core/primitives/Toggle/index.tsx:15-22
Timestamp: 2024-11-24T06:43:42.194Z
Learning: In the TogglePrimitive component (src/core/primitives/Toggle/index.tsx), when the component becomes controlled, it's acceptable to not sync the internal isPressed state with the external pressed prop.

src/components/ui/Select/fragments/SelectContent.tsx (1)

Learnt from: GoldGroove06
PR: #1215
File: src/core/primitives/CheckboxGroup/fragments/CheckboxGroupPrimitiveTrigger.tsx:25-27
Timestamp: 2025-07-18T16:43:26.143Z
Learning: In the CheckboxGroupPrimitiveTrigger component (src/core/primitives/CheckboxGroup/fragments/CheckboxGroupPrimitiveTrigger.tsx), the component uses two separate useEffect hooks with different purposes: the first useEffect (lines 25-27) with empty dependency array [] is meant to set the initial state only once on mount by syncing with the group's checked values, while the second useEffect (lines 28-34) handles ongoing state updates by propagating local isChecked changes back to the group's checkedValues. This pattern prevents infinite loops while maintaining proper synchronization.

src/components/ui/Switch/fragments/SwitchRoot.tsx (4)

Learnt from: kotAPI
PR: #576
File: src/core/primitives/Toggle/index.tsx:15-22
Timestamp: 2024-11-24T06:43:42.194Z
Learning: In the TogglePrimitive component (src/core/primitives/Toggle/index.tsx), when the component becomes controlled, it's acceptable to not sync the internal isPressed state with the external pressed prop.

Learnt from: decipher-cs
PR: #417
File: src/components/ui/Dropdown/Dropdown.stories.tsx:43-50
Timestamp: 2024-12-12T08:34:33.079Z
Learning: Ensure to verify existing ARIA attributes in components before suggesting additions during code reviews, especially in the Dropdown.Trigger component in src/components/ui/Dropdown/Dropdown.stories.tsx.

Learnt from: GoldGroove06
PR: #1215
File: src/core/primitives/CheckboxGroup/fragments/CheckboxGroupPrimitiveTrigger.tsx:25-27
Timestamp: 2025-07-18T16:43:26.143Z
Learning: In the CheckboxGroupPrimitiveTrigger component (src/core/primitives/CheckboxGroup/fragments/CheckboxGroupPrimitiveTrigger.tsx), the component uses two separate useEffect hooks with different purposes: the first useEffect (lines 25-27) with empty dependency array [] is meant to set the initial state only once on mount by syncing with the group's checked values, while the second useEffect (lines 28-34) handles ongoing state updates by propagating local isChecked changes back to the group's checkedValues. This pattern prevents infinite loops while maintaining proper synchronization.

Learnt from: decipher-cs
PR: #417
File: src/components/ui/Dropdown/Dropdown.tsx:0-0
Timestamp: 2024-12-12T08:22:59.375Z
Learning: The Dropdown.Trigger component is customizable and needs to be used with Dropdown.Root.

src/core/primitives/RadioGroup/fragments/RadioGroupPrimitiveRoot.tsx (3)

Learnt from: GoldGroove06
PR: #1215
File: src/core/primitives/CheckboxGroup/fragments/CheckboxGroupPrimitiveTrigger.tsx:25-27
Timestamp: 2025-07-18T16:43:26.143Z
Learning: In the CheckboxGroupPrimitiveTrigger component (src/core/primitives/CheckboxGroup/fragments/CheckboxGroupPrimitiveTrigger.tsx), the component uses two separate useEffect hooks with different purposes: the first useEffect (lines 25-27) with empty dependency array [] is meant to set the initial state only once on mount by syncing with the group's checked values, while the second useEffect (lines 28-34) handles ongoing state updates by propagating local isChecked changes back to the group's checkedValues. This pattern prevents infinite loops while maintaining proper synchronization.

Learnt from: kotAPI
PR: #576
File: src/core/primitives/Toggle/index.tsx:15-22
Timestamp: 2024-11-24T06:43:42.194Z
Learning: In the TogglePrimitive component (src/core/primitives/Toggle/index.tsx), when the component becomes controlled, it's acceptable to not sync the internal isPressed state with the external pressed prop.

Learnt from: kotAPI
PR: #1031
File: src/components/ui/Accordion/fragments/AccordionRoot.tsx:41-44
Timestamp: 2025-04-07T04:38:34.864Z
Learning: The Accordion component in rad-ui/ui supports both controlled and uncontrolled modes through props like value, defaultValue, and onValueChange. When implementing controlled components, remember to: 1) Initialize state from defaultValue, 2) Update internal state when value changes (controlled mode), 3) Call onValueChange callback, and 4) Prevent internal state updates when in controlled mode.

src/components/ui/Select/fragments/SelectRoot.tsx (3)

Learnt from: GoldGroove06
PR: #1215
File: src/core/primitives/CheckboxGroup/fragments/CheckboxGroupPrimitiveTrigger.tsx:25-27
Timestamp: 2025-07-18T16:43:26.143Z
Learning: In the CheckboxGroupPrimitiveTrigger component (src/core/primitives/CheckboxGroup/fragments/CheckboxGroupPrimitiveTrigger.tsx), the component uses two separate useEffect hooks with different purposes: the first useEffect (lines 25-27) with empty dependency array [] is meant to set the initial state only once on mount by syncing with the group's checked values, while the second useEffect (lines 28-34) handles ongoing state updates by propagating local isChecked changes back to the group's checkedValues. This pattern prevents infinite loops while maintaining proper synchronization.

Learnt from: decipher-cs
PR: #417
File: src/components/ui/Dropdown/Dropdown.stories.tsx:43-50
Timestamp: 2024-12-12T08:34:33.079Z
Learning: Ensure to verify existing ARIA attributes in components before suggesting additions during code reviews, especially in the Dropdown.Trigger component in src/components/ui/Dropdown/Dropdown.stories.tsx.

Learnt from: kotAPI
PR: #576
File: src/core/primitives/Toggle/index.tsx:15-22
Timestamp: 2024-11-24T06:43:42.194Z
Learning: In the TogglePrimitive component (src/core/primitives/Toggle/index.tsx), when the component becomes controlled, it's acceptable to not sync the internal isPressed state with the external pressed prop.

src/components/ui/Tree/fragments/TreeItem.tsx (3)

Learnt from: GoldGroove06
PR: #1215
File: src/core/primitives/CheckboxGroup/fragments/CheckboxGroupPrimitiveTrigger.tsx:25-27
Timestamp: 2025-07-18T16:43:26.143Z
Learning: In the CheckboxGroupPrimitiveTrigger component (src/core/primitives/CheckboxGroup/fragments/CheckboxGroupPrimitiveTrigger.tsx), the component uses two separate useEffect hooks with different purposes: the first useEffect (lines 25-27) with empty dependency array [] is meant to set the initial state only once on mount by syncing with the group's checked values, while the second useEffect (lines 28-34) handles ongoing state updates by propagating local isChecked changes back to the group's checkedValues. This pattern prevents infinite loops while maintaining proper synchronization.

Learnt from: decipher-cs
PR: #417
File: src/components/ui/Dropdown/Dropdown.stories.tsx:43-50
Timestamp: 2024-12-12T08:34:33.079Z
Learning: Ensure to verify existing ARIA attributes in components before suggesting additions during code reviews, especially in the Dropdown.Trigger component in src/components/ui/Dropdown/Dropdown.stories.tsx.

Learnt from: kotAPI
PR: #576
File: src/core/primitives/Toggle/index.tsx:15-22
Timestamp: 2024-11-24T06:43:42.194Z
Learning: In the TogglePrimitive component (src/core/primitives/Toggle/index.tsx), when the component becomes controlled, it's acceptable to not sync the internal isPressed state with the external pressed prop.

src/core/primitives/Select/fragments/SelectPrimitiveContent.tsx (2)

Learnt from: GoldGroove06
PR: #1215
File: src/core/primitives/CheckboxGroup/fragments/CheckboxGroupPrimitiveTrigger.tsx:25-27
Timestamp: 2025-07-18T16:43:26.143Z
Learning: In the CheckboxGroupPrimitiveTrigger component (src/core/primitives/CheckboxGroup/fragments/CheckboxGroupPrimitiveTrigger.tsx), the component uses two separate useEffect hooks with different purposes: the first useEffect (lines 25-27) with empty dependency array [] is meant to set the initial state only once on mount by syncing with the group's checked values, while the second useEffect (lines 28-34) handles ongoing state updates by propagating local isChecked changes back to the group's checkedValues. This pattern prevents infinite loops while maintaining proper synchronization.

Learnt from: kotAPI
PR: #576
File: src/core/primitives/Toggle/index.tsx:15-22
Timestamp: 2024-11-24T06:43:42.194Z
Learning: In the TogglePrimitive component (src/core/primitives/Toggle/index.tsx), when the component becomes controlled, it's acceptable to not sync the internal isPressed state with the external pressed prop.

src/components/ui/Switch/fragments/SwitchThumb.tsx (3)

Learnt from: kotAPI
PR: #576
File: src/core/primitives/Toggle/index.tsx:15-22
Timestamp: 2024-11-24T06:43:42.194Z
Learning: In the TogglePrimitive component (src/core/primitives/Toggle/index.tsx), when the component becomes controlled, it's acceptable to not sync the internal isPressed state with the external pressed prop.

Learnt from: GoldGroove06
PR: #1215
File: src/core/primitives/CheckboxGroup/fragments/CheckboxGroupPrimitiveTrigger.tsx:25-27
Timestamp: 2025-07-18T16:43:26.143Z
Learning: In the CheckboxGroupPrimitiveTrigger component (src/core/primitives/CheckboxGroup/fragments/CheckboxGroupPrimitiveTrigger.tsx), the component uses two separate useEffect hooks with different purposes: the first useEffect (lines 25-27) with empty dependency array [] is meant to set the initial state only once on mount by syncing with the group's checked values, while the second useEffect (lines 28-34) handles ongoing state updates by propagating local isChecked changes back to the group's checkedValues. This pattern prevents infinite loops while maintaining proper synchronization.

Learnt from: decipher-cs
PR: #417
File: src/components/ui/Dropdown/Dropdown.stories.tsx:43-50
Timestamp: 2024-12-12T08:34:33.079Z
Learning: Ensure to verify existing ARIA attributes in components before suggesting additions during code reviews, especially in the Dropdown.Trigger component in src/components/ui/Dropdown/Dropdown.stories.tsx.

src/components/ui/Tooltip/fragments/TooltipTrigger.tsx (4)

Learnt from: decipher-cs
PR: #417
File: src/components/ui/Dropdown/Dropdown.stories.tsx:43-50
Timestamp: 2024-12-12T08:34:33.079Z
Learning: Ensure to verify existing ARIA attributes in components before suggesting additions during code reviews, especially in the Dropdown.Trigger component in src/components/ui/Dropdown/Dropdown.stories.tsx.

Learnt from: kotAPI
PR: #576
File: src/core/primitives/Toggle/index.tsx:15-22
Timestamp: 2024-11-24T06:43:42.194Z
Learning: In the TogglePrimitive component (src/core/primitives/Toggle/index.tsx), when the component becomes controlled, it's acceptable to not sync the internal isPressed state with the external pressed prop.

Learnt from: GoldGroove06
PR: #1215
File: src/core/primitives/CheckboxGroup/fragments/CheckboxGroupPrimitiveTrigger.tsx:25-27
Timestamp: 2025-07-18T16:43:26.143Z
Learning: In the CheckboxGroupPrimitiveTrigger component (src/core/primitives/CheckboxGroup/fragments/CheckboxGroupPrimitiveTrigger.tsx), the component uses two separate useEffect hooks with different purposes: the first useEffect (lines 25-27) with empty dependency array [] is meant to set the initial state only once on mount by syncing with the group's checked values, while the second useEffect (lines 28-34) handles ongoing state updates by propagating local isChecked changes back to the group's checkedValues. This pattern prevents infinite loops while maintaining proper synchronization.

Learnt from: decipher-cs
PR: #417
File: src/components/ui/Dropdown/Dropdown.tsx:0-0
Timestamp: 2024-12-12T08:22:59.375Z
Learning: The Dropdown.Trigger component is customizable and needs to be used with Dropdown.Root.

src/core/primitives/Select/fragments/SelectPrimitiveSearch.tsx (2)

Learnt from: kotAPI
PR: #576
File: src/core/primitives/Toggle/index.tsx:15-22
Timestamp: 2024-11-24T06:43:42.194Z
Learning: In the TogglePrimitive component (src/core/primitives/Toggle/index.tsx), when the component becomes controlled, it's acceptable to not sync the internal isPressed state with the external pressed prop.

Learnt from: GoldGroove06
PR: #1215
File: src/core/primitives/CheckboxGroup/fragments/CheckboxGroupPrimitiveTrigger.tsx:25-27
Timestamp: 2025-07-18T16:43:26.143Z
Learning: In the CheckboxGroupPrimitiveTrigger component (src/core/primitives/CheckboxGroup/fragments/CheckboxGroupPrimitiveTrigger.tsx), the component uses two separate useEffect hooks with different purposes: the first useEffect (lines 25-27) with empty dependency array [] is meant to set the initial state only once on mount by syncing with the group's checked values, while the second useEffect (lines 28-34) handles ongoing state updates by propagating local isChecked changes back to the group's checkedValues. This pattern prevents infinite loops while maintaining proper synchronization.

🧬 Code Graph Analysis (5)
src/core/primitives/Avatar/fragments/AvatarPrimitiveFallback.tsx (1)
src/core/primitives/Avatar/contexts/AvatarPrimitiveContext.tsx (1)
  • AvatarPrimitiveContext (10-10)
src/core/primitives/Select/fragments/SelectPrimitiveContent.tsx (1)
src/core/primitives/Select/contexts/SelectPrimitiveContext.tsx (1)
  • SelectPrimitiveContext (26-26)
src/components/ui/Switch/fragments/SwitchThumb.tsx (1)
src/components/ui/Switch/context/SwitchContext.tsx (1)
  • SwitchContext (9-13)
src/core/primitives/Select/fragments/SelectPrimitiveSearch.tsx (1)
src/core/primitives/Select/contexts/SelectPrimitiveContext.tsx (1)
  • SelectPrimitiveContext (26-26)
src/components/ui/Slider/fragments/SliderTrack.tsx (1)
src/components/ui/Slider/context/SliderContext.tsx (1)
  • SliderContext (13-21)
⏰ 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). (1)
  • GitHub Check: build
🔇 Additional comments (18)
src/core/primitives/CheckboxGroup/fragments/CheckboxGroupPrimitiveRoot.tsx (1)

26-26: Whitespace cleanup only – LGTM

No functional impact; aligns with eslint clean-up objectives.

src/core/primitives/Avatar/fragments/AvatarPrimitiveFallback.tsx (1)

12-14: Unused context value removed – LGTM

The removal of hasError from the destructuring cleanly eliminates an unused variable, silencing the eslint warning without affecting runtime behavior.

src/core/primitives/Collapsible/contexts/CollapsiblePrimitiveContext.tsx (1)

1-1: Import clean-up aligns with the repo’s eslint rules – looks good
Removing the default React import eliminates an unused symbol and matches the react/jsx-runtime setup the rest of the codebase uses.

src/core/utils/RovingFocusGroup/fragments/RovingFocusItem.tsx (1)

1-1: Unused useRef import successfully removed

The import list now reflects the actual hooks used in this file, eliminating a previously-reported eslint no-unused-vars error.

src/components/ui/Slider/fragments/SliderThumb.tsx (1)

3-3: Import cleanup looks good

Removing the unused named import keeps the module eslint-clean without impacting functionality.

src/components/ui/Tree/fragments/TreeItem.tsx (1)

1-1: Unused hook removed — import list now accurate

No further action required.

src/core/primitives/Select/fragments/SelectPrimitiveRoot.tsx (1)

2-2: Removed unused useEffect import – good cleanup

This resolves an eslint warning without altering behavior.

src/components/ui/Accordion/fragments/AccordionRoot.tsx (1)

2-2: Unused useState import removed – eslint error resolved

Import list now mirrors actual usage.

src/components/ui/Link/Link.tsx (1)

5-5: Unused hook successfully removed.
Import list is now minimal and eslint-clean.

src/core/primitives/RadioGroup/fragments/RadioGroupPrimitiveRoot.tsx (1)

1-1: Good cleanup.
Removing the unused useState keeps imports lean.

src/components/ui/Tooltip/fragments/TooltipTrigger.tsx (1)

14-15: Confirm no other components rely on the removed context fields.
setIsOpen & data were dropped from destructuring. If sibling components still expect them, you’ll get runtime errors. Quick grep recommended before merge.

src/components/ui/Select/fragments/SelectContent.tsx (1)

2-2: Good cleanup

Import list now matches actual usage – keeps bundle lean.

src/components/ui/AvatarGroup/fragments/AvatarGroupItem.tsx (1)

8-10: Whitespace only – looks good

src/components/ui/Switch/fragments/SwitchRoot.tsx (1)

19-19: Minor style change OK

Formatting reads better and keeps eslint happy. No further action.

src/core/primitives/Select/fragments/SelectPrimitiveSearch.tsx (1)

8-9: Removal of unused selectedItemRef is correct

That property is not referenced anywhere in this component, so dropping it cleans up the context pull and avoids eslint-unused-vars noise.

src/components/ui/Slider/fragments/SliderTrack.tsx (1)

6-9: Removal of setValue looks good

setValue was never referenced in this component, so trimming the context destructuring is the correct eslint-driven fix.
No functional impact. 👍

src/core/primitives/Select/fragments/SelectPrimitiveContent.tsx (1)

12-12: Unused imports successfully eliminated

useEffect and Primitive were indeed unused.
Nice clean-up that silences the linter with zero behavioural change.

src/components/ui/Switch/fragments/SwitchThumb.tsx (1)

8-10: Context destructuring trimmed correctly

setChecked isn’t used inside SwitchThumb, so its removal reduces eslint noise without side-effects.
Component behaviour is unchanged.

@kotAPI kotAPI added the automerge A tag that tells kodiak bot to automerge PRs for us when tests and approval conditions are met label Jul 23, 2025
@kodiakhq kodiakhq bot merged commit d24107a into main Jul 23, 2025
7 checks passed
@kodiakhq kodiakhq bot deleted the fix/eslint-warning branch July 23, 2025 12:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

automerge A tag that tells kodiak bot to automerge PRs for us when tests and approval conditions are met

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ESLint Warnings and Code Quality Issues

3 participants