Skip to content

Conversation

kundan132025
Copy link

@kundan132025 kundan132025 commented Oct 3, 2025

Description

Adds comprehensive undo/redo functionality to DoodleBUGS interface as requested in issue #359.

Features Added

  • Undo/redo buttons in canvas toolbar
  • Keyboard shortcuts: Ctrl+Z (undo) and Ctrl+Shift+Z/Ctrl+Y (redo)
  • Integration with cytoscape-undo-redo for graph operations

Technical Implementation

  • UndoRedoControls.vue: New component with toolbar buttons
  • useUndoRedo.ts: Composable for centralized undo/redo logic
  • cytoscape-undo-redo: External library integration with TypeScript definitions
  • useGraphInstance.ts: Enhanced with undo-redo initialization
  • GraphCanvas.vue: Fixed onMounted callback structure (was preventing graph rendering)

Testing

  • Buttons enable/disable based on available actions
  • Keyboard shortcuts work globally (except in input fields)
  • Node dragging operations are undoable
doodlebug.v1.mp4

Files Changed

  • Added: src/components/ui/UndoRedoControls.vue
  • Added: src/composables/useUndoRedo.ts
  • Added: src/types/cytoscape-undo-redo.d.ts
  • Modified: package.json (added cytoscape-undo-redo dependency)
  • Modified: Canvas toolbar, GraphInstance, GraphElements composables

Fixes #359

@shravanngoswamii shravanngoswamii self-requested a review October 3, 2025 17:24
@shravanngoswamii shravanngoswamii added the DoodleBUGS DoodleBUGS web app label Oct 4, 2025
@kundan132025 kundan132025 removed their assignment Oct 4, 2025
@kundan132025
Copy link
Author

kundan132025 commented Oct 4, 2025

@shravanngoswamii , I accidentally unassigned myself from this issue. Could you please reassign it to me? Sorry for confusion.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
DoodleBUGS DoodleBUGS web app
Projects
None yet
Development

Successfully merging this pull request may close these issues.

DoodleBUGS: Undo/Redo Functionality
2 participants