-
Notifications
You must be signed in to change notification settings - Fork 65
version 2.0.1-alpha #109
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
version 2.0.1-alpha #109
Conversation
…an up unused imports
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Issues:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This is a comprehensive rewrite that migrates the screen recording application from a Parcel-based vanilla JavaScript architecture to a modern Next.js 15 + React 19 + TypeScript stack with Tailwind CSS 4. The refactor introduces React hooks for state management, improved type safety, and a component-based architecture while maintaining the core screen recording functionality.
Key Changes:
- Complete migration from vanilla JS to Next.js 15 with React 19 and TypeScript
- Replaced SCSS with Tailwind CSS 4 for styling
- Introduced custom React hooks (useRecording, useMediaStreams, useCameraPosition) for better code organization
- Added TypeScript type safety throughout the codebase
Reviewed Changes
Copilot reviewed 60 out of 91 changed files in this pull request and generated 7 comments.
Show a summary per file
| File | Description |
|---|---|
| package.json | Updated dependencies from Parcel to Next.js 15 + React 19 ecosystem |
| tsconfig.json | Added TypeScript configuration for Next.js with strict mode |
| src/hooks/useRecording.ts | New custom hook for managing recording lifecycle with MediaRecorder API |
| src/hooks/useMediaStreams.ts | New hook for managing screen/camera/audio stream state |
| src/utils/streamCombiner.ts | Extracted stream combining logic with canvas rendering for PiP layouts |
| src/utils/telemetry.ts | Added telemetry service for analytics tracking |
| src/components/* | New React components replacing vanilla JS DOM manipulation |
| src/app/* | Next.js App Router pages and layout |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| useEffect(() => { | ||
| const handleKeyPress = (event: KeyboardEvent) => { |
Copilot
AI
Oct 29, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Duplicate keyboard shortcut handlers detected. There are two separate useEffect hooks (lines 368-436 and 477-503) implementing the same keyboard shortcuts. This creates redundant event listeners and could lead to handlers firing twice. Consolidate into a single keyboard shortcut handler.
| useEffect(() => { | ||
| const onKey = (e: KeyboardEvent) => { | ||
| const key = e.key.toLowerCase(); | ||
| const mod = e.ctrlKey || e.metaKey; | ||
| if (!mod) return; | ||
| if (key === 'r') { | ||
| e.preventDefault(); | ||
| if (isRecording) { | ||
| handleStopRecording(); | ||
| } else { | ||
| handleStartRecording(); | ||
| } | ||
| } | ||
| if (key === 'p') { e.preventDefault(); if (isRecording) { pauseRecording(); } } | ||
| if (key === 'm') { e.preventDefault(); handleToggleMic(); } | ||
| if (key === 's') { | ||
| e.preventDefault(); | ||
| if (isScreenShared) { | ||
| stopScreen(); | ||
| } else { | ||
| handleShareScreen(); | ||
| } | ||
| } | ||
| }; | ||
| window.addEventListener('keydown', onKey); | ||
| return () => window.removeEventListener('keydown', onKey); | ||
| }, [isRecording, handleStopRecording, handleStartRecording, pauseRecording, handleToggleMic, isScreenShared, stopScreen, handleShareScreen]); |
Copilot
AI
Oct 29, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Duplicate keyboard shortcut handlers detected. There are two separate useEffect hooks (lines 368-436 and 477-503) implementing the same keyboard shortcuts. This creates redundant event listeners and could lead to handlers firing twice. Consolidate into a single keyboard shortcut handler.
| useEffect(() => { | |
| const onKey = (e: KeyboardEvent) => { | |
| const key = e.key.toLowerCase(); | |
| const mod = e.ctrlKey || e.metaKey; | |
| if (!mod) return; | |
| if (key === 'r') { | |
| e.preventDefault(); | |
| if (isRecording) { | |
| handleStopRecording(); | |
| } else { | |
| handleStartRecording(); | |
| } | |
| } | |
| if (key === 'p') { e.preventDefault(); if (isRecording) { pauseRecording(); } } | |
| if (key === 'm') { e.preventDefault(); handleToggleMic(); } | |
| if (key === 's') { | |
| e.preventDefault(); | |
| if (isScreenShared) { | |
| stopScreen(); | |
| } else { | |
| handleShareScreen(); | |
| } | |
| } | |
| }; | |
| window.addEventListener('keydown', onKey); | |
| return () => window.removeEventListener('keydown', onKey); | |
| }, [isRecording, handleStopRecording, handleStartRecording, pauseRecording, handleToggleMic, isScreenShared, stopScreen, handleShareScreen]); | |
| // (Removed duplicate keyboard shortcut useEffect. Logic is now consolidated above.) |
| useEffect(() => { | ||
| const handleBeforeUnload = (e: BeforeUnloadEvent) => { |
Copilot
AI
Oct 29, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Duplicate beforeunload event handlers detected. Two separate useEffect hooks (lines 224-234 and 506-515) register the same beforeunload event listener, causing duplicate event handlers. Remove one of these duplicate useEffect blocks.
| useEffect(() => { | ||
| const beforeUnload = (e: BeforeUnloadEvent) => { | ||
| if (isRecording) { | ||
| e.preventDefault(); | ||
| e.returnValue = ''; | ||
| } | ||
| }; | ||
| window.addEventListener('beforeunload', beforeUnload); | ||
| return () => window.removeEventListener('beforeunload', beforeUnload); | ||
| }, [isRecording]); |
Copilot
AI
Oct 29, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Duplicate beforeunload event handlers detected. Two separate useEffect hooks (lines 224-234 and 506-515) register the same beforeunload event listener, causing duplicate event handlers. Remove one of these duplicate useEffect blocks.
| useEffect(() => { | |
| const beforeUnload = (e: BeforeUnloadEvent) => { | |
| if (isRecording) { | |
| e.preventDefault(); | |
| e.returnValue = ''; | |
| } | |
| }; | |
| window.addEventListener('beforeunload', beforeUnload); | |
| return () => window.removeEventListener('beforeunload', beforeUnload); | |
| }, [isRecording]); |
| startGuardRef.current = false; | ||
| }; | ||
|
|
||
| mediaRecorder.start(1000); // keep timeslice; make configurable later |
Copilot
AI
Oct 29, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Magic number 1000 used as timeslice parameter. This should be extracted to a constant in RECORDING_CONFIG for consistency with other configuration values and to make it configurable as mentioned in the comment.
| "test": "npm run check-format && npm run check-lint && npm run build", | ||
| "prepare": "husky install" | ||
| "dev": "next dev --turbopack", | ||
| "build": "next build --turbopack", |
Copilot
AI
Oct 29, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Using --turbopack flag in production build. Turbopack is experimental and may not be stable for production builds. Consider removing the --turbopack flag from the build script and only use it for development.
| "build": "next build --turbopack", | |
| "build": "next build", |
| canvas.width = 16; | ||
| canvas.height = 9; |
Copilot
AI
Oct 29, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Canvas initialized with incorrect dimensions (16x9 pixels). This creates an extremely small canvas that will be immediately resized, causing unnecessary initial rendering. Initialize with more reasonable default dimensions or the first available video dimensions.
|
@copilot could you please provide me the summary of the changes needed in a paragraph. |
|
@heysagnik I've opened a new pull request, #110, to work on those changes. Once the pull request is ready, I'll request review from you. |
This PR is for implementing new changes in terms of UI and features