diff --git a/src/renderer/features/sidebar/components/playlist-folder-tree.module.css b/src/renderer/features/sidebar/components/playlist-folder-tree.module.css
index b66a69c38..498f7a522 100644
--- a/src/renderer/features/sidebar/components/playlist-folder-tree.module.css
+++ b/src/renderer/features/sidebar/components/playlist-folder-tree.module.css
@@ -22,7 +22,7 @@
gap: var(--theme-spacing-md);
align-items: center;
width: 100%;
- padding: var(--theme-spacing-xs) var(--theme-spacing-md);
+ padding: var(--theme-spacing-sm) var(--theme-spacing-md);
font: inherit;
color: inherit;
text-align: left;
@@ -32,12 +32,18 @@
border-radius: var(--theme-radius-md);
&:hover {
- background-color: var(--theme-colors-surface);
+ background-color: var(--theme-colors-background);
}
}
.chevron {
+ display: flex;
flex-shrink: 0;
+ align-items: center;
+}
+
+.collapse {
+ overflow: hidden;
}
.name {
diff --git a/src/renderer/features/sidebar/components/playlist-folder-tree.tsx b/src/renderer/features/sidebar/components/playlist-folder-tree.tsx
index 0487af289..b766ecd5c 100644
--- a/src/renderer/features/sidebar/components/playlist-folder-tree.tsx
+++ b/src/renderer/features/sidebar/components/playlist-folder-tree.tsx
@@ -1,9 +1,11 @@
import clsx from 'clsx';
+import { motion } from 'motion/react';
import {
ComponentPropsWithoutRef,
CSSProperties,
MouseEvent,
ReactElement,
+ ReactNode,
useCallback,
useMemo,
useState,
@@ -33,6 +35,25 @@ import { DragData, DragOperation, DragTarget } from '/@/shared/types/drag-and-dr
const STORAGE_KEY_PREFIX = 'feishin:playlist-folder-state';
+const FOLDER_COLLAPSE_TRANSITION = { duration: 0.2, ease: 'easeInOut' } as const;
+
+interface PlaylistFolderCollapseProps {
+ children: ReactNode;
+ className?: string;
+ open: boolean;
+}
+
+const PlaylistFolderCollapse = ({ children, className, open }: PlaylistFolderCollapseProps) => (
+