Fix demo canvas (network visualization) — rendering broken after refactoring #15

Open
opened 2026-05-19 21:42:59 +00:00 by NW · 0 comments
Owner

Bug Description

The demo canvas (network test/visualization block) stopped working after the last refactoring. Canvas width/height HTML attributes were removed, and the JS code no longer properly sets canvas dimensions.

Root Cause Analysis

  • Canvas width and height attributes removed from HTML during refactoring
  • getCanvasSize() function does not handle zero-width container (returns 0,0)
  • JS does not set canvas dimensions on init or resize
  • Demo visualization fails to render entirely

Acceptance Criteria

  • Canvas renders network visualization on page load
  • Animation loop runs smoothly (no blank canvas)
  • Interactive buttons (Run Test, Reset, etc.) are functional
  • Canvas resizes correctly on window resize and orientation change
  • getCanvasSize() handles zero-width container gracefully
  • Demo works on both desktop and mobile viewports

Files Likely Affected

  • js/demo.js — canvas dimension handling, getCanvasSize()
  • index.html — canvas element attributes or data attributes

How to Verify

  1. Load landing page
  2. Scroll to network demo section
  3. Confirm canvas shows animated network visualization
  4. Click buttons (Run Test, Reset) and confirm they work
  5. Resize browser window — canvas should adapt
  6. Test on mobile viewport (375px width)
## Bug Description The demo canvas (network test/visualization block) stopped working after the last refactoring. Canvas `width`/`height` HTML attributes were removed, and the JS code no longer properly sets canvas dimensions. ## Root Cause Analysis - Canvas `width` and `height` attributes removed from HTML during refactoring - `getCanvasSize()` function does not handle zero-width container (returns `0,0`) - JS does not set canvas dimensions on init or resize - Demo visualization fails to render entirely ## Acceptance Criteria - [ ] Canvas renders network visualization on page load - [ ] Animation loop runs smoothly (no blank canvas) - [ ] Interactive buttons (Run Test, Reset, etc.) are functional - [ ] Canvas resizes correctly on window resize and orientation change - [ ] `getCanvasSize()` handles zero-width container gracefully - [ ] Demo works on both desktop and mobile viewports ## Files Likely Affected - `js/demo.js` — canvas dimension handling, `getCanvasSize()` - `index.html` — canvas element attributes or data attributes ## How to Verify 1. Load landing page 2. Scroll to network demo section 3. Confirm canvas shows animated network visualization 4. Click buttons (Run Test, Reset) and confirm they work 5. Resize browser window — canvas should adapt 6. Test on mobile viewport (375px width)
NW added this to the Landing Bug Fixes 2025-05 milestone 2026-05-19 21:42:59 +00:00
NW added the status::newpriority::hightype::bugworkflow::landing labels 2026-05-19 21:42:59 +00:00
Sign in to join this conversation.