Skip to content

carousel#74

Merged
Kitenite merged 4 commits intomainfrom
carousel
Nov 12, 2025
Merged

carousel#74
Kitenite merged 4 commits intomainfrom
carousel

Conversation

@Kitenite
Copy link
Copy Markdown
Collaborator

@Kitenite Kitenite commented Nov 12, 2025

  • git diffs (diffs #73)
  • update mode change
  • header
  • scroll

Summary by CodeRabbit

  • New Features

    • Animated indicator and icon-based mode buttons in the sidebar; per-mode headers and a snapping carousel with visible scroll progress for clearer mode navigation.
    • More reliable mode detection and snapping for consistent behavior during and after scroll/drag.
  • Style

    • Smoother animations and refined visual feedback; simplified header layout in single-mode scenarios.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Nov 12, 2025

Walkthrough

Removes ModeSwitcher from the Sidebar and refactors ModeCarousel into a hook-driven, modular carousel with new subcomponents (ModeContent, ModeHeader, ModeNavigation, AnimatedBackground) and hooks (useModeDetection, useScrollProgress, useScrollSnap); introduces types and constants for modes, icons, and labels.

Changes

Cohort / File(s) Summary
Sidebar update
apps/desktop/src/renderer/screens/main/components/Sidebar/Sidebar.tsx
Removes ModeSwitcher import and its JSX; leaves ModeCarousel usage intact.
ModeCarousel core
apps/desktop/src/renderer/screens/main/components/Sidebar/components/ModeCarousel/ModeCarousel.tsx, .../index.ts, .../types.ts, .../constants.ts
Replaces monolithic carousel with modular implementation: new ModeCarousel public signature (from types.ts), conditional single/multi-mode rendering, swaps inline motion logic for hook-driven progress/snap/detection, and moves mode types/constants to types.ts and constants.ts.
Animated indicator
apps/desktop/src/renderer/screens/main/components/Sidebar/components/ModeCarousel/components/AnimatedBackground/AnimatedBackground.tsx, .../index.ts
Adds AnimatedBackground component that maps scroll progress to an animated X offset for an indicator; re-export barrel added.
Navigation & header
apps/desktop/src/renderer/screens/main/components/Sidebar/components/ModeCarousel/components/ModeNavigation/ModeNavigation.tsx, .../index.ts, .../ModeHeader/ModeHeader.tsx, .../ModeHeader/index.ts
Adds ModeNavigation (renders mode buttons, uses AnimatedBackground) and ModeHeader (per-mode label); both exported via index barrels.
Content wrapper
apps/desktop/src/renderer/screens/main/components/Sidebar/components/ModeCarousel/components/ModeContent/ModeContent.tsx, .../index.ts
Adds ModeContent to wrap per-mode content and render a ModeHeader and scrollable container; exported via index.
Hooks: progress, snap, detection
apps/desktop/src/renderer/screens/main/components/Sidebar/components/ModeCarousel/hooks/useScrollProgress.ts, useScrollSnap.ts, useModeDetection.ts
Adds useScrollProgress (produces MotionValue progress from container scroll), useScrollSnap (snap-to-index scrolling respecting initial mount), and useModeDetection (debounced snap-to-nearest and invokes onModeSelect, respects dragging).

Sequence Diagram(s)

sequenceDiagram
    autonumber
    participant User
    participant ModeCarousel
    participant ScrollContainer
    participant Hooks as useScrollProgress / useModeDetection / useScrollSnap
    participant ModeNavigation
    participant AnimatedBackground
    participant App as onModeSelect

    User->>ScrollContainer: user scrolls (or clicks nav)
    ScrollContainer->>Hooks: scroll event -> useScrollProgress updates progress
    Hooks->>ModeCarousel: progress MotionValue update
    ModeCarousel->>AnimatedBackground: pass progress
    AnimatedBackground->>AnimatedBackground: animate indicator position

    Note over Hooks,ModeCarousel: When scroll settles (debounced)
    Hooks->>Hooks: compute nearestIndex (useModeDetection)
    Hooks->>ModeCarousel: notify nearestIndex
    ModeCarousel->>Hooks: useScrollSnap(scroll to nearestIndex)
    ModeCarousel->>App: call onModeSelect(newMode)

    ModeNavigation->>ModeCarousel: button click -> request mode change
    ModeCarousel->>Hooks: set index -> useScrollSnap -> scroll container
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~45 minutes

  • Pay special attention to:
    • useModeDetection debounce, drag handling, and cleanup logic
    • useScrollProgress MotionValue lifetime and onScrollProgress callback usage
    • useScrollSnap initial mount vs subsequent smooth scrolling behavior
    • Integration between ModeNavigation clicks and scroll snapping (race conditions)
    • Styling/classname changes and DOM structure differences impacting layout or accessibility

Poem

🐇
Soft hops, a carousel anew,
I nudge the marker into view,
Switcher gone, the modes align,
Animated trail, a tiny sign,
I clap my paws — smooth scrolls, hooray!

Pre-merge checks and finishing touches

❌ Failed checks (2 warnings, 1 inconclusive)
Check name Status Explanation Resolution
Description check ⚠️ Warning The description is incomplete and lacks required sections such as a clear description of changes, related issues, type of change, testing details, and additional context. Expand the description to follow the template: add a clear summary of the refactoring work, specify the type of change, include testing information, and provide context about why these architectural changes were made.
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
Title check ❓ Inconclusive The title 'carousel' is extremely vague and generic, providing no meaningful information about the actual changes made to the codebase. Replace with a more descriptive title that captures the main change, such as 'Refactor ModeCarousel component with modular hooks and subcomponents' or 'Extract ModeSwitcher and restructure ModeCarousel architecture'.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch carousel

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown
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: 1

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between b5dd784 and 647cf40.

📒 Files selected for processing (2)
  • apps/desktop/src/renderer/screens/main/components/Sidebar/Sidebar.tsx (0 hunks)
  • apps/desktop/src/renderer/screens/main/components/Sidebar/components/ModeCarousel/ModeCarousel.tsx (4 hunks)
💤 Files with no reviewable changes (1)
  • apps/desktop/src/renderer/screens/main/components/Sidebar/Sidebar.tsx

Comment on lines +274 to +285
<Button
key={mode}
variant="ghost"
size="sm"
onClick={() => onModeSelect(mode)}
className={`relative z-10 h-9 w-9 rounded-lg transition-colors duration-200 ${isActive
? "text-neutral-100"
: "text-neutral-400 hover:text-neutral-300"
}`}
>
<Icon className="w-4 h-4" />
</Button>
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

Add accessible names and state to nav buttons.

These icon-only buttons expose no discernible label or pressed state, so assistive tech users just hear “button” with no context and can’t tell which mode is active. Please add an accessible name and pressed state so screen-reader and keyboard users can operate the carousel reliably.

Apply this diff to fix the issue:

 							<Button
 								key={mode}
 								variant="ghost"
 								size="sm"
 								onClick={() => onModeSelect(mode)}
+								aria-label={modeLabels[mode]}
+								aria-pressed={isActive}
 								className={`relative z-10 h-9 w-9 rounded-lg transition-colors duration-200 ${isActive
 									? "text-neutral-100"
 									: "text-neutral-400 hover:text-neutral-300"
 									}`}

Committable suggestion skipped: line range outside the PR's diff.

🤖 Prompt for AI Agents
In
apps/desktop/src/renderer/screens/main/components/Sidebar/components/ModeCarousel/ModeCarousel.tsx
around lines 274 to 285, the icon-only buttons lack accessible names and state;
add an accessible name and expose pressed state by setting an aria-label (e.g.,
`aria-label={mode}` or a more descriptive string like `Switch to ${mode} mode`)
and adding `aria-pressed={isActive}` so assistive tech announces which mode is
active; keep the existing onClick and visual styles, but ensure the active state
is reflected in both `aria-pressed` and the visual styling.

Copy link
Copy Markdown
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: 3

♻️ Duplicate comments (1)
apps/desktop/src/renderer/screens/main/components/Sidebar/components/ModeCarousel/components/ModeNavigation/ModeNavigation.tsx (1)

30-43: Add accessible names and state to nav buttons.

Icon-only buttons lack accessible labels and pressed state, preventing assistive technology users from understanding button purpose and active mode. The modeLabels constant should be imported and used for aria-label, and aria-pressed should reflect active state.

Apply this diff to fix the issue:

+import { modeLabels } from "../../constants";
+
 // ... existing imports ...

 						<Button
 							key={mode}
 							variant="ghost"
 							size="sm"
 							onClick={() => onModeSelect(mode)}
+							aria-label={modeLabels[mode]}
+							aria-pressed={isActive}
 							className={`relative z-10 h-9 w-9 rounded-lg transition-colors duration-200 ${
 								isActive
 									? "text-neutral-100"
 									: "text-neutral-400 hover:text-neutral-300"
 							}`}
 						>
🧹 Nitpick comments (3)
apps/desktop/src/renderer/screens/main/components/Sidebar/components/ModeCarousel/hooks/useScrollSnap.ts (1)

22-22: Consider documenting the 5px threshold.

The 5-pixel tolerance prevents unnecessary scroll adjustments, but the specific value isn't explained. Adding a comment would help future maintainers understand why this threshold was chosen.

+		// Use 5px tolerance to avoid micro-adjustments and scroll loops
 		if (Math.abs(scrollContainer.scrollLeft - targetScrollX) > 5) {
apps/desktop/src/renderer/screens/main/components/Sidebar/components/ModeCarousel/components/AnimatedBackground/AnimatedBackground.tsx (1)

12-15: Extract hardcoded dimensions to shared constants.

The hardcoded buttonWidth (36px) and gap (4px) values are duplicated from Tailwind classes and could drift if the styles change. Consider extracting these to the constants.ts file alongside modeIcons and modeLabels for better maintainability.

apps/desktop/src/renderer/screens/main/components/Sidebar/components/ModeCarousel/ModeCarousel.tsx (1)

72-81: Consider extracting inline styles to a constant.

The large inline style object could be extracted to a constant (e.g., CAROUSEL_SCROLL_STYLES) for better readability and potential reuse. However, this is a minor optimization.

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 647cf40 and 86e04f1.

📒 Files selected for processing (15)
  • apps/desktop/src/renderer/screens/main/components/Sidebar/components/ModeCarousel/ModeCarousel.tsx (2 hunks)
  • apps/desktop/src/renderer/screens/main/components/Sidebar/components/ModeCarousel/components/AnimatedBackground/AnimatedBackground.tsx (1 hunks)
  • apps/desktop/src/renderer/screens/main/components/Sidebar/components/ModeCarousel/components/AnimatedBackground/index.ts (1 hunks)
  • apps/desktop/src/renderer/screens/main/components/Sidebar/components/ModeCarousel/components/ModeContent/ModeContent.tsx (1 hunks)
  • apps/desktop/src/renderer/screens/main/components/Sidebar/components/ModeCarousel/components/ModeContent/index.ts (1 hunks)
  • apps/desktop/src/renderer/screens/main/components/Sidebar/components/ModeCarousel/components/ModeHeader/ModeHeader.tsx (1 hunks)
  • apps/desktop/src/renderer/screens/main/components/Sidebar/components/ModeCarousel/components/ModeHeader/index.ts (1 hunks)
  • apps/desktop/src/renderer/screens/main/components/Sidebar/components/ModeCarousel/components/ModeNavigation/ModeNavigation.tsx (1 hunks)
  • apps/desktop/src/renderer/screens/main/components/Sidebar/components/ModeCarousel/components/ModeNavigation/index.ts (1 hunks)
  • apps/desktop/src/renderer/screens/main/components/Sidebar/components/ModeCarousel/constants.ts (1 hunks)
  • apps/desktop/src/renderer/screens/main/components/Sidebar/components/ModeCarousel/hooks/useModeDetection.ts (1 hunks)
  • apps/desktop/src/renderer/screens/main/components/Sidebar/components/ModeCarousel/hooks/useScrollProgress.ts (1 hunks)
  • apps/desktop/src/renderer/screens/main/components/Sidebar/components/ModeCarousel/hooks/useScrollSnap.ts (1 hunks)
  • apps/desktop/src/renderer/screens/main/components/Sidebar/components/ModeCarousel/index.ts (1 hunks)
  • apps/desktop/src/renderer/screens/main/components/Sidebar/components/ModeCarousel/types.ts (1 hunks)
✅ Files skipped from review due to trivial changes (1)
  • apps/desktop/src/renderer/screens/main/components/Sidebar/components/ModeCarousel/components/ModeContent/index.ts
🧰 Additional context used
🧬 Code graph analysis (8)
apps/desktop/src/renderer/screens/main/components/Sidebar/components/ModeCarousel/types.ts (1)
apps/desktop/src/renderer/screens/main/components/Sidebar/components/ModeCarousel/index.ts (2)
  • SidebarMode (2-2)
  • ModeCarouselProps (2-2)
apps/desktop/src/renderer/screens/main/components/Sidebar/components/ModeCarousel/components/ModeNavigation/ModeNavigation.tsx (3)
apps/desktop/src/renderer/screens/main/components/Sidebar/components/ModeCarousel/types.ts (1)
  • SidebarMode (3-3)
apps/desktop/src/renderer/screens/main/components/Sidebar/components/ModeCarousel/components/AnimatedBackground/AnimatedBackground.tsx (1)
  • AnimatedBackground (8-40)
apps/desktop/src/renderer/screens/main/components/Sidebar/components/ModeCarousel/constants.ts (1)
  • modeIcons (4-7)
apps/desktop/src/renderer/screens/main/components/Sidebar/components/ModeCarousel/constants.ts (1)
apps/desktop/src/renderer/screens/main/components/Sidebar/components/ModeCarousel/types.ts (1)
  • SidebarMode (3-3)
apps/desktop/src/renderer/screens/main/components/Sidebar/components/ModeCarousel/components/ModeHeader/ModeHeader.tsx (2)
apps/desktop/src/renderer/screens/main/components/Sidebar/components/ModeCarousel/types.ts (1)
  • SidebarMode (3-3)
apps/desktop/src/renderer/screens/main/components/Sidebar/components/ModeCarousel/constants.ts (1)
  • modeLabels (9-12)
apps/desktop/src/renderer/screens/main/components/Sidebar/components/ModeCarousel/hooks/useModeDetection.ts (1)
apps/desktop/src/renderer/screens/main/components/Sidebar/components/ModeCarousel/types.ts (1)
  • SidebarMode (3-3)
apps/desktop/src/renderer/screens/main/components/Sidebar/components/ModeCarousel/components/AnimatedBackground/AnimatedBackground.tsx (1)
apps/desktop/src/renderer/screens/main/components/Sidebar/components/ModeCarousel/components/AnimatedBackground/index.ts (1)
  • AnimatedBackground (1-1)
apps/desktop/src/renderer/screens/main/components/Sidebar/components/ModeCarousel/components/ModeContent/ModeContent.tsx (2)
apps/desktop/src/renderer/screens/main/components/Sidebar/components/ModeCarousel/types.ts (1)
  • SidebarMode (3-3)
apps/desktop/src/renderer/screens/main/components/Sidebar/components/ModeCarousel/components/ModeHeader/ModeHeader.tsx (1)
  • ModeHeader (8-16)
apps/desktop/src/renderer/screens/main/components/Sidebar/components/ModeCarousel/ModeCarousel.tsx (6)
apps/desktop/src/renderer/screens/main/components/Sidebar/components/ModeCarousel/hooks/useScrollProgress.ts (1)
  • useScrollProgress (10-58)
apps/desktop/src/renderer/screens/main/components/Sidebar/components/ModeCarousel/hooks/useScrollSnap.ts (1)
  • useScrollSnap (10-32)
apps/desktop/src/renderer/screens/main/components/Sidebar/components/ModeCarousel/hooks/useModeDetection.ts (1)
  • useModeDetection (12-70)
apps/desktop/src/renderer/screens/main/components/Sidebar/components/ModeCarousel/components/ModeHeader/ModeHeader.tsx (1)
  • ModeHeader (8-16)
apps/desktop/src/renderer/screens/main/components/Sidebar/components/ModeCarousel/components/ModeContent/ModeContent.tsx (1)
  • ModeContent (11-24)
apps/desktop/src/renderer/screens/main/components/Sidebar/components/ModeCarousel/components/ModeNavigation/ModeNavigation.tsx (1)
  • ModeNavigation (14-48)
🪛 GitHub Actions: CI
apps/desktop/src/renderer/screens/main/components/Sidebar/components/ModeCarousel/types.ts

[error] 1-1: TS2305: Module '"react"' has no exported member 'MotionValue'.

🔇 Additional comments (13)
apps/desktop/src/renderer/screens/main/components/Sidebar/components/ModeCarousel/components/ModeHeader/index.ts (1)

1-1: LGTM!

Standard barrel export pattern for the ModeHeader component.

apps/desktop/src/renderer/screens/main/components/Sidebar/components/ModeCarousel/components/ModeNavigation/index.ts (1)

1-1: LGTM!

Standard barrel export pattern for the ModeNavigation component.

apps/desktop/src/renderer/screens/main/components/Sidebar/components/ModeCarousel/components/AnimatedBackground/index.ts (1)

1-1: LGTM!

Standard barrel export pattern for the AnimatedBackground component.

apps/desktop/src/renderer/screens/main/components/Sidebar/components/ModeCarousel/components/ModeHeader/ModeHeader.tsx (1)

1-16: LGTM!

Clean, straightforward presentational component that renders the mode label with proper typing and styling.

apps/desktop/src/renderer/screens/main/components/Sidebar/components/ModeCarousel/constants.ts (1)

1-12: LGTM!

Well-typed constant mappings for mode icons and labels. The Record<SidebarMode, typeof LayoutList> type ensures all modes have corresponding icons and maintains type safety across the lucide-react icon set.

apps/desktop/src/renderer/screens/main/components/Sidebar/components/ModeCarousel/index.ts (1)

1-2: LGTM!

Clean barrel export structure that properly separates component and type exports.

apps/desktop/src/renderer/screens/main/components/Sidebar/components/ModeCarousel/ModeCarousel.tsx (2)

31-52: LGTM! Clean hook composition.

The hook-driven architecture cleanly separates concerns (progress tracking, snapping, mode detection) and makes the component logic easy to follow.


94-99: Remove unused isActive prop.

The isActive prop is passed to ModeContent but the component definition (visible in the code snippets) doesn't accept or use this prop. This creates confusion and should be removed.

Apply this diff:

 						<ModeContent
 							mode={mode}
-							isActive={mode === currentMode}
 						>

Likely an incorrect or invalid review comment.

apps/desktop/src/renderer/screens/main/components/Sidebar/components/ModeCarousel/components/ModeNavigation/ModeNavigation.tsx (1)

26-26: Remove this review comment—the code is already type-safe.

The TypeScript type Record<SidebarMode, typeof LayoutList> enforces exhaustiveness at compile time. If a new mode is added to SidebarMode without a corresponding entry in modeIcons, TypeScript will fail to compile. The code at line 26 is runtime-safe by design and requires no changes.

Likely an incorrect or invalid review comment.

apps/desktop/src/renderer/screens/main/components/Sidebar/components/ModeCarousel/hooks/useModeDetection.ts (1)

69-69: Callback is already stable; no issue exists.

The onModeSelect prop passed to ModeCarousel is setCurrentMode from useState, which is a stable reference across all re-renders. React's state setter functions maintain their identity and don't cause effect churn. The effect dependency array will not trigger unnecessary reattachments, so no performance concern exists.

Likely an incorrect or invalid review comment.

apps/desktop/src/renderer/screens/main/components/Sidebar/components/ModeCarousel/hooks/useScrollProgress.ts (1)

53-55: The code is correct; onScrollProgress is already stable.

The parent component (Sidebar.tsx) passes setScrollProgress, which is a React state setter from useState(). React guarantees that state setters are stable references across renders and never change, so the effect dependency on onScrollProgress is appropriate and causes no performance issues.

Likely an incorrect or invalid review comment.

apps/desktop/src/renderer/screens/main/components/Sidebar/components/ModeCarousel/components/ModeContent/ModeContent.tsx (2)

1-3: LGTM!

The imports are correctly structured with proper type imports for better tree-shaking.


11-24: Clean component structure.

The component implementation is well-structured with proper composition of ModeHeader and children. The use of inline styles for scrollSnapAlign and scrollSnapStop (lines 16-17) is reasonable since Tailwind doesn't provide built-in utilities for these CSS properties.

Comment on lines +17 to +18
// Transform progress (0-1) to translateX position
// For 2 modes: 0 -> 0px, 1 -> 40px (buttonWidth + gap)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

Clarify the progress input range in the comment.

The comment states "Transform progress (0-1)" but the actual input range is [0, modeCount - 1] (e.g., 0-1 for 2 modes, 0-2 for 3 modes), not a normalized 0-1 range.

Apply this diff:

-	// Transform progress (0-1) to translateX position
-	// For 2 modes: 0 -> 0px, 1 -> 40px (buttonWidth + gap)
+	// Transform progress (0 to modeCount-1) to translateX position
+	// For 2 modes: progress 0 -> 0px, progress 1 -> 40px (buttonWidth + gap)
📝 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
// Transform progress (0-1) to translateX position
// For 2 modes: 0 -> 0px, 1 -> 40px (buttonWidth + gap)
// Transform progress (0 to modeCount-1) to translateX position
// For 2 modes: progress 0 -> 0px, progress 1 -> 40px (buttonWidth + gap)
🤖 Prompt for AI Agents
In
apps/desktop/src/renderer/screens/main/components/Sidebar/components/ModeCarousel/components/AnimatedBackground/AnimatedBackground.tsx
around lines 17 to 18, the inline comment incorrectly says "Transform progress
(0-1)" even though progress actually ranges from 0 to modeCount - 1 (e.g., 0-1
for 2 modes, 0-2 for 3 modes); update the comment to clearly state the expected
input range is [0, modeCount - 1] and give the concrete mapping (e.g., 0 -> 0px,
modeCount - 1 -> (modeCount - 1) * (buttonWidth + gap)) so readers understand it
is not a normalized 0–1 value.

Comment on lines +5 to +9
interface ModeContentProps {
mode: SidebarMode;
isActive: boolean;
children: ReactNode;
}
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

Unused isActive prop in interface.

The isActive prop is declared in the interface but never destructured or used in the component implementation (line 11). This could indicate incomplete implementation or dead code.

Consider either:

  • Removing the prop if it's not needed
  • Using it for conditional styling or behavior (e.g., to apply active state classes)

If isActive should be used for conditional rendering or styling, I can help implement that logic. Would you like me to suggest an implementation?

🤖 Prompt for AI Agents
In
apps/desktop/src/renderer/screens/main/components/Sidebar/components/ModeCarousel/components/ModeContent/ModeContent.tsx
around lines 5 to 9, the interface declares an isActive prop that is never
consumed by the component; remove dead code by deleting isActive from
ModeContentProps (and any callers) OR use it by destructuring isActive in the
component signature and applying it to the rendered element for conditional
styling/behavior (e.g., add an "active" className, toggle styles, or set
aria-current/aria-pressed for accessibility) so the prop has an effect.

@@ -0,0 +1,13 @@
import type { MotionValue, ReactNode } from "react";
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🔴 Critical

Fix the incorrect import source for MotionValue.

The pipeline failure indicates that MotionValue is being imported from "react", but it doesn't exist there. MotionValue is a type from the framer-motion library.

Apply this diff to fix the import:

-import type { MotionValue, ReactNode } from "react";
+import type { ReactNode } from "react";
+import type { MotionValue } from "framer-motion";
📝 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
import type { MotionValue, ReactNode } from "react";
import type { ReactNode } from "react";
import type { MotionValue } from "framer-motion";
🧰 Tools
🪛 GitHub Actions: CI

[error] 1-1: TS2305: Module '"react"' has no exported member 'MotionValue'.

🤖 Prompt for AI Agents
In
apps/desktop/src/renderer/screens/main/components/Sidebar/components/ModeCarousel/types.ts
around line 1, the type MotionValue is incorrectly imported from "react"; update
the import so MotionValue is imported from "framer-motion" and ReactNode remains
imported from "react" (i.e., replace the single import with proper imports:
MotionValue from "framer-motion" and ReactNode from "react").

@Kitenite Kitenite merged commit 41db620 into main Nov 12, 2025
2 of 5 checks passed
@Kitenite Kitenite deleted the carousel branch November 12, 2025 19:22
@Kitenite Kitenite mentioned this pull request Nov 12, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant