Skip to content

Conversation

@raymyers
Copy link
Owner

Summary

When edit mode is enabled, all diagram labels now show a pencil icon (✎) when hovering over them. This provides a visual indicator that the label is editable.

Changes

CloudNode Component (src/svgGen.tsx)

  • Wrapped text element in a <g> group with editable-label class when in edit mode
  • Added pencil icon (✎) text element positioned to the right of the label
  • Added CSS styles for hover effect (opacity transition from 0 to 1)

Tree Component (src/Tree.tsx)

  • Added pencil icon to each non-intermediate node label when edit mode is enabled
  • Applied editable-label class to nodes in edit mode
  • Added CSS hover styles for showing the pencil icon

Technical Details

  • Pencil icon uses a smooth 0.15s CSS opacity transition
  • Icon positioning calculated based on text bounding box dimensions
  • Clicking the pencil triggers the same edit functionality as clicking the label text
  • Feature only active when "Editing: ON" mode is enabled

Testing

  • All 45 existing tests pass
  • Verified visually with Conflict Cloud, Goal Tree, and Problem Tree diagrams

@raymyers can click here to continue refining the PR

- CloudNode (svgGen.tsx): Wrapped text in a group with editable-label class
  and added pencil icon that appears on hover when in edit mode
- Tree component (Tree.tsx): Added pencil icon next to each non-intermediate
  node label when edit mode is enabled, with CSS hover effect to show icon
- Both implementations use CSS opacity transition for smooth appearance
- Pencil icons are now always rendered in DOM
- Visibility controlled purely by CSS using svg.edit-mode class
- CSS rule: svg.edit-mode .label:hover .edit-pencil { opacity: 1 }
- Removed conditional rendering and JS-based opacity control
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.

3 participants