Skip to content

Commit 7736dda

Browse files
author
Ritika Mishra
committed
refactored code and fixed all version related issues
1 parent cadacc6 commit 7736dda

File tree

8 files changed

+961
-2787
lines changed

8 files changed

+961
-2787
lines changed

package-lock.json

Lines changed: 893 additions & 2755 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 20 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -12,23 +12,23 @@
1212
"distDir": "out"
1313
},
1414
"dependencies": {
15-
"@radix-ui/react-accordion": "^1.2.0",
16-
"@radix-ui/react-avatar": "^1.0.4",
17-
"@radix-ui/react-checkbox": "^1.0.4",
18-
"@radix-ui/react-dialog": "^1.0.5",
19-
"@radix-ui/react-hover-card": "^1.1.1",
20-
"@radix-ui/react-icons": "^1.3.0",
21-
"@radix-ui/react-label": "^2.0.2",
22-
"@radix-ui/react-popover": "^1.1.1",
23-
"@radix-ui/react-radio-group": "^1.1.3",
24-
"@radix-ui/react-select": "^2.0.0",
25-
"@radix-ui/react-separator": "^1.0.3",
26-
"@radix-ui/react-slider": "^1.1.2",
27-
"@radix-ui/react-slot": "^1.0.2",
28-
"@radix-ui/react-switch": "^1.1.0",
29-
"@radix-ui/react-toggle": "^1.1.0",
30-
"@radix-ui/react-toggle-group": "^1.1.0",
31-
"@radix-ui/react-tooltip": "^1.0.7",
15+
"@radix-ui/react-accordion": "^1.2.12",
16+
"@radix-ui/react-avatar": "^1.1.11",
17+
"@radix-ui/react-checkbox": "^1.3.3",
18+
"@radix-ui/react-dialog": "^1.1.15",
19+
"@radix-ui/react-hover-card": "^1.1.15",
20+
"@radix-ui/react-icons": "^1.3.2",
21+
"@radix-ui/react-label": "^2.1.8",
22+
"@radix-ui/react-popover": "^1.1.15",
23+
"@radix-ui/react-radio-group": "^1.3.8",
24+
"@radix-ui/react-select": "^2.2.6",
25+
"@radix-ui/react-separator": "^1.1.8",
26+
"@radix-ui/react-slider": "^1.3.6",
27+
"@radix-ui/react-slot": "^1.2.4",
28+
"@radix-ui/react-switch": "^1.2.6",
29+
"@radix-ui/react-toggle": "^1.1.10",
30+
"@radix-ui/react-toggle-group": "^1.1.11",
31+
"@radix-ui/react-tooltip": "^1.2.8",
3232
"@types/p5": "^1.7.6",
3333
"@types/w3c-web-serial": "^1.0.6",
3434
"class-variance-authority": "^0.7.0",
@@ -41,17 +41,16 @@
4141
"html2canvas": "^1.4.1",
4242
"jszip": "^3.10.1",
4343
"lucide-react": "^0.460.0",
44-
"next": "^15.3.3",
44+
"next": "^16.0.3",
4545
"next-pwa": "^5.6.0",
4646
"next-themes": "^0.3.0",
47-
"react": "^18",
48-
"react-dom": "^18",
47+
"react": "18.3.1",
48+
"react-dom": "18.3.1",
4949
"react-icons": "^5.3.0",
5050
"smoothie": "^1.36.1",
5151
"sonner": "^1.5.0",
5252
"tailwind-merge": "^2.3.0",
5353
"tailwindcss-animate": "^1.0.7",
54-
"tailwindcss-textshadow": "^2.1.3",
5554
"uuid": "^11.0.3",
5655
"webgl-plot": "^0.7.2"
5756
},

