Skip to content

Streamline join flow, error messaging, and client cleanup#18

Merged
BackGwa merged 4 commits intodevelopfrom
refactor/optimize-frontend
Jan 13, 2026
Merged

Streamline join flow, error messaging, and client cleanup#18
BackGwa merged 4 commits intodevelopfrom
refactor/optimize-frontend

Conversation

@BackGwa
Copy link
Owner

@BackGwa BackGwa commented Jan 13, 2026

Description

This PR removes the redundant pre-connection validation step and consolidates password message handling into a single flow during participant join to reduce latency and state complexity. It also cleans up UI error display, improves client resource handling (QR scan canvas reuse, video srcObject cleanup, device list caching), and updates architecture docs to reflect the current data flow.

Type of Change

  • Bug fix (bugs/)
  • New feature (features/)
  • Refactoring (refactor/)
  • Hotfix (hotfix/)
  • Chore (chore/)

Changes Made

  • Simplified participant join flow by removing redundant validation and consolidating password handling into a single data listener.
  • Improved UI error messaging and corrected password validation text.
  • Optimized client resource usage (QR scan reuse, video cleanup, camera device caching) and removed unused code.
  • Updated ARCHITECTURE.md to match the revised join flow.

Checklist

  • Code follows the project's coding style
  • Self-review completed
  • Documentation updated (if necessary)

- Deleted PageTransition.tsx and related SCSS.
- Centralized password validation errors in PasswordInput component.
- Simplified MediaService and PeerService by removing redundant methods.
- Streamlined usePasswordProtection and usePasswordVerification hooks.
- Consolidated type definitions for Media and Peer connections.
- Clear video stream on unmount to prevent memory leaks.
- Use type imports for PeerJS to optimize build size.
- Cache camera devices in mediaService for reduced latency.
- Optimize QR scan by caching canvas context per video element.
- Removed `useEffect` from `usePasswordVerification` in favor of `useCallback` for better performance.
- Switched from direct state mutation to `useRef` for persistent variables like `tempPeerForVerification`.
- Simplified password message handling with `handlePasswordMessage`.
- Removed unnecessary `hostPeerId` parameter and validation logic for cleaner implementation.
- Updated README with new badge placement for improved visibility.
- Removed redundant connection validation steps in diagrams.
- Added spacing adjustments to README for better readability.
@BackGwa BackGwa added bug Something isn't working enhancement New feature or request labels Jan 13, 2026
@BackGwa BackGwa merged commit 68d23ad into develop Jan 13, 2026
5 checks passed
@BackGwa BackGwa deleted the refactor/optimize-frontend branch January 13, 2026 05:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant