Skip to content

Commit 5696be7

Browse files
committed
fix redundant code, broken stuff, migrate to tw v4 ✅
1 parent 8e525b5 commit 5696be7

30 files changed

+177
-960
lines changed

bun.lockb

-322 Bytes
Binary file not shown.

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@
3131
"@radix-ui/react-tabs": "^1.1.12",
3232
"@radix-ui/react-tooltip": "^1.2.7",
3333
"@tabler/icons-react": "^3.34.0",
34+
"@tailwindcss/postcss": "^4.1.10",
3435
"@types/better-sqlite3": "^7.6.13",
3536
"@types/crypto-js": "^4.2.2",
3637
"@xhayper/discord-rpc": "^1.2.2",
@@ -55,7 +56,6 @@
5556
"react-window": "^1.8.11",
5657
"seamless-scroll-polyfill": "^2.3.4",
5758
"sonner": "^2.0.5",
58-
"tailwind-gradient-mask-image": "^1.2.0",
5959
"tailwind-merge": "^3.3.1",
6060
"tailwindcss-animate": "^1.0.7",
6161
"zod": "^3.25.67"
@@ -77,7 +77,7 @@
7777
"react": "^19.1.0",
7878
"react-dom": "^19.1.0",
7979
"rebuild": "^0.1.2",
80-
"tailwindcss": "^3.4.17",
80+
"tailwindcss": "^4.1.10",
8181
"typescript": "^5.8.3"
8282
},
8383
"packageManager": "yarn@1.22.22+sha512.a6b2f7906b721bba3d67d4aff083df04dad64c399707841b7acf00f6b133b7ac24255f2652fa22ae3534329dc6180534e98d17432037ff6fd140556e2bb3137e"