public/manifest.json

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
{
2+
"name": "Chords",
3+
"short_name": "Chords",
4+
"start_url": "/",
5+
"display": "standalone",
6+
"icons": [
7+
{
8+
"src": "/chords-logo-192x192.png",
9+
"sizes": "192x192",
10+
"type": "image/png"
11+
},
12+
{
13+
"src": "/chords-logo-512x512.png",
14+
"sizes": "512x512",
15+
"type": "image/png"
16+
}
17+
],
18+
"screenshots": [
19+
{
20+
"src": "/screenshot-chords.png",
21+
"sizes": "1280x720",
22+
"type": "image/png",
23+
"form_factor": "wide"
24+
}
25+
]
26+
}

src/app/favicon.ico

-165 KB
Binary file not shown.

src/app/layout.tsx

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,9 +47,8 @@ export default function RootLayout({
4747
}>) {
4848
return (
4949
<html lang="en" suppressHydrationWarning>
50-
<head>
51-
<link rel="manifest" href={`${basePath}/manifest.json`} /> {/* ✅ Dynamic manifest */}
52-
</head>
50+
{/* ✅ Dynamic manifest */}
51+
<head><link rel="manifest" href={`${basePath}/manifest.json`} /></head>
5352
<body
5453
className={cn(
5554
lobsterTwo.variable,

src/components/Connection.tsx

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -357,11 +357,21 @@ const Connection: React.FC<ConnectionProps> = ({
357357
if (!workerRef.current) {
358358
initializeWorker();
359359
}
360-
setCanvasCount(selectedChannels.length)
360+
// Update parent canvasCount only when it differs to avoid unnecessary rerenders
361+
const newCount = selectedChannels.length;
362+
if (typeof setCanvasCount === 'function' && newCount !== canvasCount) {
363+
setCanvasCount(newCount);
364+
}
365+
361366
// Send canvasCount independently to the worker
362367
workerRef.current?.postMessage({ action: 'setCanvasCount', canvasCount: canvasElementCountRef.current });
363368
};
364-
setCanvasCountInWorker(canvasElementCountRef.current);
369+
370+
// Run the canvas count sync after render (and when selectedChannels change)
371+
useEffect(() => {
372+
setCanvasCountInWorker(canvasElementCountRef.current);
373+
// eslint-disable-next-line react-hooks/exhaustive-deps
374+
}, [selectedChannels.length]);
365375

366376
const setSelectedChannelsInWorker = (selectedChannels: number[]) => {
367377
if (!workerRef.current) {
@@ -1537,7 +1547,7 @@ const Connection: React.FC<ConnectionProps> = ({
15371547
<div className="flex gap-3 items-center justify-center">
15381548
{/* Connection button with tooltip */}
15391549
<TooltipProvider>
1540-
<Tooltip>
1550+
<Tooltip>
15411551
<TooltipTrigger asChild>
15421552
<Popover open={open} onOpenChange={setOpen}>
15431553
<PopoverTrigger asChild>

src/components/Contributors.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ const contributors = [
6262
export default function Contributors() {
6363
return (
6464
<Dialog>
65-
<DialogTrigger>
65+
<DialogTrigger asChild>
6666
<TooltipProvider>
6767
<Tooltip>
6868
<TooltipTrigger asChild>

tsconfig.json

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
"moduleResolution": "node",
1616
"resolveJsonModule": true,
1717
"isolatedModules": true,
18-
"jsx": "preserve",
18+
"jsx": "react-jsx",
1919
"incremental": true,
2020
"plugins": [
2121
{
@@ -35,9 +35,11 @@
3535
"**/*.ts",
3636
".next/types/**/*.ts",
3737
"**/*.tsx",
38-
"out/types/**/*.ts"
39-
, "scripts/generateManifest.mjs" ],
38+
"out/types/**/*.ts",
39+
"scripts/generateManifest.mjs",
40+
".next/dev/types/**/*.ts"
41+
],
4042
"exclude": [
4143
"node_modules"
4244
]
43-
}
45+
}

0 commit comments

Comments
 (0)