Skip to content

Implement Guest Login and Whiteboard History Playback (Time-Travel)#53

Open
Ashish1896 wants to merge 20 commits into
IEEE-PatchFest:mainfrom
Ashish1896:main
Open

Implement Guest Login and Whiteboard History Playback (Time-Travel)#53
Ashish1896 wants to merge 20 commits into
IEEE-PatchFest:mainfrom
Ashish1896:main

Conversation

@Ashish1896

Copy link
Copy Markdown

This PR addresses issue #21 by implementing:

  • A guest login form on the home page with name validation and persistence.
  • Real-time socket connection in the board with user identity registration (set-username).
  • A presence list in the board UI showing the current user.
  • Server-side handling for user registration and identity-aware drawing events.

Fixes #21

@Ashish1896 Ashish1896 changed the title Implement Guest Login system with socket-based identity handling Implement Guest Login and Whiteboard History Playback (Time-Travel) Dec 21, 2025
Added keyboard shortcuts for brush, eraser, clear, undo, redo, and help functionality. Enhanced toolbar with autosave and improved button styles.
…les and remove button

- Implements draggable image layer with grab cursor feedback
- Four corner resize handles (NW, NE, SW, SE) with proportional scaling
- Real-time position and scale updates via onUpdate callback
- Remove button (X) to delete images from canvas
- Proper event handling with mouse move/up listeners
- Visual feedback with blue border and resize cursors
- Prevents default drag behavior and event propagation
- Works as children component in canvas to display imported images
- Closes IEEE-PatchFest#14: Image Import Feature
- Import ImageLayer component for rendering draggable/resizable images
- Map through playbackData.images array and render ImageLayer for each image
- Implement onUpdate callback that updates image state and emits socket events
- Implement onRemove callback that deletes images and emits removal events
- Pass canvas size to ImageLayer for proper boundary calculations
- Emit 'updateImage' and 'removeImage' events for real-time collaboration
- Closes IEEE-PatchFest#14: Image Import Feature (partial - rendering and interaction)
Added a comprehensive contribution roadmap outlining strategic priorities, technical implementations, and expected outcomes for contributors to the real-time collaborative whiteboard project.
…chFest#8)

This file implements the CommandHistory class for managing undo/redo functionality in a collaborative whiteboard drawing application. It includes Command, DrawCommand, and ClearCommand classes to handle Implement stack-based undo/redo system with Command design pattern:
- CommandHistory class managing undo/redo stacks with max size limits
- DrawCommand for recording individual drawing strokes
- ClearCommand for canvas clear operations
- Support for multiple commands with proper state management
- Prevents recursive command execution
- Includes serialization for potential localStorage persistence
- Ready for integration into Canvas component
Closes IEEE-PatchFest#8: Add Undo / Redo Functionalitydrawing actions and state management.
Implement custom React hook for undo/redo integration:
- Custom useUndoRedo hook integrating CommandHistory with React
- Provides recordDraw, recordClear, undo, redo methods
- Tracks canUndo/canRedo states for UI integration
- Keyboard shortcuts: Ctrl+Z (undo), Ctrl+Y or Ctrl+Shift+Z (redo)
- Works with canvas context and ref for drawing operations
- Cleanup on component unmount to prevent memory leaks
- Ready to integrate into Canvas component
Part of IEEE-PatchFest#8: Add Undo / Redo Functionality
Integrate CommandHistory and useUndoRedo hook with Canvas:
- Import useUndoRedo hook at top of component
- Initialize hook with canvasRef and canvas context
- Call recordDraw() in both startDrawing and draw functions
- Call recordClear() in canvas clear method
- Hook automatically handles keyboard shortcuts (Ctrl+Z, Ctrl+Y)
- Canvas state now tracked with full undo/redo capability
- Ready for toolbar button integration
Part of IEEE-PatchFest#8: Add Undo / Redo Functionality
Add Undo/Redo buttons with full UI integration:
- Add onUndo, onRedo, canUndo, canRedo parameters to Toolbar component
- Implement disabled state styling based on canUndo/canRedo
- Green (#4CAF50) Undo button with ↶ icon
- Blue (#2196F3) Redo button with ↷ icon
- Keyboard shortcut hints in button titles
- Proper button styling matching existing toolbar buttons
- Buttons automatically disable when no history available
Closes IEEE-PatchFest#8: Add Undo / Redo Functionality
…st#9)

Add comprehensive room management utility:
- Create new rooms with auto-generated IDs
- Join existing rooms by ID
- List all available rooms
- Socket.io namespace isolation per room
- Async drawing save/load per room
- Room statistics tracking (users, drawing count)
- Room ID validation and generation
- Proper error handling for room operations
- Ready for API endpoints integration
Implements IEEE-PatchFest#9: Create Multiple Rooms
Implement useRoom custom React hook:
- Create new rooms with automatic naming
- Join existing rooms by ID
- Fetch list of all available rooms
- Save/load drawings per room
- Room statistics tracking
- Loading and error state management
- Async room operations with proper error handling
- Auto-load drawings when joining room
- Direct manager access for advanced usage
Part of IEEE-PatchFest#9: Create Multiple Rooms
…est#16)

Add comprehensive viewport management for zoom/pan:
- Mouse wheel zoom (0.1x to 5x scale) with center-point zoom
- Pan via click-drag (space+drag or middle-mouse support ready)
- Coordinate transformation (screen↔world) for accurate drawing
- Configurable zoom bounds and step size
- Viewport state save/restore for persistence
- Fit-to-view auto-scaling functionality
- Transform matrix management for proper scaling
- Smooth zoom with center point preservation
Implements IEEE-PatchFest#16: Add Zoom & Pan Controls
…E-PatchFest#16)

Added viewport management functionality to the canvas component, allowing zooming and resetting the view.
…PatchFest#16)

Added panning functionality and zoom controls to the canvas component.
Updated project title and enhanced project overview with badges and features.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add Basic Authentication (Temporary Guest Login)

1 participant