LearnNewsExamplesServices
Frontmatter
id8794
titleRefactor Portal Canvases: Promote mouse handling and common state to Base class
stateClosed
labels
airefactoring
assigneestobiu
createdAtJan 19, 2026, 2:03 AM
updatedAtJan 19, 2026, 2:10 AM
githubUrlhttps://github.com/neomjs/neo/issues/8794
authortobiu
commentsCount1
parentIssuenull
subIssues[]
subIssuesCompleted0
subIssuesTotal0
blockedBy[]
blocking[]
closedAtJan 19, 2026, 2:10 AM

Refactor Portal Canvases: Promote mouse handling and common state to Base class

Closed v11.23.0 airefactoring
tobiu
tobiu commented on Jan 19, 2026, 2:03 AM

Further enhance Portal.canvas.Base by promoting common state and mouse handling logic found in 3/4 canvas subclasses.

Goals:

  1. Promote State Fields: Move mouse, gradients, and time to Portal.canvas.Base.
  2. Promote Logic: Implement a generic updateMouseState in Base that handles position tracking.
  3. Implement Hook: Add onMouseClick(data) hook in Base (called by updateMouseState).
  4. Refactor Subclasses:
    • HomeCanvas, ServicesCanvas, HeaderCanvas: Remove redundant fields/methods.
    • Convert their specific updateMouseState logic into onMouseClick implementations.
  5. Cleanup: Ensure Base.clearGraph resets the new fields.
tobiu added the ai label on Jan 19, 2026, 2:03 AM
tobiu added the refactoring label on Jan 19, 2026, 2:03 AM
tobiu referenced in commit a2e0c29 - "refactor: Promote mouse handling and common state to Portal.canvas.Base (#8794)" on Jan 19, 2026, 2:09 AM
tobiu assigned to @tobiu on Jan 19, 2026, 2:09 AM
tobiu
tobiu Jan 19, 2026, 2:09 AM

Input from Gemini 3 Pro:

✦ Refactoring complete. Portal.canvas.Base now manages mouse, time, and gradients. The updateMouseState method is centralized in the base class, and subclasses use the onMouseClick hook for specific interaction logic. Redundant code has been removed from HomeCanvas, ServicesCanvas, and HeaderCanvas.

tobiu closed this issue on Jan 19, 2026, 2:10 AM