renderer/components/main/lyrics.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,11 +37,11 @@ const Lyrics: React.FC<LyricsProps> = React.memo(
3737

3838
return (
3939
<div className="wora-border relative h-full w-full rounded-2xl bg-white/70 backdrop-blur-xl dark:bg-black/70">
40-
<div className="absolute bottom-5 right-6 z-50 flex items-center gap-2">
40+
<div className="absolute right-6 bottom-5 z-50 flex items-center gap-2">
4141
<Badge>{isSyncedLyrics ? "Synced" : "Unsynced"}</Badge>
4242
</div>
4343

44-
<div className="h-utility flex w-full items-center overflow-y-auto text-balance px-8 text-2xl font-medium gradient-mask-b-70-d">
44+
<div className="h-utility mask flex w-full items-center overflow-y-auto mask-y-from-70% px-8 text-2xl font-medium text-balance">
4545
<div
4646
ref={lyricsRef}
4747
className="no-scrollbar h-full w-full py-[33vh]"

renderer/components/main/navbar.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -229,7 +229,7 @@ const Navbar = () => {
229229
<p>{settings && settings.name ? settings.name : "Wora User"}</p>
230230
</TooltipContent>
231231
</Tooltip>
232-
<div className="wora-border flex w-[4.5rem] flex-col items-center gap-10 rounded-2xl p-8">
232+
<div className="wora-border flex w-18 flex-col items-center gap-10 rounded-2xl p-8">
233233
{navLinks.map((link) => (
234234
<Tooltip key={link.href} delayDuration={0}>
235235
<TooltipTrigger>
@@ -298,7 +298,7 @@ const Navbar = () => {
298298
onSelect={() => handleItemClick(item)}
299299
className="text-black dark:text-white"
300300
>
301-
<div className="flex h-full w-full items-center gap-2.5 gradient-mask-r-70">
301+
<div className="flex h-full w-full items-center gap-2.5 mask-r-from-70%">
302302
{(item.type === "Playlist" || item.type === "Album") && (
303303
<div className="relative h-12 w-12 overflow-hidden rounded-lg shadow-xl transition duration-300">
304304
<Image
@@ -315,7 +315,7 @@ const Navbar = () => {
315315
</div>
316316
)}
317317
<div>
318-
<p className="w-full overflow-hidden text-nowrap text-xs">
318+
<p className="w-full overflow-hidden text-xs text-nowrap">
319319
{item.name}
320320
<span className="ml-1 opacity-50">({item.type})</span>
321321
</p>
@@ -333,7 +333,7 @@ const Navbar = () => {
333333
</CommandGroup>
334334
) : (
335335
<div className="flex h-[325px] w-full items-center justify-center text-xs">
336-
<div className="dark:bg.white/10 ml-2 rounded-lg bg-black/5 px-1.5 py-1 shadow-sm">
336+
<div className="dark:bg.white/10 ml-2 rounded-lg bg-black/5 px-1.5 py-1 shadow-xs">
337337
⌘ / Ctrl + F
338338
</div>
339339
</div>

renderer/components/main/player.tsx

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -669,7 +669,7 @@ export const Player = () => {
669669
<div className="h-utility w-full max-w-3xl px-6 pt-6">
670670
<Tabs
671671
defaultValue="queue"
672-
className="flex h-full w-full flex-col gap-4 gradient-mask-b-70"
672+
className="flex h-full w-full flex-col gap-4 mask-b-from-70%"
673673
>
674674
<TabsList className="w-full">
675675
<TabsTrigger value="queue" className="w-full gap-2">
@@ -683,7 +683,7 @@ export const Player = () => {
683683
{/* Queue tab content */}
684684
<TabsContent
685685
value="queue"
686-
className="no-scrollbar flex-grow overflow-y-auto pb-64"
686+
className="no-scrollbar grow overflow-y-auto pb-64"
687687
>
688688
<ul className="flex flex-col gap-4">
689689
{queue.slice(currentIndex + 1).map((song) => (
@@ -701,7 +701,7 @@ export const Player = () => {
701701
{/* History tab content */}
702702
<TabsContent
703703
value="history"
704-
className="no-scrollbar flex-grow overflow-y-auto pb-64"
704+
className="no-scrollbar grow overflow-y-auto pb-64"
705705
>
706706
<ul className="flex flex-col gap-4">
707707
{[...history].reverse().map((song) => (
@@ -749,7 +749,7 @@ export const Player = () => {
749749
return (
750750
<div>
751751
{/* Lyrics overlay */}
752-
<div className="absolute right-0 top-0 w-full">
752+
<div className="absolute top-0 right-0 w-full">
753753
{showLyrics && lyrics && (
754754
<Lyrics
755755
lyrics={parseLyrics(lyrics)}
@@ -761,7 +761,7 @@ export const Player = () => {
761761
</div>
762762

763763
{/* Queue panel */}
764-
<div className="!absolute right-0 top-0 w-96">
764+
<div className="!absolute top-0 right-0 w-96">
765765
{showQueue && <QueuePanel />}
766766
</div>
767767

@@ -777,7 +777,7 @@ export const Player = () => {
777777
<Link
778778
href={song.album?.id ? `/albums/${song.album.id}` : "#"}
779779
>
780-
<div className="relative min-h-[4.25rem] min-w-[4.25rem] overflow-hidden rounded-lg shadow-lg transition">
780+
<div className="relative min-h-17 min-w-17 overflow-hidden rounded-lg shadow-lg transition">
781781
<Image
782782
alt="Album Cover"
783783
src={`wora://${song?.album.cover}`}
@@ -818,7 +818,7 @@ export const Player = () => {
818818
</ContextMenuContent>
819819
</ContextMenu>
820820
) : (
821-
<div className="relative min-h-[4.25rem] min-w-[4.25rem] overflow-hidden rounded-lg shadow-lg">
821+
<div className="relative min-h-17 min-w-17 overflow-hidden rounded-lg shadow-lg">
822822
<Image
823823
alt="Album Cover"
824824
src="/coverArt.png"
@@ -854,25 +854,25 @@ export const Player = () => {
854854
</div>
855855

856856
{/* Center - Playback controls */}
857-
<div className="absolute left-0 right-0 mx-auto flex h-full w-2/4 flex-col items-center justify-between gap-4">
857+
<div className="absolute right-0 left-0 mx-auto flex h-full w-2/4 flex-col items-center justify-between gap-4">
858858
{/* Playback buttons */}
859859
<div className="flex h-full w-full items-center justify-center gap-8">
860860
{/* Shuffle button */}
861861
<Button
862862
variant="ghost"
863863
onClick={toggleShuffle}
864-
className="relative !opacity-100"
864+
className="relative opacity-100!"
865865
>
866866
{!shuffle ? (
867867
<IconArrowsShuffle2
868868
stroke={2}
869869
size={16}
870-
className="!opacity-30 hover:!opacity-100"
870+
className="opacity-30! hover:opacity-100!"
871871
/>
872872
) : (
873873
<div>
874874
<IconArrowsShuffle2 stroke={2} size={16} />
875-
<div className="absolute -top-2 left-0 right-0 mx-auto h-[1.5px] w-2/3 rounded-full bg-black dark:bg-white"></div>
875+
<div className="absolute -top-2 right-0 left-0 mx-auto h-[1.5px] w-2/3 rounded-full bg-black dark:bg-white"></div>
876876
</div>
877877
)}
878878
</Button>
@@ -913,18 +913,18 @@ export const Player = () => {
913913
<Button
914914
variant="ghost"
915915
onClick={toggleRepeat}
916-
className="relative !opacity-100"
916+
className="relative opacity-100!"
917917
>
918918
{!repeat ? (
919919
<IconRepeat
920920
stroke={2}
921921
size={15}
922-
className="!opacity-30 hover:!opacity-100"
922+
className="opacity-30! hover:opacity-100!"
923923
/>
924924
) : (
925925
<div>
926926
<IconRepeat stroke={2} size={15} />
927-
<div className="absolute -top-2 left-0 right-0 mx-auto h-[1.5px] w-2/3 rounded-full bg-black dark:bg-white"></div>
927+
<div className="absolute -top-2 right-0 left-0 mx-auto h-[1.5px] w-2/3 rounded-full bg-black dark:bg-white"></div>
928928
</div>
929929
)}
930930
</Button>
@@ -990,7 +990,7 @@ export const Player = () => {
990990
<TooltipTrigger>
991991
<Button
992992
variant="ghost"
993-
className="!opacity-100"
993+
className="opacity-100!"
994994
onClick={() => toggleFavourite(song?.id)}
995995
disabled={!song}
996996
>
@@ -1033,13 +1033,13 @@ export const Player = () => {
10331033
<Button
10341034
variant="ghost"
10351035
onClick={toggleMute}
1036-
className="!opacity-100"
1036+
className="opacity-100!"
10371037
>
10381038
{!isMuted ? (
10391039
<IconVolume
10401040
stroke={2}
10411041
size={17.5}
1042-
className="wora-transition !opacity-30 hover:!opacity-100"
1042+
className="wora-transition opacity-30! hover:opacity-100!"
10431043
/>
10441044
) : (
10451045
<IconVolumeOff

renderer/components/ui/album.tsx

Lines changed: 7 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ type Album = {
88
name: string;
99
artist: string;
1010
cover: string;
11-
duration?: number;
1211
};
1312

1413
type AlbumCardProps = {
@@ -17,42 +16,27 @@ type AlbumCardProps = {
1716

1817
const AlbumCard: React.FC<AlbumCardProps> = ({ album }) => {
1918
return (
20-
<div className="group/album wora-border wora-transition rounded-2xl p-5 hover:bg-black/5 dark:hover:bg-white/10">
21-
<div className="relative flex flex-col justify-between">
22-
<Link href={`/albums/${album.id}`} passHref>
19+
<Link href={`/albums/${album.id}`}>
20+
<div className="group/album wora-border wora-transition rounded-2xl p-5 hover:bg-black/5 dark:hover:bg-white/10">
21+
<div className="relative flex flex-col justify-between">
2322
<div className="relative w-full overflow-hidden rounded-xl pb-[100%] shadow-lg">
2423
<Image
2524
alt={album ? album.name : "Album Cover"}
2625
src={`wora://${album.cover}`}
2726
fill
2827
loading="lazy"
2928
className="z-10 cursor-pointer object-cover"
30-
quality={10}
3129
/>
3230
</div>
33-
</Link>
34-
<div className="mt-8 flex w-full flex-col overflow-clip">
35-
<Link href={`/albums/${album.id}`} passHref>
36-
<p className="cursor-pointer truncate text-sm font-medium">
31+
<div className="mt-8 flex w-full flex-col overflow-clip">
32+
<p className="cursor-pointer mask-r-from-70% text-sm font-medium text-nowrap">
3733
{album.name}
3834
</p>
39-
</Link>
40-
<div className="flex items-center justify-between">
41-
<Link
42-
href={`/artists/${encodeURIComponent(album.artist)}`}
43-
passHref
44-
>
45-
<p className="text-primary mr-2 cursor-pointer truncate opacity-50 hover:underline">
46-
{album.artist}
47-
</p>
48-
</Link>
49-
<span className="shrink-0 text-xs opacity-50">
50-
{album.duration ? convertTime(album.duration) : "--:--"}
51-
</span>
35+
<p className="mr-2 truncate opacity-50">{album.artist}</p>
5236
</div>
5337
</div>
5438
</div>
55-
</div>
39+
</Link>
5640
);
5741
};
5842

renderer/components/ui/badge.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ const badgeVariants = cva(
1212
secondary:
1313
"border-transparent bg-neutral-100 text-neutral-900 hover:bg-neutral-100/80 dark:bg-neutral-800 dark:text-neutral-50 dark:hover:bg-neutral-800/80",
1414
destructive:
15-
"border-transparent bg-red-500 text-neutral-50 shadow hover:bg-red-500/80 dark:bg-red-900 dark:text-neutral-50 dark:hover:bg-red-900/80",
15+
"border-transparent bg-red-500 text-neutral-50 shadow-sm hover:bg-red-500/80 dark:bg-red-900 dark:text-neutral-50 dark:hover:bg-red-900/80",
1616
outline: "text-neutral-950 dark:text-neutral-50",
1717
},
1818
},

renderer/components/ui/button.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ const buttonVariants = cva(
1212
default: "bg-white/70 dark:bg-black/30 hover:scale-95 wora-border",
1313
destructive: "bg-red-500/10 hover:scale-95 border border-red-500/15",
1414
outline:
15-
"border border-neutral-200 bg-white shadow-sm hover:bg-neutral-100 hover:text-neutral-900 dark:border-neutral-800 dark:bg-neutral-950 dark:hover:bg-neutral-800 dark:hover:text-neutral-50",
15+
"border border-neutral-200 bg-white shadow-xs hover:bg-neutral-100 hover:text-neutral-900 dark:border-neutral-800 dark:bg-neutral-950 dark:hover:bg-neutral-800 dark:hover:text-neutral-50",
1616
ghost: "wora-transition opacity-30 hover:opacity-100 p-0",
1717
},
1818
},

renderer/components/ui/command.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ const CommandInput = React.forwardRef<
4747
<CommandPrimitive.Input
4848
ref={ref}
4949
className={cn(
50-
"flex w-full bg-transparent text-xs outline-none placeholder:text-black/50 dark:placeholder:text-white/50",
50+
"flex w-full bg-transparent text-xs outline-hidden placeholder:text-black/50 dark:placeholder:text-white/50",
5151
className,
5252
)}
5353
{...props}
@@ -121,7 +121,7 @@ const CommandItem = React.forwardRef<
121121
<CommandPrimitive.Item
122122
ref={ref}
123123
className={cn(
124-
"wora-transition relative flex cursor-pointer select-none items-center text-nowrap rounded-xl p-2 text-xs outline-none data-[disabled=true]:pointer-events-none data-[selected=true]:bg-black/5 data-[selected=true]:text-black data-[disabled=true]:opacity-50 dark:data-[selected=true]:bg-white/10 dark:data-[selected=true]:text-white",
124+
"wora-transition relative flex cursor-pointer select-none items-center text-nowrap rounded-xl p-2 text-xs outline-hidden data-[disabled=true]:pointer-events-none data-[selected=true]:bg-black/5 data-[selected=true]:text-black data-[disabled=true]:opacity-50 dark:data-[selected=true]:bg-white/10 dark:data-[selected=true]:text-white",
125125
className,
126126
)}
127127
{...props}

renderer/components/ui/context-menu.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ const ContextMenuSubTrigger = React.forwardRef<
3131
<ContextMenuPrimitive.SubTrigger
3232
ref={ref}
3333
className={cn(
34-
"wora-transition flex cursor-pointer select-none items-center rounded-lg p-2 text-xs outline-none hover:bg-black/5 data-[state=open]:bg-black/5 data-[state=open]:text-black dark:hover:bg-white/10 dark:data-[state=open]:bg-white/10 dark:data-[state=open]:text-white",
34+
"wora-transition flex cursor-pointer select-none items-center rounded-lg p-2 text-xs outline-hidden hover:bg-black/5 data-[state=open]:bg-black/5 data-[state=open]:text-black dark:hover:bg-white/10 dark:data-[state=open]:bg-white/10 dark:data-[state=open]:text-white",
3535
inset && "pl-8",
3636
className,
3737
)}
@@ -84,7 +84,7 @@ const ContextMenuItem = React.forwardRef<
8484
<ContextMenuPrimitive.Item
8585
ref={ref}
8686
className={cn(
87-
"wora-transition flex cursor-pointer select-none items-center rounded-lg p-2 text-xs outline-none hover:bg-black/5 data-[disabled]:pointer-events-none data-[disabled]:opacity-50 dark:hover:bg-white/10 dark:focus:bg-neutral-800 dark:focus:text-neutral-50",
87+
"wora-transition flex cursor-pointer select-none items-center rounded-lg p-2 text-xs outline-hidden hover:bg-black/5 data-disabled:pointer-events-none data-disabled:opacity-50 dark:hover:bg-white/10 dark:focus:bg-neutral-800 dark:focus:text-neutral-50",
8888
inset && "pl-8",
8989
className,
9090
)}
@@ -100,7 +100,7 @@ const ContextMenuCheckboxItem = React.forwardRef<
100100
<ContextMenuPrimitive.CheckboxItem
101101
ref={ref}
102102
className={cn(
103-
"relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-neutral-100 focus:text-neutral-900 data-[disabled]:pointer-events-none data-[disabled]:opacity-50 dark:focus:bg-neutral-800 dark:focus:text-neutral-50",
103+
"relative flex cursor-default select-none items-center rounded-xs py-1.5 pl-8 pr-2 text-sm outline-hidden focus:bg-neutral-100 focus:text-neutral-900 data-disabled:pointer-events-none data-disabled:opacity-50 dark:focus:bg-neutral-800 dark:focus:text-neutral-50",
104104
className,
105105
)}
106106
checked={checked}
@@ -124,7 +124,7 @@ const ContextMenuRadioItem = React.forwardRef<
124124
<ContextMenuPrimitive.RadioItem
125125
ref={ref}
126126
className={cn(
127-
"relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-neutral-100 focus:text-neutral-900 data-[disabled]:pointer-events-none data-[disabled]:opacity-50 dark:focus:bg-neutral-800 dark:focus:text-neutral-50",
127+
"relative flex cursor-default select-none items-center rounded-xs py-1.5 pl-8 pr-2 text-sm outline-hidden focus:bg-neutral-100 focus:text-neutral-900 data-disabled:pointer-events-none data-disabled:opacity-50 dark:focus:bg-neutral-800 dark:focus:text-neutral-50",
128128
className,
129129
)}
130130
{...props}

0 commit comments

Comments
 (0)