Skip to content

Convert#1

Merged
nishanth-kj merged 19 commits into
mainfrom
convert
Apr 30, 2026
Merged

Convert#1
nishanth-kj merged 19 commits into
mainfrom
convert

Conversation

@nishanth-kj

Copy link
Copy Markdown
Owner

Description

This pull request introduces a professional-grade, node-based vector design environment to the project. It transforms the basic whiteboard into a sophisticated design tool with support for multi-object management, proportional scaling, and professional drafting.

Key Enhancements:

  • Node-Based Interaction: Implemented a robust selection system with Marquee (drag-to-select) and multi-select capabilities.
  • Universal Resizing: Integrated an eight-point handle system allowing for pixel-perfect scaling of shapes, text, and freehand sketches.
  • Proportional Freehand Scaling: Created a coordinate mapping algorithm to scale complex hand-drawn paths without distortion.
  • Inline Text Drafting: Added a floating, on-canvas text editor with auto-resize and multi-line support.
  • Viewport Management: Implemented viewport-aware panning, zooming, and a dynamic coordinate system (scale/offset).

Fixes # (Optimizing Vector Drawing Toolset & Interaction Logic)

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation update

How Has This Been Tested?

  • Manual Test: Verified multi-node selection and group movement reliability.
  • Manual Test: Validated proportional scaling for freehand sketches across different zoom levels.
  • Manual Test: Confirmed on-canvas text editor responsiveness and multi-line layout.
  • Manual Test: Tested keyboard shortcuts (Delete, Backspace, Shift+Scroll) for design efficiency.

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas (Resizing Logic, Point Mapping)
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works

…lobal styling, and workspace layout components
@vercel

vercel Bot commented Apr 30, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
web-utils Ready Ready Preview, Comment Apr 30, 2026 7:23pm

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: d94cf661bb

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread components/draw/draw-page.tsx Outdated
Comment on lines +378 to +379
if (current.type === 'freehand') current.points = [...(current.points || []), { x, y }];
else { current.x2 = x; current.y2 = y; }

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Update freehand bounds while drawing

Freehand strokes never update x2/y2 as points are added, so their stored bounding box stays at the initial click point. Any feature that relies on element bounds (e.g. getHandleAtPosition and marquee selection in handleMouseUp) will behave incorrectly for freehand drawings, making them hard or impossible to resize/select unless the start point happens to fall inside the interaction area.

Useful? React with 👍 / 👎.

Comment thread components/draw/draw-page.tsx Outdated
Comment on lines +367 to +371
if (action === 'moving' && selectedElementIds.length > 0) {
const dx = (e.clientX - startPanPos.x) / scale;
const dy = (e.clientY - startPanPos.y) / scale;
setElements(prev => prev.map(el => selectedElementIds.includes(el.id) ? { ...el, x1: el.x1 + dx, y1: el.y1 + dy, x2: el.x2 + dx, y2: el.y2 + dy, points: el.points?.map(p => ({ x: p.x + dx, y: p.y + dy })) } : el));
setStartPanPos({ x: e.clientX, y: e.clientY });

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Record history before move/resize mutations

Move and resize paths mutate elements directly on mouse movement but never push a pre-change snapshot to history, while undo relies entirely on that stack. In practice, after dragging or resizing objects, pressing Undo will not revert the latest transform, which breaks expected editor behavior and makes accidental transforms hard to recover from.

Useful? React with 👍 / 👎.

Comment thread components/draw/draw-page.tsx Outdated
Comment on lines +296 to +299
const newEl: Element = {
id, x1: x, y1: y, x2: x, y2: y, type: tool, color, strokeWidth, zIndex: elements.length,
points: tool === 'freehand' ? [{x, y}] : undefined
};

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Implement eraser behavior instead of creating inert elements

When the eraser tool is active, mouse down falls through the generic drawing branch and creates an element with type: 'eraser'. Since rendering and hit logic have no eraser handling, this action neither draws visible output nor removes existing objects, so the advertised eraser tool is effectively non-functional.

Useful? React with 👍 / 👎.

@nishanth-kj nishanth-kj merged commit e7ff596 into main Apr 30, 2026
2 checks passed
@nishanth-kj nishanth-kj deleted the convert branch April 30, 2026 19:24
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.

1 participant